Solved

Rewrite .Net Web Reference call in PHP

Posted on 2015-01-23
2
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

740 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