Solved

Rewrite .Net Web Reference call in PHP

Posted on 2015-01-23
2
161 Views
Last Modified: 2015-01-28
Hello,

We are working on converting a website from asp.net to PHP and I currently have a web reference setup in my visual studio project in which I have setup to make calls into a web service.  Our PHP dev team is trying to re-create that webservice call but is having trouble.  Does anyone know the easiest way to conjure out the correct information from Visual Studio so that we can make the same type of call in PHP?

Thanks,
Joe
0
Comment
Question by:sglew
2 Comments
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
ID: 40566824
That's pretty vague. What trouble are they having?

Typically, web references in Visual Studio are SOAP web service implementations that are just a bunch of code generated by the WCF component in .NET. That basically just works by pointing VS at the web service's WSDL file and it generates all the underlying code, and then you just use the results. So there's not a lot of "conjuring" to do because all the magic resides in the WSDL file.

Ultimately, a SOAP call is just an XML string posted along with a custom HTTP header called "SOAPAction". You can install Fiddler2 onto the current ASP.Net web server, activate Fiddler, and then trigger a call to be sent, and you'll be able to see exactly what is sent to the remote web service.

From there, you have the option of either using plain ol' cURL in PHP to post the XML string and custom HTTP header to the remote web service, or you can use a SOAP helper package like nuSOAP to try and replicate a little of what .NET is doing. The cURL is sort of the bare-bones approach, but you would be working with the raw string. That means that your devs would have to know how to build the content of the SOAP call each time (namespaces and all) you wanted to make a different type of call. The nuSOAP (or whatever other package you might find) approach would probably be a little simpler to implement, but has a little more overhead, since it actually pulls the WSDL file and figures out at run-time what needs to be done.
0
 

Author Closing Comment

by:sglew
ID: 40576081
Thanks for the help, you pointed our PHP dev team in the right direction.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't find PHP files on account that has WordPress 3 27
comma true 6 33
website maintenance mode 1 17
Cookie not unsetting 7 19
These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question