[jboss-dev-forums] [JBoss ESB Development] - Problem in retrieving WSDL from remote endpoint
Vitaliy Lukashev
do-not-reply at jboss.com
Wed Mar 24 04:16:35 EDT 2010
Vitaliy Lukashev [http://community.jboss.org/people/VitaliyLu] replied to the discussion
"Problem in retrieving WSDL from remote endpoint"
To view the discussion, visit: http://community.jboss.org/message/533645#533645
--------------------------------------------------------------
Hi all !
I want to know have i a right in decision?
in a HttpGatewayServlet class:
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// if it's a wsdl request, serve up the contract then short-circuit
if ("wsdl".equalsIgnoreCase(req.getQueryString())) {
resp.setCharacterEncoding("UTF-8");
Charset charset = Charset.forName("UTF-8"); // add
CharsetEncoder chr = charset.newEncoder(); //add
String mimeType = (contract != null ? contract.getMimeType() : "text/xml");
resp.setContentType(mimeType);
String data = (contract != null ? contract.getData() : "<definitions/>");
ByteBuffer bbuf = chr.encode(CharBuffer.wrap(data)); //add
resp.setContentLength(bbuf.capacity()); // this is problem place i change length buf
Writer writer = new BufferedWriter(resp.getWriter());
writer.write(data);
writer.flush();
return;
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533645#533645]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20100324/03a3967c/attachment.html
More information about the jboss-dev-forums
mailing list