Solved

Rewrite .Net Web Reference call in PHP

Posted on 2015-01-23
2
146 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now