Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

SOAP::Lite question

by fritz1968 (Sexton)
on Aug 07, 2012 at 14:28 UTC ( #986007=perlquestion: print w/ replies, xml ) Need Help??
fritz1968 has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am trying to connect to a WSDL, but I am having problems. Here is my code:
use SOAP::Lite +trace; use strict; my $client = SOAP::Lite ->readable(1) ->uri('') ->proxy(''); my $temp_elements = SOAP::Data ->name("CallDetails" => \SOAP::Data->value( SOAP::Data->name("first" => '8'), SOAP::Data->name("max" => '1'), SOAP::Data->name("provider" => 'homeFolderWin'), SOAP::Data->name("action" => 'bestMatch'), SOAP::Data->name("state" => 'PLACED')) ); my $response = $client->fetchAndLock($temp_elements);
----- Just some simple code to fetch one record. However, this is what the traces lists when I run the above program:
SOAPAction: " +" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi=" +e" xmlns:SOAP-ENC="" xmlns:S +OAP-ENV="" xmlns:xsd="http:/ +/" SOAP-ENV:encodingStyle="http://schemas.xm"> <SOAP-ENV:Body> <namesp1:fetchAndLock xmlns:namesp1=" +tService/3?wsdl"> <CallDetails> <first xsi:type="xsd:int">8</first> <max xsi:type="xsd:int">1</max> <provider xsi:type="xsd:string">homeFolderWin</provider> <action xsi:type="xsd:string">bestMatch</action> <state xsi:type="xsd:string">PLACED</state> </CallDetails></namesp1:fetchAndLock></SOAP-ENV:Body> </SOAP-ENV:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x3a3 +9974) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Ser +ver Error
---------------- However, using SoapUI with the following code works:
<soapenv:Envelope xmlns:soapenv=" +ope/" xmlns:ns=""> <soapenv:Header/> <soapenv:Body> <ns:fetchAndLock> <ns:first>8</ns:first> <ns:max>1</ns:max> <ns:provider>homeFolderWin</ns:provider> <ns:action>bestMatch</ns:action> <ns:state>PLACED</ns:state> </ns:fetchAndLock> </soapenv:Body> </soapenv:Envelope>

What am I doing wrong? Any help would be greatly appreciated! Another question that I have is once I do get this working, how will I read the return code?

Comment on SOAP::Lite question
Select or Download Code
Replies are listed 'Best First'.
Re: SOAP::Lite question
by Anonymous Monk on Aug 08, 2012 at 02:33 UTC

    you should use , its one of the official example hostnames :)

    Also, you shouldn't use SOAP::Lite, seriously :) use SOAP::Simple or its daddy XML::Compile...

    And now a tip, ddg:// soapenv SOAP::Lite -> SOAP::Lite and SOAP-ENV,

    local $SOAP::Constants::PREFIX_ENV = "soapenv"; local $SOAP::Constants::PREFIX_ENC = "soapenc";

    If that works, great -- probably the proper thing would be to set an appropriate  $client->encoding($soap_12_encoding_URN);

    Good luck, I hate soap :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://986007]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-10-09 05:22 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (233 votes), past polls