Hi everybody,

I'm new in this forum and new user of perl language. I must interact with a webservice which is develop in Java, but i must create a client in Perl. I have some question about one problem i met. I try to call two method in the same script. I have written this code

#! /usr/bin/perl use strict; use warnings; use SOAP::Lite +trace => [ transport => sub { print $_[0]->as_string } ]; my $soap= SOAP::Lite -> uri("http://hsc.project.com/services") ->proxy("http://192.168.60.1:8080/HSC-Authnz-1.0mock/authn +z?wsdl") ; print "\n===============================================\n"; print "\n\n resultat : ", $soap + -> encryptToken("toto") + -> result; print "\n===============================================\n"; print "\n\n resultat : ", $soap ->decryptToken("toto") -> result; print "\n===============================================\n";

For the first request i have the good result but for the second method decryptToken i have an error about a prefix of SOAP response. I post all trace about execution of my script :

POST http://192.168.60.1:8080/HSC-Authnz-1.0mock/authnz?wsdl HTTP/1.1 Accept: text/xml Accept: multipart/* Content-Length: 533 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://hsc.project.com/services#encryptToken" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xm +lsoap.org/soap/encoding/"> <SOAP-ENV:Body> <namesp1:encryptToken xmlns:namesp1="http://hsc.project.com/services"> <c-gensym3 xsi:type="xsd:string"> toto </c-gensym3> </namesp1:encryptToken> </SOAP-ENV:Body> </SOAP-ENV:Envelope> HTTP/1.1 200 OK Connection: close Date: Tue, 04 Feb 2014 09:31:09 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Mon, 03 Feb 2014 23:41:12 GMT Client-Peer: 192.168.60.1:8080 Client-Response-Num: 1 Client-Transfer-Encoding: chunked <?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:encryptTokenResponse xmlns:ns2="http://hsc.project.com/services"> <return> 06abCfRTNhjytthjsfdudfzkj7856sdhgghsjkjk99jhsjdhnbnsdbvsnbd99nsdnsdsnd +bns== </return> </ns2:encryptTokenResponse> </S:Body> </S:Envelope> resultat : 06abCfRTNhjytthjsfdudfzkj7856sdhgghsjkjk99jhsjdhnbnsdbvsnb +d99nsdnsdsndbns== =============================================== POST http://192.168.60.1:8080/HSC-Authnz-1.0mock/authnz?wsdl HTTP/1.1 Accept: text/xml Accept: multipart/* Content-Length: 533 Content-Type: text/xml; charset=utf-8 SOAPAction: "http://hsc.project.com/services#decryptToken" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:S +OAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http:/ +/www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xm +lsoap.org/soap/encoding/"> <SOAP-ENV:Body> <namesp2:decryptToken xmlns:namesp2="http://hsc.project.com/services"> <c-gensym6 xsi:type="xsd:string"> toto </c-gensym6> </namesp2:decryptToken> </SOAP-ENV:Body> </SOAP-ENV:Envelope> HTTP/1.1 200 OK Connection: close Date: Tue, 04 Feb 2014 09:31:09 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Mon, 03 Feb 2014 23:41:12 GMT Client-Peer: 192.168.60.1:8080 Client-Response-Num: 1 Client-Transfer-Encoding: chunked <?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:decryptTokenResponse xmlns:ns2="http://hsc.project.com/services"> <return> {10203040-0001-0001-0001-000000000020};user20;AFR;1391509869590;139150 +6269590; </return> </ns2:decryptTokenResponse> </S:Body> </S:Envelope> Unresolved prefix 'S' for attribute 'S:Envelope' <?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:decryptTokenResponse xmlns:ns2="http://hsc.project.com/services"> <return> {10203040-0001-0001-0001-000000000020};user20;AFR;1391509869590;139150 +6269590; </return> </ns2:decryptTokenResponse> < </S:Body> </S:Envelope>

As you can see the format of the response is the same but i have an error to interpret a prefix which is the same in first request.
Could you help me, please?
Thanks in advance.


In reply to [ SOAP ] Error when i do two request by scabarrus

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.