scabarrus has asked for the wisdom of the Perl Monks concerning the following question:

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.