This should now be fixed on svn head in apache incubator.
If you do not want to update your whole source tree, you can just
grab the SaajMarshaler at http://svn.apache.org/viewcvs.cgi/incubator/servicemix/trunk/servicemix-components/src/main/java/org/servicemix/components/saaj/SaajMarshaler.java?rev=357934&view=markup

Guillaume

[EMAIL PROTECTED] wrote:

Guillaume,

Using the HttpSoapConnector (from v1055 svn.codehaus.org) to communicate
with a different web service, I now get the following response (Execution
is: SoapClient -> HttpSoapConnector -> SaajComponent -> WebService):
<?xml version='1.0' encoding='UTF-8'?>
<soap:Envelope 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";>
   <soap:Body>
       <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:d="http://www.w3.org/2001/XMLSchema";
xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
xmlns:wn0="http://idoox.com/interface";
xmlns:wn1="http://systinet.com/soap-jta/";
xmlns:wn2="http://systinet.com/wsdl/com/cexp/ws/test/";>
           <e:Body>
               <wn2:getPersonResponse
xmlns:wn2="http://systinet.com/wsdl/com/cexp/ws/test/";>
                   <wn2:response i:type="wn2:Person">
                       <wn2:description i:type="d:string">Desktop
customizer</wn2:description>
                       <wn2:firstName
i:type="d:string">Jonathan</wn2:firstName><wn2:lastName
i:type="d:string">Edwards</wn2:lastName>
                   </wn2:response>
               </wn2:getPersonResponse>
           </e:Body>
       </e:Envelope>
   </soap:Body>
</soap:Envelope>

As you can see, the output from the SaajComponent is being re-wrapped by the
HttpSoapConnector in another SoapEnvelope. Is this the expected behavior?

/jonathan

-----Original Message-----
From: Guillaume Nodet [mailto:[EMAIL PROTECTED]
Sent: Monday, December 19, 2005 1:34 PM
To: [email protected]
Subject: Re: [servicemix-user] Problems invoking a web service with SOAP


You should try using the HttpSoapConnector instead of the HttpConnector + XSLT transformer. The HttpSoapConnector uses a DOM representation to extract the element in the Body tag, so
there should be no parsing errors.

Cheers,
Guillaume Nodet

[EMAIL PROTECTED] wrote:

Help!

I have run in to a slight problem with an exchange that I
have set up within
ServiceMix. The set up is as follows:

Soap Client -> HttpConnector -> ChainedComponent -> (XSLT to
remove SOAP
body -> SaajComponent -> SOAP Web Service)

This operation is synchronous, and works on simple XML where
there are no
complex namespaces in the XML. Ths following request,
however, does not
function as expected:

<?xml version="1.0" encoding="UTF-8"?>.
<e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:d="http://www.w3.org/2001/XMLSchema";
xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
xmlns:wn0="http://systinet.com/xsd/SchemaTypes/";
xmlns:wn1="http://systinet.com/wsdl/com/cexp/coe/bob/ws/customer/";
xmlns:wn2="http://systinet.com/soap-jta/";
xmlns:wn3="http://systinet.com/wsdl/com/cexp/coe/bob/services
/order/pojo/">
<e:Body>
  <wn1:getCustomerInfo>
    <wn1:userId i:type="d:string">akayali</wn1:userId>
  </wn1:getCustomerInfo>
</e:Body>
</e:Envelope>

As you can see, there is an implicit namespace reference
within the "i:type"
field, that is "string" has the namespace "d" associated
with it. The simple
XSLT body extraction does not capture any of the namespace
information, as
it is located within the Envelope declaration. The Saaj
components tries to
deal with this, and does a noble job, that results in this XML:

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";>
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
  <wn1:getCustomerInfo
xmlns:wn1="http://systinet.com/wsdl/com/cexp/coe/bob/ws/customer/";>.
    <wn1:userId xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
i:type="d:string">akayali</wn1:userId>.
  </wn1:getCustomerInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> As you can see, the Saaj component determines that the
namespace "i" must be
declared, but because "d" is implied only within the value
for the type
field, the Saaj component does not declare it (I assume that
it does not
introspect the value fields at all). Because "d" is not
present in the SOAP
request that is passed to the SOAP web service, the service throws an
exception while trying to deserialize/parse.

I thought that I could work around this, and utilize the
HttpSoapConnector
and HttpSoapInvoker components, but I fear that these will
suffer from the
same issues. Moreover, I don't think that the
HttpSoapInvoker is setting up
the Http header information correctly for a Soap service
invocation (there
is no SoapAction specified at all, and the content-type is
text/html),
resulting in a 400 response. Is this the expected behavior of
HttpSoapInvoker?

I am thinking about writing a custom XSL to extract the
namespaces from the
incoming message and place them in the first node of the
body, but I am not
sure if this is feasible with XSL (that is, can you access
the namespace in
XSL and treat it like any other attribute?).

Any help is welcome, including other components within
ServiceMix that might
work.

regards,
/jonathan








Reply via email to