chnp19 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Everybody,

I am new to perl webservice call....

I am calling a wsdl webservice function and i am getting the response as 400 bad request error...tried and googled many sites but could not get successful..Please help me in solving this issue...Below is my code.

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

Thanks in advance...

Naga

Replies are listed 'Best First'.
Re: Perl WSDL WebService Call
by furry_marmot (Pilgrim) on Feb 29, 2012 at 21:40 UTC

    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
      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