Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: need to post a string without user intervention

by jhourcle (Prior)
on Jun 01, 2009 at 19:38 UTC ( #767351=note: print w/replies, xml ) Need Help??

in reply to need to post a string without user intervention

Check your SOAP endpoint -- you're pointing to the WSDL document, which states:

<wsdl:service name="BDOLWebService"> <wsdl:port name="BDOLWebServiceSOAP11port_http" binding="axis2:BDO +LWebServiceSOAP11Binding"> <soap:address location=" +bservices/services/BDOLWebService"/> </wsdl:port> <wsdl:port name="BDOLWebServiceSOAP12port_http" binding="axis2:BDO +LWebServiceSOAP12Binding"> <soap12:address location=" +webservices/services/BDOLWebService"/> </wsdl:port> </wsdl:service>

Note how it does not have ?wsdl at the end.

Replies are listed 'Best First'.
Re^2: need to post a string without user intervention
by byteme (Novice) on Jun 02, 2009 at 07:36 UTC
    Thank you Monks for pointing out a potential flaw (I wouldn't know) the endpoints were provided by the webservice and are correct. I have managed to cobble this bit together and the data is returned complete to the script so I can only guess this is correct. However the main issue is I get a 500 error after changing the code from this
    if($response->code == 200) { print $response->as_string; }
    to this
    if($response->code == 200) { my $last=""; $last = $response->as_string; my $ua = LWP::UserAgent->new; my $action = ''; my $form = {xml => $last}; my $response = $ua->post($action, $form); }
    So I guess the above script has no effect on the 500 internal server error. I am trying to post the result to another script (a php script) on the same server
      Okey dude. Let's say that you have your data in $last. Try smth like that:
      #!/usr/bin/perl -w use strict; use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = POST '', [ +XML => $last, ]; my $response = $ua->request( $req )->as_string; print $resposne; # That's the output from your php script...
      If you want to print the response, as html at your web server, you should add at the top print "Content-type: text/html\n\n";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://767351]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2019-05-25 02:51 GMT
Find Nodes?
    Voting Booth?
    Do you enjoy 3D movies?

    Results (151 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!