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
Solved

Rewrite .Net Web Reference call in PHP

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Title # Comments Views Activity
Could you point what is needed to make an array to be inserted as MySQL table's lines by using PHP? 25 63
AJAX pass along a variable 3 46
Link failure 16 31
Ajax and PHP 4 29
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

792 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