[Users] BC SOAP Inconsistency between http header and SOAP header

BibleBelt Holger.Wenzel at 3ds.com
Wed Mar 16 11:06:13 CET 2011


Hi,

as a proof of concept I'd like to call a SOAP WS through Petals. I can't change neither the client, nor the server code.

When I monitor the traffic, I see the following request from the client

Code:
POST /b2bHttpRouter/services/ModelAgent HTTP/1.1
Host: BibleBelt:9080
Accept: application/soap+xml,multipart/related,text/*
User-Agent: IBM WebServices/1.0
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: 
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
Content-Length: 1032
Date: Thu, 06 Jan 2011 08:04:45 GMT

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://www.w3.org/2005/08/addressing"><soapenv:Header soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://BibleBelt:9080/b2bHttpRouter/services/ModelAgent</wsa:To><wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://b2b.pse.system.engineous.com/ModelAgent/getModelsRequest</wsa:Action><wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:5A5B4063-012D-4000-E000-1D2AAC10DD83</wsa:MessageID></soapenv:Header><soapenv:Body soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><p849:getModels xmlns:p849="http://b2b.pse.system.engineous.com"><arg0>centos4see45</arg0><arg1>root</arg1><arg2>http://BibleBelt:9080</arg2></p849:getModels></soapenv:Body></soapenv:Envelope>



Of course the server is happy.

When I use Petals' BC-Soap component in Version 4.1, I do the provide external service/consume service exercise in PetalsStudio and see the WS provided by Petals. Telling the Client to use this interface leads to Petals throwing the following request at the server:


Code:
POST /b2bHttpRouter/services/ModelAgent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "getModels"
User-Agent: Axis2
Host: localhost:9080
Content-Length: 938

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://b2b.pse.system.engineous.com/ModelAgent/getModelsRequest</wsa:Action><wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:5A5B4063-012D-4000-E000-1D2AAC10DD83</wsa:MessageID><wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://BibleBelt:9080/b2bHttpRouter/services/ModelAgent</wsa:To></soapenv:Header><soapenv:Body><p849:getModels xmlns:p849="http://b2b.pse.system.engineous.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><arg0>centos4see45</arg0><arg1>root</arg1><arg2>http://BibleBelt:9080</arg2></p849:getModels></soapenv:Body></soapenv:Envelope>



The server is no longer happy, telling me it encountered an invalid Message Addressing Policy:


Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://www.w3.org/2005/08/addressing"><soapenv:Header><wsa:FaultDetail xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:ProblemHeaderQName>wsa:Action</wsa:ProblemHeaderQName></wsa:FaultDetail><wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</wsa:To><wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/fault</wsa:Action><wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:5C580B05-012D-4000-E000-1D2AAC10DD83</wsa:MessageID><wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:5A5B4063-012D-4000-E000-1D2AAC10DD83</wsa:RelatesTo></soapenv:Header><soapenv:Body><soapenv:Fault><faultcode>wsa:InvalidAddressingHeader</faultcode><faultstring>A header representing a Message Addressing Property is not valid and the message cannot be processed</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>



I think this is because the SOAPAction in the HTTP header (getModels) and the SOAP Header wsa:Action (http://b2b.pse.system.engineous.com/ModelAgent/getModelsRequest) are different.

When I replay the original request from Petals with some variations, I find several ways to comply to the server's addressing policy requirements:

1. Get rid of the SOAPAction in the HTTP header


Code:
POST /b2bHttpRouter/services/ModelAgent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: 
User-Agent: Axis2
Host: localhost:9080
Content-Length: 938

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://b2b.pse.system.engineous.com/ModelAgent/getModelsRequest</wsa:Action><wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:5A5B4063-012D-4000-E000-1D2AAC10DD83</wsa:MessageID><wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://BibleBelt:9080/b2bHttpRouter/services/ModelAgent</wsa:To></soapenv:Header><soapenv:Body><p849:getModels xmlns:p849="http://b2b.pse.system.engineous.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><arg0>centos4see45</arg0><arg1>root</arg1><arg2>http://BibleBelt:9080</arg2></p849:getModels></soapenv:Body></soapenv:Envelope>



2. Change the HTTP SOAPAction header to match the SOAP header


Code:
POST /b2bHttpRouter/services/ModelAgent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://b2b.pse.system.engineous.com/ModelAgent/getModelsRequest"
User-Agent: Axis2
Host: localhost:9080
Content-Length: 938

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://b2b.pse.system.engineous.com/ModelAgent/getModelsRequest</wsa:Action><wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:5A5B4063-012D-4000-E000-1D2AAC10DD83</wsa:MessageID><wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://BibleBelt:9080/b2bHttpRouter/services/ModelAgent</wsa:To></soapenv:Header><soapenv:Body><p849:getModels xmlns:p849="http://b2b.pse.system.engineous.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><arg0>centos4see45</arg0><arg1>root</arg1><arg2>http://BibleBelt:9080</arg2></p849:getModels></soapenv:Body></soapenv:Envelope>



3. Get rid of the SOAP headers alltogether:

Code:
 POST /b2bHttpRouter/services/ModelAgent HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "getModels"
User-Agent: Axis2
Host: localhost:9080
Content-Length: 543

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><p849:getModels xmlns:p849="http://b2b.pse.system.engineous.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><arg0>centos4see45</arg0><arg1>root</arg1><arg2>http://BibleBelt:9080</arg2></p849:getModels></soapenv:Body></soapenv:Envelope>



Is there a way to tell Petals to massage the outgoing traffic in a way that the server accepts the request? My favourite would be to go after the first workaround and scrap the HTTP SOAPAction header. W

Thanks a lot - and happy new year

Holger




-------------------- m2f --------------------

Subscribe/Unsubscribe emails notifications :
http://forum.petalslink.com/m2f_usercp.php

Response to this email will be posted on the Petals forum.
Please delete the existing text before responding :)

Read the topic online:
http://forum.petalslink.com/viewtopic.php?p=31683#31683

-------------------- m2f --------------------






More information about the Users mailing list