Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^9: Soap::Lite and Complex Types with WSDL

by Anonymous Monk
on May 11, 2011 at 16:05 UTC ( #904195=note: print w/ replies, xml ) Need Help??


in reply to Re^8: Soap::Lite and Complex Types with WSDL
in thread Soap::Lite and Complex Types with WSDL

You can clearly see in my original code that I'm using a local WSDL file. Therefore I don't class it as a fix if it now doesn't allow me to use a local WSDL file. If you feel that is a fix then our opinions differ.

Um, the fix was to change

SOAP::Data->name("<ConnectContactId>" => 'CON12347')
to
SOAP::Data->name( "ConnectContactId" => 'CON12347' )
This has no effect on using a local WSDL file.

I don't understand why/how this is confusing.


Comment on Re^9: Soap::Lite and Complex Types with WSDL
Select or Download Code
Re^10: Soap::Lite and Complex Types with WSDL
by firstaspect (Initiate) on May 12, 2011 at 08:21 UTC
    Ah I see. Many apologies, I had misunderstood and thought you were saying your entire code response was the fix, as in completely changing my method. Apologies and thanks again for the response. It still doesn't appear to work but I believe it's to do with using the WSDL. I'm going to attempt to do it without and I think I'll get more success. Thank-you very much. Mark.
      Ah, ok. The entire code is rarely the fix around here, usually its a demonstration.

      And honestly I dislike SOAP strongly, and I barely understand WSDL :)

      There was a recent question, Re^4: checkVat - SOAP::Lite, and I had no clue what was supposed to happen, but it was simpler to use SOAP::Simple, and it turns out, SOAP::Simple is better with WSDL. The whole program boiled down to

      #!/usr/bin/perl -- use strict; use warnings; use LWP::Simple qw' mirror '; use SOAP::Simple; use Data::Dumper; my $wsdlUrl = 'http://ec.europa.eu/taxation_customs/vies/checkVatServi +ce.wsdl'; my $wsdlFile = 'checkVatService.wsdl'; mirror( $wsdlUrl, $wsdlFile ); my $soap = SOAP::Simple->new( $wsdlFile ); my ($answer, $trace) = $soap->checkVat( countryCode => "IE", vatNumber => "1234567890", ); print Dumper( $answer ),"\n"; $trace->printRequest; $trace->printResponse; __END__
      The output is
      $VAR1 = { 'parameters' => { 'requestDate' => '2011-05-13+02:00', 'vatNumber' => '1234567890', 'valid' => 0, 'countryCode' => 'IE' } }; Request: POST http://ec.europa.eu/taxation_customs/vies/services/checkVatServ +ice HTTP/1.1 User-Agent: libwww-perl/6.02 Content-Length: 347 Content-Type: text/xml; charset="utf-8" SOAPAction: "" X-LWP-Version: 6.02 X-XML-Compile-Cache-Version: 0.991 X-XML-Compile-SOAP-Version: 2.23 X-XML-Compile-Version: 1.21 X-XML-LibXML-Version: 1.70 <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/e +nvelope/"><SOAP-ENV:Body><tns1:checkVat xmlns:tns1="urn:ec.europa.eu: +taxud:vies:services:checkVat:types"><tns1:countryCode>IE</tns1:countr +yCode><tns1:vatNumber>1234567890</tns1:vatNumber></tns1:checkVat></SO +AP-ENV:Body></SOAP-ENV:Envelope> Response: HTTP/1.1 200 OK Connection: Keep-Alive Date: Fri, 13 May 2011 08:01:45 GMT Content-Type: text/xml; charset=utf-8 Client-Date: Fri, 13 May 2011 08:01:53 GMT Client-Peer: 147.67.119.103:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapen +v="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><urn:chec +kVatResponse xmlns:urn="urn:ec.europa.eu:taxud:vies:services:checkVat +:types"><urn:countryCode>IE</urn:countryCode><urn:vatNumber>123456789 +0</urn:vatNumber><urn:requestDate>2011-05-13+02:00</urn:requestDate>< +urn:valid>false</urn:valid></urn:checkVatResponse></soapenv:Body></so +apenv:Envelope>
      Looks simple indeed :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-12-25 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (163 votes), past polls