[ 
http://issues.apache.org/jira/browse/CXF-247?page=comments#action_12450712 ] 
            
Jonathan Hall commented on CXF-247:
-----------------------------------

Please close, problem is elsewhere

> HTTP POST SOAP Requests not working.
> ------------------------------------
>
>                 Key: CXF-247
>                 URL: http://issues.apache.org/jira/browse/CXF-247
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus
>    Affects Versions: 2.0-M1
>            Reporter: Jonathan Hall
>         Attachments: BodyNotRequired.patch, BodyRequired.patch
>
>
> When sending a request in the form of the example below, I recieve a no such 
> method Body error.
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>    <soap:Body>
>      <getProductDetails xmlns="http://warehouse.example.com/ws";>
>        <productID>827635</productID>
>      </getProductDetails>
>    </soap:Body>
>  </soap:Envelope>
> This is caused by a .getLocalName() call returning the <soap:Body> element in 
> WrappedInInterceptor.java. As far as I am aware, all SOAP messages require a 
> body, so the following should fix it:
> WrappedInInterceptor.java
>  public void handleMessage(Message message) { ...
> if (operation == null) {
> // Added code
>        try {
>                     xmlReader.nextTag();              
>                 } catch (Exception e) {
>                     throw new Fault(new 
> org.apache.cxf.common.i18n.Message("NO_OPERATION_ELEMENT", BUNDLE));
>                 }  
> // End of added code
>        String local = xmlReader.getLocalName(); ...
> If I am mistaken and a Body element is not always required :
>  public void handleMessage(Message message) { ...
> if (operation == null) {
> // Added code
>             if (xmlReader.getLocalName().equals("Body")) {
>                 try {
>                     xmlReader.nextTag();              
>                 } catch (Exception e) {
>                     throw new Fault(new 
> org.apache.cxf.common.i18n.Message("NO_OPERATION_ELEMENT", BUNDLE));
>                 }  
>             }
> // End of added code
>        String local = xmlReader.getLocalName(); ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to