I'm getting an error with ServiceMix 3.0 when exposing a jsr181:endpoint
externally using a http:endpoint.  The wsdl that is auto-generated does not
use wrapped style parameters (i.e. the message has more than one part), but
when consuming a soap request generated from that wsdl, I get an error
because SoapReader does not correctly parse the document.

The generated wsdl looks like this:

<xsd:schema attributeFormDefault="qualified" 
                elementFormDefault="qualified" 
                targetNamespace="http://edgenet.com"; 
                xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
       
       <xsd:element name="userName" type="xsd:string"/>
       <xsd:element name="pwd" type="xsd:string"/> 
               .
               .
               .
</xsd:schema>

<!-- NOTE: Not using wrapped style -->
<wsdl:message name="authenticateRequest">
    <wsdl:part element="tns:userName" name="userName"/>
    <wsdl:part element="tns:pwd" name="pwd"/>
</wsdl:message>


The soap request generated using this wsdl looks like:

<?xml version="1.0" encoding="utf-8"?>
   <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
      <soap:Body>
         <userName xmlns="http://edgenet.com";>bsmith</userName>
         <pwd xmlns="http://edgenet.com";>mypassword</pwd>
      </soap:Body>
   </soap:Envelope>


This results in the following soap fault:

<?xml version="1.0" encoding="UTF-8"?>
<fault>
   <message>Not enough message parts were received for the
operation.</message>
</fault>

When I turn debugging on, I can see that the original message is getting
truncated:


DEBUG - DeliveryChannelImpl            - Sent: InOut[
  id: ID:kberthe-m675-4657-1159820294925-7:0
  status: Active
  role: consumer
  service: {http://edgenet.com}SecurityService
  operation: {http://edgenet.com}authenticate
  in: <?xml version="1.0" encoding="UTF-8"?><userName
xmlns="http://edgenet.com";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>bsmith</userName>

Notice the document ends after the <userName> element (<pwd> is dropped,
eventually causing XFire to fault because it's expecting a second
parameter).

Debugging through the code, it looks like SoapReader.readSoapUsingStax()
stops parsing after it gets the first child element of the <body> element.

I then forced it to use dom to parse the entire document and
SoapReader.readSoapUsingDom() explicitly throws an Exception when the body
element has more than one child.

So the question is, should the jsr181 endpoint be generating wsdls that only
use one message part, or should SoapReader be able to handle the wsdl that
it's currently generating?
-- 
View this message in context: 
http://www.nabble.com/SoapReader-assumes-wrapped-style--tf2372333.html#a6609335
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to