Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Dear Monks, I am accessing a .NET based web service using PERL's SOAP::Lite module. Though the code is working fine for me during one of perforamnce tests by the service provider the guy from other end told me that he is receiving requests from my server twice the first one being sent as a null request and the other one which i actually want to send. I get the response correctly and my trace log also shows request being sent and response received as it should be, This service requires a HTTP authorisation which i do as directed in module, after much discussion with the service provider he told me that it might be happening because of my application sending first null request to authenticate which results in exception on their end and he also told that the clients written in .NET need to set a directive to TRUE in order to stop this kind of behaviour but unfortunately i dont know .NET and he is not aware of PERL.

I am writing this after searching on google and perlmonks about http basic authentication used in SOAP Lite but could manage to find questions about them not working correctly and not about the behaviour also tried to read code from LWP::Useragent to find out how it works but did not understand much of it. I request you to please tell me if this is because of authentication and how authentication works.

This is my code #$PARAM has all the parameters needed to make client use SOAP::Lite +trace =>'debug'; my $xmlRequest = '<Request>'.(shift).'</Request>'; my $xmlFilter = '<Filter>'.(shift).'</Filter>'; my $webService = SOAP::Lite-> uri($PARAM->{NAMESPACE}) -> on_action(sub{sprintf '%s/%s', @_ }) -> outputxml("1") -> proxy($PARAM->{ENDPOINT}); my $response=''; eval{ $response = $webService->call(SOAP::Data->name("SubmitXml")->a +ttr({xmlns => $PARAM->{NAMESPACE}}), SOAP::Data->name(Profile => $PARAM->{PROFILE +})->type('string'), SOAP::Data->name(Request + => $xmlRequest)->type('xml'), SOAP::Data->name(Filter +=> $xmlFilter)->type('xml') ); }; if($@){print $@;} print $response; sub SOAP::Transport::HTTP::Client::get_basic_credentials{ return $PARAM->{USER_ID} => $PARAM->{PASS}; } Trace reported by Client SOAP::Transport::new: () SOAP::Serializer::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Lite::new: () SOAP::Transport::HTTP::Client::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Lite::call: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: SOAP::Data=HASH(0xeb4240) SOAP::Data=H +ASH(0xeb58f0) SOAP::Data=HASH(0xeb59b0) SOAP::Data=HASH(0xeb5a70) SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x +ee4820) SOAP::Transport::HTTP::Client::send_receive: POST https://webservi HTTP/1.1 Accept: text/xml Accept: multipart/* Accept: application/soap Content-Length: 2025 Content-Type: text/xml; charset=utf-8 SOAPAction: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="ht +tp://" xmlns:soapenc="http://schema" xmlns:xsd=" +hema" soap:encodingStyle="" +xmlns:soap=""><soap:Body><Su +bmitXml xmlns=""><Profile xsi:type="xsd: +string"></Profile><Request></Request><Filter><_/></Filter></SubmitXml +></soap:Body></soap:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0 +x1215920) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Thu, 02 Apr 2009 10:38:09 GMT Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Client-Date: Thu, 02 Apr 2009 10:35:43 GMT Client-Peer: Client-Response-Num: 1 Client-SSL-Cert-Issuer: /C=US/O=Equifax/OU=Equifax Secure Certific +ate Authority Client-SSL-Cert-Subject: /C=US/ST=Georgia/L=Atlanta Client-SSL-Cipher: RC4-MD5 <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv=" +nvelope/" xmlns:xsd="" xmlns:xsi="htt +p://"> <soapenv:Body><SubmitXmlResponse xmlns="http://webservices.xxxxx. +com"><SubmitXmlResult> </SubmitXmlResult></SubmitXmlResponse></soapenv:Body></soapenv:En +velope> SOAP::Lite::DESTROY: () SOAP::Deserializer::DESTROY: () SOAP::Parser::DESTROY: () SOAP::Transport::DESTROY: () SOAP::Transport::HTTP::Client::DESTROY: () SOAP::Serializer::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: ()

In reply to HTTP basic authentication in SOAP::Lite by mohan2monks

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [choroba]: Anyone from the East coast to say Good night?
    [Discipulus]: still off place choroba?
    [choroba]: till the end of the week

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (9)
    As of 2017-02-27 07:53 GMT
    Find Nodes?
      Voting Booth?
      Before electricity was invented, what was the Electric Eel called?

      Results (376 votes). Check out past polls.