[Xml-compile] XML::Compile::WSDL11 async - HTTP headers modification

Roman Daniel roman.daniel at davosro.cz
Fri Nov 14 18:19:46 GMT 2014


But what if I need to supply HTTP header not the header inside the XML message?

Regarding transport_hook I can see it only in
XML::Compile::Transport::SOAPHTTP not in
XML::Compile::Transport::SOAPHTTP_AnyEvent

[vagrant at localhost latest-build]$ grep -r hook
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm
XML-Compile-SOAP-AnyEvent-0.01/lib/
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm:    my
$hook = $args->{hook};
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm:    $hook
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm:    ? sub
# hooked code
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm:
$trace->{hooked}        = 1;
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm:        my
$response = $hook->($request, $trace, $self)
XML-Compile-SOAP-3.05/lib/XML/Compile/Transport/SOAPHTTP.pm:
 or error __x"transport_hook must produce a HTTP::Response, got
{resp}"




2014-11-14 9:45 GMT+01:00 Mark Overmeer <mark at overmeer.net>:
> * Roman Daniel (roman.daniel at davosro.cz) [141113 19:02]:
>> I use XML::Compile::WSDL11 with an asynchronous transport. I need to
>> pass some HTTP headers with the calls. I don't mean "static" headers
>> like basic auth but headers which can change from call to call. For
>> example message-id (known before SOAP call) to identify my request at
>> the server side.
>
> When you need to add fields to the header inside your XML message,
> which are not specified in the WSDL and which are not standard WSA,
> you can best write an extension.  See XML::Compile::SOAP::WSA how
> that is done.
>
>> $transport->($req, $trace, $mtom
>>           , sub { $callback->($output_handler->(@_)) }
>>           );
>
> Have you seen the transport_hook parameter?  Can be passed with
> the call compilation.  Used a lot in the regression tests.
> --
> Success,
>
>                MarkOv
>
> ------------------------------------------------------------------------
>        Mark Overmeer MSc                                MARKOV Solutions
>        Mark at Overmeer.net                          solutions at overmeer.net
> http://Mark.Overmeer.net                   http://solutions.overmeer.net
>



More information about the Xml-compile mailing list