[Xml-compile] XML::Compile::SOAP::Daemon access to SOAP Header content

Mark Overmeer solutions at overmeer.net
Wed Sep 15 20:06:08 GMT 2010


* Lars Thegler (lars at thegler.dk) [100915 13:07]:
> On Wed, Sep 15, 2010 at 10:01 AM, Mark Overmeer <mark at overmeer.net> wrote:
> <SOAP-ENV:Header>
>   <s:AuthenticationInfo xmlns:s="urn:RTCBT" SOAP-ENV:mustUnderstand="1">
>     <s:username>nnn</s:username>
>     <s:password>ppp</s:password>
>   </s:AuthenticationInfo>
> </SOAP-ENV:Header>

Ah, after an hour debugging, I see what the problem is. The SOAP
message is built on parts of messages. A selection of parts are
put in the header and a some are put in the body.

When you call a SOAP method, then the logic will help you a little. When
the top-level does not contain such partname, it is considered to be
data for the first body element.

The handler is not that smart: it does "the full thing", so always
use the part name as key on the top level.  What you saw in the
handler was:
     'parameters' => { 'CBT_Request_ID' => 'aap' }
and you missed the login data from the header. The problem is that
the part name of the header is also "parameters" :(  When I rename
all three uses of "parameters" in the WSDL into different names,
the answer is:

           'parameters3' => { 'CBT_Request_ID' => 'aap' },
           'parameters1' => { 'password' => 'monkey',
                              'username' => 'markov'
                            }

There are some reasons (which I do not remember on the moment) to
use part-names here and not the element names... I may need to change
this behavior, which may be interface breaking.

Attached the client and server script I created.

   ./client.pl >/tmp/msg
   ./server.pl
   netcat </tmp/msg localhost 20203

-- 
Regards,
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: client.pl
Type: application/x-perl
Size: 962 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20100915/dcbe7579/client.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.pl
Type: application/x-perl
Size: 601 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20100915/dcbe7579/server.bin


More information about the Xml-compile mailing list