Rewrite .Net Web Reference call in PHP

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
sglewAsked:
Who is Participating?
 
gr8gonzoConnect With a Mentor ConsultantCommented:
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
 
sglewAuthor Commented:
Thanks for the help, you pointed our PHP dev team in the right direction.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.