in reply to help with setting cookie with SOAP::WSDL

Hi winfinit

SOAP APIs usually require the authentication parameters on the SOAP envelope itself.
Have you tried setting up the session information on the SOAP envelope's headers?

Look into the WSDL contract in the bindings section and check if the 'operation' you are calling requires as input an headers message.
You will need to get the header names from the wsdl contract or API documentation if available.

On SOAP::WSDL's documentation there is information on how to set up the headers:
#first define your headers @header = (SOAP::Header->name("FirstHeader")->value("FirstValue"), SOAP::Header->name("SecontHeader")->value("SecondValue")); #and then do the call. please note the backslash my $som=$soap->call( 'method' , name => 'value' , name => 'value' , "soap_headers" => \@header);

Replies are listed 'Best First'.
Re^2: help with setting cookie with SOAP::WSDL
by winfinit (Novice) on Dec 19, 2007 at 22:21 UTC
    i did try to specify techname and password operation inside soap call header
    but that didnt help, i am still getting err message saying that my SOAP call
    is not authorized, and also when i do just regular call, to authenticate
    i dont see any kind of cookie being returned... maybe i am lookng at the wrong place?
    SOAP::Transport::new: () SOAP::Serializer::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Lite::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Schema::new: () SOAP::Transport::HTTP::Client::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Lite::call: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: SOAP::Data=HASH(0xa1e032c) SOAP::Data=HASH +(0xa1e9e48) SOAP::Data=HASH(0xa1eef24) SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0xa1c2 +5e0) SOAP::Transport::HTTP::Client::send_receive: POST https://api.com/API/ +API.dll?Handler=Default HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 573 Content-Type: text/xml; charset=utf-8 SOAPAction: "https://api.com/API/#SessionLoginTechnician" <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:/ +/www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xm +lsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema +" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmln +s:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Sessio +nLoginTechnician xmlns="https://api.com/API/"><TechName xsi:type="xsd +:string">user</TechName><Password xsi:type="xsd:string">password</Pas +sword></SessionLoginTechnician></soap:Body></soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0xa2a +0b1c) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Date: Wed, 19 Dec 2007 20:50:01 GMT Server: Microsoft-IIS/6.0 Content-Length: 469 Content-Type: text/xml Client-Date: Wed, 19 Dec 2007 20:50:01 GMT Client-Peer: 216.229.150.65:443 Client-Response-Num: 1 Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU +=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS I +ncorp.by Ref. LIABILITY LTD.(c)97 VeriSign Client-SSL-Cert-Subject: /C=US/ST=Massachusetts/L=Framingham/O=Iron Mo +untain, Inc./OU=Icompany name here/OU=Terms of use at www.verisign.co +m/rpa (c)00/CN=blah.com Client-SSL-Cipher: RC4-MD5 Client-SSL-Warning: Peer certificate not verified Set-Cookie: SESSIONID=8kEALmmE+SwBiamHFzGL8xpYyjkW7y3Sl8XOdxXZD/bc34nL +NfeRtVDsyRCP/QqmQq1M; path=/;version=1 X-Powered-By: ASP.NET <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http +://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.o +rg/soap/encoding/"><soap:Body soap:encodingStyle="http://schemas.xmls +oap.org/soap/encoding/"><snp:SessionLoginTechnician xmlns:snp="https: +//api.com/API/7.5/"><CommunityID>6040</CommunityID></snp:SessionLogin +Technician></soap:Body></soap:Envelope> SOAP::Deserializer::deserialize: () SOAP::Parser::decode: () SOAP::SOM::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Lite::call: ()