[jbossws-issues] [JBoss JIRA] (JBWS-3424) CXF does not return status code 200 when Oneway webservice is invoked via HTTP
Jim Ma (JIRA)
jira-events at lists.jboss.org
Thu Feb 2 04:49:49 EST 2012
[ https://issues.jboss.org/browse/JBWS-3424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12663659#comment-12663659 ]
Jim Ma commented on JBWS-3424:
------------------------------
JBossWS-CXF expects the following request and respond with 200 OK:
==== Request ====
POST /context/test HTTP/1.1
Content-Length: 186
Content-Type: text/xml; charset=utf-8
Host: 127.0.0.1:18000
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<test:input xmlns:test="urn:test">foobar</test:input>
</soap:Body>
</soap:Envelope>
==== Response ====
HTTP/1.1 200 OK
Content-Type: text/xml;charset=UTF-8
Content-Length: 132
Server: Jetty(7.5.4.v20111024)
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body/></SOAP-ENV:Envelope>
==============
To send this right format of request, I changed the code which send the request and it works:
Socket sock = new Socket("localhost", 18000);
BufferedReader reader = new BufferedReader(new InputStreamReader(sock.getInputStream()));
Thread t = new MyReader(reader);
t.start();
OutputStream out = sock.getOutputStream();
String method = "POST /context/test HTTP/1.1\r\n";
out.write(method.getBytes(), 0, method.getBytes().length);
String contentLength = "Content-Length: " + REQUEST_BODY.length() + "\r\n";
out.write(contentLength.getBytes(), 0, contentLength.getBytes().length);
//only need one \r\n
>> String contentType = "Content-Type: text/xml; charset=\"utf-8\"\r\n";
out.write(contentType.getBytes(), 0, contentType.getBytes().length);
//add host header
>> String host = "Host: 127.0.0.1:18080\r\n";
>> out.write(host.getBytes(), 0, host.getBytes().length);
//add new line
>> String cr = "\r\n";
out.write(cr.getBytes(), 0, cr.getBytes().length);
out.write(REQUEST_BODY.getBytes(), 0, REQUEST_BODY.getBytes().length);
String eof = "\r\n\r\n";
out.write(eof.getBytes(), 0, eof.getBytes().length);
out.flush();
Thread.sleep(1000);
sock.close();
> CXF does not return status code 200 when Oneway webservice is invoked via HTTP
> ------------------------------------------------------------------------------
>
> Key: JBWS-3424
> URL: https://issues.jboss.org/browse/JBWS-3424
> Project: JBoss Web Services
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: jbossws-cxf
> Affects Versions: jbossws-cxf-4.0
> Reporter: Magesh Bojan
> Assignee: Jim Ma
> Attachments: reproducer.zip
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbossws-issues
mailing list