Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: SOAP Headers, WSDL and SOAP::Lite

by rob_au (Abbot)
on Mar 11, 2004 at 09:56 UTC ( #335755=note: print w/ replies, xml ) Need Help??


in reply to SOAP Headers, WSDL and SOAP::Lite

At this stage however, I am unsure whether this is an issue with my WSDL file or the limited WSDL 1.1 support offered by SOAP::Lite

Following some further reading of the WSDL specification (1.1, http://www.w3.org/TR/wsdl), it appears that additional SOAP headers should be able to be specified without these headers necessarily needing to be specified within the WSDL file - "It is not necessary to exhaustively list all headers that appear in the SOAP Envelope using soap:header. For example, extensions (see section 2.1.3) to WSDL may imply specific headers should be added to the actual payload and it is not required to list those headers here.".

To this end, I tested removing the <soap:header> definition from the private_method binding in the WSDL (in case the problem was being caused by an error in my WSDL definition) to no avail.

Anyone else got any other ideas short of diving into the source of SOAP::Lite?

 

perl -le "print unpack'N', pack'B32', '00000000000000000000001011001001'"


Comment on Re: SOAP Headers, WSDL and SOAP::Lite
Select or Download Code
Re: Re: SOAP Headers, WSDL and SOAP::Lite
by jpeyser (Initiate) on Mar 16, 2004 at 04:02 UTC
    This is actually not a bug. Rather it is an undeveloped feature. Apparently, Paul Kulchenko, author of SOAP::Lite, incorporated the foundation of many features that he simply did not have time to finish. In this case, two packages/subroutines need to be updated. SOAP::Schema::WSDL::parse SOAP::Schema::stub
      Here are the updated sections of code.

      SOAP::Schema::WSDL::parse

      foreach ($_->operation) { my $opername = $_->name; my $soapaction = $_->operation->soapAction; my $namespace = $_->input->body->namespace; my (@parts, @headers); foreach ($s->portType) { next unless $_->name eq $porttype; foreach ($_->operation) { next unless $_->name eq $opername; my $inputmessage = SOAP::Utils::disqualify($_->input->me +ssage); my $inputheader = $_->input->header ? SOAP::Utils::disqualify($_->input->header) : ''; foreach ($s->message) { if ($_->name eq $inputmessage) { @parts = $_->part; } elsif ($_->name eq $inputheader) { @headers = $_->part; } } } } $services{$opername} = {}; for ($services{$opername}) { $_->{endpoint} = $endpoint; $_->{soapaction} = $soapaction; $_->{uri} = $namespace; $_->{parameters} = [@parts]; $_->{header} = [@headers] if @headers; . } . }
      SOAP::Schema::stub
      join("\n", "package $package;\n", "# -- generated by SOAP::Lite (v$SOAP::Lite::VERSION) for Perl -- soaplite.com -- Copyright (C) 2000-2001 Paul Kulchenko --",<br> ($schema ? "# -- generated from $schema [@{[scalar localtime]}]\n" + : "\n"), 'my %methods = (', (map { my $service = $_; join("\n", " $_ => {", map(" $_ => '$services->{$service}{$_}',", qw/endpo +int soapaction uri/), " header => [", map(" SOAP::Header->new(name => '" . $_->name . "', type => '" . $_->type . "', attr => {" . do{ my %attr = %{$_->attr} +; join , ', map {"'$_' => '$attr{$_}'"} grep {/^xmlns:(?!-)/} keys %attr} . "}),", @{$services->{$service}{header}}), " ],", " parameters => [", map(" SOAP::Data->new(name => '" . $_->name . "', type => '" . $_->type . "', attr => {" . do{ my %attr = %{$_->attr} +; join ', ', map {"'$_' => '$attr{$_}'"} grep {/^xmlns:(?!-)/} keys %attr} . "}),", @{$services->{$service}{parameters}}), " ],\n },", ), } keys %$services), ");", <<'EOP'); . . . my @templates = (@{$method{header}}, @{$method{parameters}}); my $som = $self -> endpoint($method{endpoint}) -> uri($method{uri}) -> on_action(sub{qq!"$method{soapaction}"!}) -> call($method => map {@templates ? shift(@templates)->value($_ +) : $_} @_); UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall +: $som->result : $som;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://335755]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2014-12-19 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (74 votes), past polls