On Aug 30, 2:53*pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> droesler wrote:
> > Is there a way to suppress the surrounding methodName element of the
> > soap:Body section of the SOAP envelope?
>
> No idea what that means. Soap:Envelope and Soap:Body should be
> the first two elements in the request, the method should be within
> the Soap:Body element.
For simplification and ignoring namespaces for now... if the payload
gets serialized to
<el1>
<el2>some value</el2>
</el1>
and the method is myMethod then Soap:Body will be
<myMethod>
<el1>
<el2>some value</el2>
</el1>
</myMethod>
>How is the Web service supposed to know what
> method to run, if it's not sent in the request?
From what I can determine it is based on the soapAction header value.
But this may be dependent on whether it is a rpc/literal or doc/
literal WS.
Also, from what I can determine is that doc/literal is not necessarily
expecting the <myMethod><payload/></myMethod> construct in Soap:Body,
but I could certainly be way off on this understanding.
> Maybe the Web Service is poorly designed?
Could be, but it's from a major software company - but could still be
poorly designed.
> At least show some of the XML in question.
> Show what's expected by the service and what's being sent by
> your client.
Their supplied .wsdl says it is expecting
<topLevelTag> <!-- this is not the method name -->
<Wrapper>
<el1>
<el2>some value</el2>
</el1>
</Wrapper>
</topLevelTag>
> If the service is in .NET, you have to do more work in Soap::Lite.
It is and I used the recommended on_action method.
> Look around the Internet for steps to take.
I did that as well. From what I can tell this seems to be a rpc/
[encoded|literal] vs. doc/literal issue.
Which from what I find on the Internet is something that SOAP::Lite
doesn't deal with well.
> Also, to help you debug things, you can see what's sent/received, by enabling trace:
>
> use SOAP::Lite +trace;
Done this as well. The vendor's WS responds with <methodName> is an
unknown part of the Soap:Body
>
> If all else fails, you might be able to take the expected XML
> request, modify it to suit your needs, and POST it.
Interestingly enough if I construct a SOAP client and call it as shown
below this satisfies their .wsdl and works.
As you can see there is no mention of the method except in the
on_action method.
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite (+trace => all, maptype => {});
my $query = qq{<ns:el1> <ns:el2>some value</ns:el2> </ns:el1>};
my $server = q{http://server.example.com};
my $pathInfo = q{?really/long/pathInfo/for/ws};
my $url = qq{$server$pathInfo};
my $svc = SOAP::Lite
-> uri("http://example.com/ns/")
-> on_action( sub{ return q{"document/http://example.com/
ns/:MethodName"} } )
-> proxy($url)
-> autotype(0)
-> readable(1)
-> ns('http://example.com/ns/', 'ns');
my $arg1 = SOAP:

ata->name('WrapperTagForQuery' => $query)-
>prefix('ns');
my $method = SOAP:

ata->name('SpoofMethodName')->prefix('ns');
my $som = $svc->call($method => $arg1);
This will generate a Soap:Body section like
<ns:SpoofMethodName>
<ns:WrapperTagForQuery>
<ns:el1>
<ns:el2>some value</ns:el2>
</ns:el1>
</ns:WrapperTagForQuery>
</ns:SpoofMethodName>