[Xml-compile] Enforcing encodingStyle attribute?

Heiko Jansen jansen at hbz-nrw.de
Tue Feb 16 16:33:52 GMT 2016


Dear all,

we have to communicate with a SOAP server which seems a bit picky about the 
messages it´s willing to process.
For some reason, the commands to create and destroy a session are using the 
document/literal encoding style while the other commands have to be send as 
rpc-encoded messages.

Session creation and destruction work fine.
We´ve already found out that we have to add "use 
XML::Compile::SOAP11::Encoding;" and that we have to create a different 
XML::Compile::WSDL11 object to feed the WSDL files for the other commands 
to.

Now we´re able to send other commands to the server using that second 
object, but the server only returns a fault: 

JAXRPCTIE01: Ausnahmefehler beim Bearbeiten der Anforderung: Unerwarteter 
Kodierungsstil: erwartet=http://schemas.xmlsoap.org/soap/encoding/, tats
\xC3\xA4chlich=

which roughly translates to

"Exception: unexpected encoding style: expected=http://schemas.xmlsoap.org/
soap/encoding/, got="

The request message indeed doesn´t contain an "encodingStyle" attribute 
anywhere.

The WSDL declares the usage of the encoding style:

-- snip --
<binding name="XYZShowDataInterfaceBinding" type="tns:XYZShowDataInterface">
  <soap:binding
    transport="http://schemas.xmlsoap.org/soap/http"
    style="rpc"/>
  <operation name="executeXYZShowData">
    <soap:operation soapAction=""/>
    <input>
      <soap:body
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        use="encoded"
        namespace="urn:xyz"/>
    </input>
-- / snip --

The "Envelope" element that´s currently generated looks like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/">

If I manually change that to

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/
encoding/">

and re-submit the modified message using lwp-request the server accepts the 
request.

Until now I´ve been unable to find out how I´m supposed to enforce the 
presence of the missing attribute.

Any suggestions?

-- 
Heiko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jansen.vcf
Type: text/vcard
Size: 490 bytes
Desc: not available
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20160216/8c8b6467/attachment.bin>


More information about the Xml-compile mailing list