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

I'm trying to pass a username and a password in a soap transmission so that it looks like
<soap:Body> <GetInfo xmlns="http://server/"> <username>string</username> <password>string</password> </GetNursingHomeInfo> </soap:Body>
I can't figure out how I can format the transmission so that it matches the username and password xml fields. I'm making a good call, but don't know how to match what the server (.net implementation of soap) is expecting.
I've tried things like:
$service -> GetInfo('<username>aimsws</username><password>aimsWS!6 +0</password>'); And it gives me: <parameters><username>user</username><password>pass</password></parame +ters>
but it's not getting accepted by the server. Is there a way to make that that I'm just not seeing in the soap lite documentation?
Thanks!

Replies are listed 'Best First'.
Re: Soap Formatting
by ecuguru (Monk) on May 17, 2006 at 22:30 UTC
    I found some code for setting 'names' in the soap call, and tried:
    import SOAP::Data 'name' || print "\n!Couldn't import!\n"; eval { $service = SOAP::Lite ->name('username' => 'user') ->name('password' => 'pass') ->service('http://server/file.asmx?WSDL'); }; #|| ($_); # $@ will have the error message, perldoc -f eval
    But I get an error:
    Can't locate class method "name" via package "SOAP::Lite" at script.pl line 98

    This closer?
      Try co correct your code...
    • use "call"
    • ->name isnīt a method of SOAP::Lite ...

      --
      Marco Antonio
      Rio-PM