Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
error
Element '<ConnectContactId>' can't be allowed in valid XML message. Died. at C:/perl/site/5.12.2/lib/SOAP/Lite.pm line 1412.
a tidy request
$ perl soap.lite.904155.pl POST http://localhost/blah/DummyService HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap User-Agent: SOAP::Lite/Perl/0.712 Content-Length: 700 Content-Type: text/xml; charset=utf-8 SOAPAction: "#ContactInsertOrUpdate" <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/enc +oding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http:/ +/www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSche +ma-instance"> <soap:Body> <ContactInsertOrUpdate> <ListOfArmAccountContactInterface> <ARMAccount> <ContactCompanyId xsi:type="xsd:int">1029843</ContactCompany +Id> <ListOfArmContact> <ARMContact> <ConnectContactId xsi:type="xsd:string">CON12347</Connec +tContactId> </ARMContact> </ListOfArmContact> </ARMAccount> </ListOfArmAccountContactInterface> </ContactInsertOrUpdate> </soap:Body> </soap:Envelope>
code
#!/usr/bin/perl -- use SOAP::Lite; my $soap = SOAP::Lite ->proxy( 'http://localhost/blah/DummyService', timeout => 0.00001, ); $soap->transport->add_handler("request_send", \&pp_dump ); $soap->transport->add_handler("response_done", \&pp_dump ); my $param = SOAP::Data->name( "ListOfArmAccountContactInterface" => \SOAP::Data->value( SOAP::Data->name( "ARMAccount" => \SOAP::Data->value( SOAP::Data->name( "ContactCompanyId" => '1029843' ), SOAP::Data->name( "ListOfArmContact" => \SOAP::Data->value( SOAP::Data->name( "ARMContact" => \SOAP::Data->value( #~ SOAP::Data->name("<ConnectContactId>" => 'CON12347' +) SOAP::Data->name( "ConnectContactId" => 'CON12347' ) ) ) ) ) ) ) ) ); #~ print pp( #~ $soap->serializer()->envelope( #~ method => 'ContactInsertOrUpdate', #~ $param #~ ), #~ ), "\n\n"; $soap->call( 'ContactInsertOrUpdate', $param ); sub pp { use XML::Twig; open my($fh), '>', \my $str; no warnings 'newline'; XML::Twig->new(qw! pretty_print record !)->xparse(@_)->print( $fh +); return $str; } sub pp_dump { my $content = $_[0]->content(''); $_[0]->content( pp($content) ); print $_[0]->as_string,"\n"; return; } __END__

In reply to Re: Soap::Lite and Complex Types with WSDL by Anonymous Monk
in thread Soap::Lite and Complex Types with WSDL by firstaspect

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-16 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found