[Xml-compile] Re: problems with sending SOAP headers

Karen Etheridge perl at froods.org
Wed Sep 12 20:39:09 GMT 2012


Follow-up... I've done a data dump of $wsdl->operation($operation_name)
and I see both key_for_header and key_for_body in the input_def field --
however, key_for_header is in an arrayref. This suggests that the WSDL is
*not* incomplete, but I am just passing the arguments wrong - but what is
the correct way?

that is, the operation object contains:

bless( {
    'input_def' => {
          'body' => {
              'use' => 'literal',
              'parts' => [
                           {
                             'name' => 'key_for_body_Request',
                             'element' => '{namespace}key_for_body'
                           }
                         ],
              'name' => 'key_for_body_Request',
              'procedure' => 'key_for_body_Request',
              'message' => ...,
            },
  'header' => [
                {
                  'use' => 'literal',
                  'parts' => [
                               {
                                 'name' => 'head',
                                 'element' => '{namespace}key_for_header'
                               }
                             ],
                  'part' => 'head',
                  'message' => ...,
              ]
        },
    ...


On Wed, Sep 12, 2012 at 11:38:16AM -0700, Karen Etheridge wrote:
> 
> I'm having difficulty in using XML::Compile::WSDL11 to send a message with
> a <soapenv:Header> element.  When I pass my arguments (body and header
> elements) to the compiled subref with trace mode on, I see "warning: unused
> values <header element>".
> 
> Am I right in concluding that (barring any bugs in XML::Compile itself),
> this means that the WSDL is not properly written to indicate the presence
> of this header element for this operation (I don't speak enough WSDL to know if
> this is the case, but I'm reading through the W3C docs to make this
> determination)?  
> 
> I'm doing this, roughly:
> 
>     use XML::Compile::WSDL11;
>     use XML::Compile::SOAP11;
>     use XML::Compile::Transport::SOAPHTTP;
> 
>     my $wsdl = XML::Compile::WSDL11->new($wsdlfile);
>     $wsdl->importDefinitions($_) foreach @xsd_files;
> 
>     my $call = $wsdl->compileClient($operation);
>     my ($answer, $trace) = $call->(
>         {
>             key_for_header => { ... },
>             key_for_body => { ... },
>         },
>         'UTF-8',
>     );
> 
> I've also tried passing args
>     {
>         Header => { key_for_header => { ... } },
>         Body => { key_for_body => { ... } },
>     }
> 
> ..with the same results.
> 
> Is there anything else I can do other than fix the WSDL to insert these
> elements in the request?  I cannot find anything in the documentation about
> manually inserting extra arguments that the WSDL does not recognize.
> 

-- 
          "Industries are occasionally made obsolete by technological
            advances.  Carrier pigeons, for example, are largely on
           the dole these days." - Gene Kan, co-founder of Gnutella
            .             .            .            .             .
Karen Etheridge, karen at etheridge.ca       GCS C+++$ USL+++$ P+++$ w--- M++



More information about the Xml-compile mailing list