Loading ...
Sorry, an error occurred while loading the content.

Getting the request object on the client

Expand Messages
  • Himanshu Garg
    Hello, I need the request object on the client. It is apparently necessary to get rid of the following error:- Can t call method send_cgi_header on an
    Message 1 of 2 , Sep 4, 2006
    • 0 Attachment
      Hello,

      I need the request object on the client. It is apparently
      necessary to get rid of the following error:-

      Can't call method "send_cgi_header" on an undefined value at (eval
      352) line 62

      However my client uses autodispatch and I don't have any object on
      which I can call the transport->http_request() as required in this
      link (http://www.soaplite.com/2005/03/unlocking_065_d.html)

      Could you suggest solutions or workarounds, please.

      Thank You,
      Himanshu.

      ============================ CODE BEGINS ==========================

      #!perl -w
      use CGI;
      use SOAP::Lite +autodispatch =>
      proxy => 'http://www.foo.com/soap/',
      uri => 'http://www.foo.com/Login';

      # create a CGI object to show a false CGI request
      my $cgi = CGI->new('username=hg&password=hg');

      # call the new method of Login module
      my $login_form = new();

      # create a session object
      my $session = $login_form->setup($cgi);

      # THIS DOESN'T WORK
      my $request = transport->http_request();

      # Need the $request object to call this
      $login_form->handle_login($cgi, $request);

      ============================ CODE ENDS ==========================
    • Dave Howorth
      ... .. snip .. ... This does, I think: my $request = SOAP::Lite- transport- http_request(); See the description of self() in the SOAP::Lite POD for a minimal
      Message 2 of 2 , Sep 6, 2006
      • 0 Attachment
        Himanshu Garg wrote:
        > Hello,
        >
        > I need the request object on the client.
        .. snip ..
        >
        > ============================ CODE BEGINS ==========================
        >
        > #!perl -w
        > use CGI;
        > use SOAP::Lite +autodispatch =>
        > proxy => 'http://www.foo.com/soap/',
        > uri => 'http://www.foo.com/Login';
        >
        > # create a CGI object to show a false CGI request
        > my $cgi = CGI->new('username=hg&password=hg');
        >
        > # call the new method of Login module
        > my $login_form = new();
        >
        > # create a session object
        > my $session = $login_form->setup($cgi);
        >
        > # THIS DOESN'T WORK
        > my $request = transport->http_request();

        This does, I think:

        my $request = SOAP::Lite->transport->http_request();

        See the description of self() in the SOAP::Lite POD for a minimal
        explanation

        Cheers, Dave

        > # Need the $request object to call this
        > $login_form->handle_login($cgi, $request);
        >
        > ============================ CODE ENDS ==========================
      Your message has been successfully submitted and would be delivered to recipients shortly.