CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
How to call .net web service in Perl

 



cool
New User

Nov 6, 2007, 12:04 AM

Post #1 of 3 (1873 views)
How to call .net web service in Perl Can't Post

I try to develop a demo, which client in Perl will try to call the web services I wrote in C#. I've no knowledge in Perl, but as I refer to online forum, I try to follow their example but return no result.

I've installed ActivePerl in my Win XP and tested my perl with the code below and it's successful.


Code
   

#!/bin/perl -w

use SOAP::Lite;
print "Content-type: text/html\n\n";
print SOAP::Lite

-> uri('http://www.soaplite.com/Demo')
-> proxy('http://services.soaplite.com/hibye.cgi')
-> hi()
-> result;



Code
  

But when try to test with .net web service with the code below, it returns blank page.


Code
  

#!/bin/perl -w

use SOAP::Lite;

print "Content-type: text/html\n\n";
print SOAP::Lite



-> uri('http://www.brilliance.com.sg/WSTest/')
-> proxy('http://www.brilliance.com.sg/WSTest/Service1.asmx')
-> on_action(sub{'http://www.brilliance.com.sg/WSTest/', '%s/%s', @_ })
-> DoTest()
-> result . "\n\n";



Code
  

Did I miss out any steps? What is the steps to call .net web services in Perl?


rgkrishnas
Novice

Nov 12, 2007, 3:55 AM

Post #2 of 3 (1844 views)
Re: [cool] How to call .net web service in Perl [In reply to] Can't Post

Check the ActiveState perl path is defined in the Environmental variable, if not defines it.

And also change the UNIX path to Windows

i.e.

#!/bin/perl w

e.g.

#!c:/perl/bin/perl w



I hope the below link will help lot more for you.http://msdn2.microsoft.com/en-us/library/ms995764.aspx


seltzer
Novice

Dec 17, 2007, 5:46 AM

Post #3 of 3 (1788 views)
Re: [cool] How to call .net web service in Perl [In reply to] Can't Post

Your code would only work if your web service was set to allow anonymous logon. Otherwise, you need to authenticate. To authenticate using NTLM, make your proxy line look like this:

-> proxy('http://myserver/mywebservice/Service.asmx', credentials => ['myserver:80','', 'mydomain\\myuserid' , 'mypassword'], keep_alive => '1')


also, to see any errors in the response, put the following line in your soap block:

->on_debug( sub { print @_ } )

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives