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
