Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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="http://wsqa.nielsenbookdataonline.com/we +bservices/services/BDOLWebService"/> </wsdl:port> <wsdl:port name="BDOLWebServiceSOAP12port_http" binding="axis2:BDO +LWebServiceSOAP12Binding"> <soap12:address location="http://wsqa.nielsenbookdataonline.com/ +webservices/services/BDOLWebService"/> </wsdl:port> </wsdl:service>

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


Comment on Re: need to post a string without user intervention
Select or Download Code
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 = 'http://www.booksforeducation.com/testbed/fred.php'; 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 'http://www.booksforeducation.com/testbed/fred.php', [ +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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2015-07-07 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls