use of io.helidon.common.reactive.MultiFromOutputStream in project metro-jax-ws by eclipse-ee4j.
the class HelidonAdapter method publishWSDLX.
public void publishWSDLX(WSHTTPConnection c) throws IOException {
// res.status(Http.Status.OK_200);
// res.headers().add("Content-Type", Collections.singletonList("text/xml;charset=utf-8"));
// res.send();
HelidonConnectionImpl con = (HelidonConnectionImpl) c;
// con.getInput().close();
SDDocument doc = wsdls.get(con.getQueryString());
if (doc == null) {
// writeNotFoundErrorPage(con,"Invalid Request");
return;
}
// con.req.
ServerResponse res = con.getResponse();
res.status(Http.Status.OK_200);
res.headers().add("Content-Type", Collections.singletonList("text/xml;charset=utf-8"));
// res.send(con.getOutput(), OutputStream.class);
// res.send("<s>hello</s>");
// con.setStatus(HttpURLConnection.HTTP_OK);
// con.setContentTypeResponseHeader("text/xml;charset=utf-8");
//
// // OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);
// //con.res.
// OutputStream os = con.getOutput();
// OutputStream os = new ByteArrayOutputStream();
MultiFromOutputStream os = IoMulti.outputStreamMulti();
PortAddressResolver portAddressResolver = getPortAddressResolver(con.getBaseAddress());
DocumentAddressResolver resolver = getDocumentAddressResolver(portAddressResolver);
res.send(os.map(byteBuffer -> DataChunk.create(false, true, byteBuffer)));
doc.writeTo(portAddressResolver, resolver, os);
// con.res.send(() -> {
// });
os.close();
}
Aggregations