Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Client - Calling a SOAP Web Service

Status
Not open for further replies.

amdisuk

Programmer
Joined
Nov 23, 2006
Messages
2
Location
GB
Sorry if this is a daft question but I have the following:

Code:
  my $soap = SOAP::Lite
    -> uri("PMSWebService")
    -> proxy('[URL unfurl="true"]http://192.168.129.190/Service/WebService.asmx')[/URL]
    -> on_action(sub{sprintf '%s/%s', @_ })
    ;
    
  my $res = $soap->RequestKeycardEncoding();

This all works fine. I get a response back. It is 'deserialized' into a SOAP::SOM object.

The important thing to note here is that the response is also a SOAP document rather than just a string (as in all the examples I find on the Net).

What I want to do is export that SOAP result to a text file. I can access the values returned held in the SOM individually so I'm sure that the call to the service is correct. I just can't write the results to a flat SOAP XML file.

Hope you understand and can help. I am very new to Perl.

Allan
 
Try adding
Code:
my $soap = SOAP::Lite
    -> uri("PMSWebService")
    -> proxy('[URL unfurl="true"]http://192.168.129.190/Service/WebService.asmx')[/URL]
    -> on_action(sub{sprintf '%s/%s', @_ })
    [red]-> outputxml(1)[/red]
    ;
According to the doc on CPAN, this should cause all mthods to return raw XML.


Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::PerlDesignPatterns)[/small]
 
Hi Steve,

That works fantastically. Thanks very much for your help.

Allan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top