Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Debugging Cookies

by Anonymous Monk
on Aug 08, 2009 at 04:00 UTC ( #786984=note: print w/replies, xml ) Need Help??

in reply to Debugging Cookies

use SOAP::Lite +trace => 'debug';

Replies are listed 'Best First'.
Re^2: Debugging Cookies
by srleapline (Initiate) on Aug 10, 2009 at 15:58 UTC

    I've tried the SOAP::Lite +trace and it does give some info but I'm looking for more on WHY my response does not include the cookie that was provided. This is a snippet of the session. Notice that the response does NOT include the cookie. Can I adjust the debug/trace level to show more debugging info? The DOC doesn't indicate that I can. I also included the small script that I'm using to test. (This is a Windows box.)

    use SOAP::Lite +trace=>"debug"; # troubleshoot: append: +tr +ace=>"debug"; import SOAP::Data 'name'; # to set data values (q.v.) use HTTP::Cookies; # server uses client cookie for auth use Data::Dumper; # Command-line parameters: <NS IP> <username> <password> my $NS = shift @ARGV; $NS = "localhost" if (!$NS); my $username = shift @ARGV; $username = "xxxxx" if (!$username); my $password = shift @ARGV; $password = "xxxxx" if (!$password); # Cookie object. Server sends cookie for client authentication. my $cookies = HTTP::Cookies->new(ignore_discard => 1, hide_cookie2 => +1); # Create the soap object my $soap = SOAP::Lite # service URI and cookie object -> proxy("http://$NS/soap", cookie_jar=>$cookies) ; # Log on print "login: "; my $result = $soap->login( name('username'=>$username), name('password'=>$password) ) ->result; print $result->{'message'} . "\n"; # Logout print "logout: "; $result = $soap->logout()->result; print $result->{'message'} . "\n";
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:/ +/www.w3.or g/2001/XMLSchema-instance" xmlns:soapenc=" +oap/encodi ng/" xmlns:xsd="" soap:encodingStyle=" +http://sch" xmlns:soap="http://schemas.xmlsoap.or +g/soap/env elope/"><soap:Body><login><username xsi:type="xsd:string">xxxxx</usern +ame><pass word xsi:type="xsd:string">xxxxx</password></login></soap:Body></soap: +Envelope > SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Mon, 10 Aug 2009 15:38:43 GMT Server: Apache Content-Length: 622 Content-Type: text/xml; charset=utf-8 Last-Modified: Mon, 10 Aug 2009 15:38:43 GMT Client-Date: Mon, 10 Aug 2009 15:38:43 GMT Client-Peer: Client-Response-Num: 1 Set-Cookie: NSAPI=##93D4423CAB0A68B94B6FB6D51F05CF963883EFEC3C958CF6F6 +DEFA71A008 ;Domain=pns-pfsc-l93a;Path=/soap Status: 200 OK <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-EN +V="http://" xmlns:SOAP-ENC="http://schemas.xml oap/encoding/" xmlns:xsi="" x +mlns:xsd="" xmlns:ns="urn:NSConfig"><SOAP-ENV:He +ader></SOA P-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xml oap/encoding/" id="_0"><ns:loginResponse><return xsi:type="ns:simpleRe +sult"><rc xsi:type="xsd:unsignedInt">0</rc><message xsi:type="xsd:string">Done</ +message></ return></ns:loginResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> login: Done SOAP::Transport::HTTP::Client::send_receive: POST http://pns-pfsc-l93a +/soap HTTP /1.1 Accept: text/xml Accept: multipart/* Accept: application/soap User-Agent: SOAP::Lite/Perl/0.65_3 Content-Length: 392 Content-Type: text/xml; charset=utf-8; charset=utf-8 SOAPAction: "#logout"
      WHY my response does not include the cookie that was provided. This is a snippet of the session. Notice that the response does NOT include the cookie.

      Isn't Set-Cookie: NSAPI=##93D4423CAB0A68B94B6FB6D51F05CF963883EFEC3C958CF6F6DEFA71A008;Domain=pns-pfsc-l93a;Path=/soap
      the cookie?

      Maybe you can include a small server test script to go along with your client.

        The "Set-Cookie" is coming from the server. My client isn't sending it back on the next request.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://786984]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2018-02-23 20:56 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (310 votes). Check out past polls.