http://www.perlmonks.org?node_id=957037


in reply to Perl WSDL WebService Call

Well, first you should open a browser and try to load http://localhost:8080/service.svc?wsdl. If that doesn't work, you found your problem.

If that works, then maybe add some print statements to you code so you see what's giving the error. For example:

use SOAP::Lite; my $lite = SOAP::Lite -> service('http://localhost:8080/service.svc?ws +dl'); print "This is after creating \$lite\n"; my $arg1 ="SRC"; my $arg2 = "ARG"; my @arg3 = ('test1','test2','test3'); my @res = $lite->Func($arg1,$arg2,@arg3); print "This is after running Func\n";

My guess would be that either the URL is no good, or Func is causing the problem. What is Func? Care to share some code so we know what the heck you're doing?

--marmot

Replies are listed 'Best First'.
Re^2: Perl WSDL WebService Call
by Anonymous Monk on Aug 09, 2014 at 06:34 UTC
    Does anyone know how can i send the oauth token with SOAP::Lite -> service I think i need to add it to the Authorization Header but i cant figure out how to do it

      Does anyone know how can i send the oauth token with SOAP::Lite -> service I think i need to add it to the Authorization Header but i cant figure out how to do it

      First you need to know where it needs to go, then just get it there, ->transport is the LWP object you want

        Hi, I tried to add $service->transport->http_request->headers->push_header('Authorization'=>$token); but i get the following error Can't call method "http_request" on an undefined value at C:/Program Files (x86)/NextNine/SiteServer/Perl/ActivePerl-5.14.2.1402/perl/site/lib/SOAP/Li te.pm line 482.
        Hi thanks again for your help i am not sure how can i replace my $url = "https://sepm-site:8446/sepm/ws/v1/LicenseService?wsdl"; #my $service = soap->service($url); with my $soap = SOAP::Lite->uri( 'http://127.0.0.1/MyModule' ) ->proxy( 'http://127.0.0.1:1203' ); What will be my uri and what is the proxy
        Hi , Thanks for your quick reply :-) my current Code: my $token = getValidToken(); my $url = "https://sepm-site:8446/sepm/ws/v1/LicenseService?wsdl"; my $service = SOAP::Lite->service($url); print "web method : ", $service->getLicenseSummaryInfo(), "\n"; how can i add the Oauth token to the service Object? / or how can i add it to the header