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

Some problem with the conversion of a number in to string while using webservices.The perl program sends the number to the java webservices ,(the exposed function accepts the string),But some bad type errors are occuring in the Java program .

the program is

#!/usr/bin/perl use SOAP::Lite; $var1=1234; $var2=3456; my $accno = "$var1"; my $pinno = "$var2"; my $ret= SOAP::Lite ->proxy('http://192.168.0.107:8080/ws4ee/services/BankingService?wsdl' +) ->loginUser($accno,$pinno) ->result;

Can anyone have some solutions???

Edit g0n - added code & p tags

Replies are listed 'Best First'.
Re: String Conversion Error in Webservices
by jhourcle (Prior) on Jul 12, 2005 at 11:35 UTC
    SOAP::Lite will send things that look like numbers as numbers, even if you want them to be sent as strings. If you want them sent as some other datatype, you'll need to use SOAP::Data:
    !/usr/bin/perl -- use SOAP::Lite; my $var1=1234; my $var2=3456; my $accno = SOAP::Data->type( string => $var1 ); my $pinno = SOAP::Data->type( string => $var2 ); my $ret= SOAP::Lite ->proxy('http://192.168.0.107:8080/ws4ee/services/BankingService?wsd +l') ->loginUser($accno,$pinno) ->result;

    If this isn't what the problem was (it was a little unclear from your description, but I know this is a common problem with SOAP::Lite), please explain what you expected, and what you actually received (including error messages, etc.)

Re: String Conversion Error in Webservices
by gellyfish (Monsignor) on Jul 12, 2005 at 11:27 UTC

    Can use change your use SOAP::Lite in the client to use SOAP::Lite +trace => 'all'; and send us the output (remembering please to put the <code> tags around it).

    /J\