Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

SOAP::Lite - Problem with non-string parameters

by loris (Hermit)
on Jun 23, 2009 at 14:38 UTC ( #774039=perlquestion: print w/ replies, xml ) Need Help??
loris has asked for the wisdom of the Perl Monks concerning the following question:

Dear All,

I probably know too little about SOAP in general to be doing this sort of thing, but perhaps the kind-hearted will bear with me.

I have generated a module from a WSDL which contains this:

my %methods = ( ... findGroups => { endpoint => 'https://xxx.xxx.xxx.xxx:xxxx/grouper-ws/services/Grou +perService.GrouperServiceHttpSoap12Endpoint/', soapaction => 'urn:findGroups', namespace => 'http://soap.ws.grouper.middleware.internet2.edu/xsd' +, parameters => [ SOAP::Data->new(name => 'clientVersion', type => 'xs:string', at +tr => {}), SOAP::Data->new(name => 'wsQueryFilter', type => 'ns:WsQueryFilt +er', attr => {}), SOAP::Data->new(name => 'actAsSubjectLookup', type => 'ns:WsSubj +ectLookup', attr => {}), SOAP::Data->new(name => 'includeGroupDetail', type => 'xs:string +', attr => {}), SOAP::Data->new(name => 'params', type => 'ns:WsParam', attr => +{}), ], # end parameters }, # end findGroups ); # end my %methods

I call the method like this:

my $xml = "<ns:wsQueryFilter><ns:groupName>$params{groupname}</ns:gr +oupName><ns:queryFilterType>$params{queryfiltertype}</ns:queryFilterT +ype></ns:wsQueryFilter>"; my $elem = SOAP::Data->type('xml' => $xml); my $result= $grouper->findGroups($params{clientversion}, $elem, '', 'T' );

However, the SOAP body generated looks like this:

<soap:Body> <ns:findGroups> <clientVersion xsi:type="xs:string">v1_4_001</clientVersion> <wsQueryFilter xsi:nil="true" xsi:type="ns:WsQueryFilter" /> <actAsSubjectLookup xsi:nil="true" xsi:type="ns:WsSubjectLookup" + /> <includeGroupDetail xsi:type="xs:string">T</includeGroupDetail> </ns:findGroups> </soap:Body>

The wsQueryFilter-tag is always empty - I also get the same result if I replace $elem with '' (or pretty much anything else).

Other methods which take only string aguments work fine. Can anyone see how I should pass the non-string arguments?

Thanks,

loris

Comment on SOAP::Lite - Problem with non-string parameters
Select or Download Code
Re: SOAP::Lite - Problem with non-string parameters
by Anonymous Monk on Jun 24, 2009 at 11:42 UTC

      Dear A.M.,

      I am still trying to understand what is going on here.

      Do I have to use SOAP::Data::ComplexType? As I understand, the problem is that the types ns:WsQueryFilter and ns:WsSubjectLookup are not known. I would have thought that I could "just" define the unknown types. I have tried doing something like

      parameters => [ SOAP::Data->new(name => 'clientVersion', type => 'xs:string', at +tr => {}), SOAP::Data->new(name => 'wsQueryFilter', type => \SOAP::Data->value( SOAP::Data->name(name => 'gro +upAttributeName', type =>'xs:string'), ... ) , attr => {} ), SOAP::Data->new(name => 'actAsSubjectLookup', type => 'ns:WsSubj +ectLookup', attr => {}), SOAP::Data->new(name => 'includeGroupDetail', type => 'xs:string +', attr => {}), SOAP::Data->new(name => 'params', type => 'ns:WsParam', attr => +{}), ], # end parameters

      but this gives me the error

      Schema/namespace for type 'REF(0x2728f88)' is not specified

      Should I be defining the type somewhere else? If so, how? As I mentioned, my lack of SOAP knowledge is probably making this harder for me than it should be.

      Thanks,

      loris

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-08-01 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (0 votes), past polls