java2db

How to call C# .Net WCF web service in PHP SOAP client



WCF (Windows Communication Foundation ) tool is  used to implement and deploy a service-oriented architecture (SOA) . It uses WSDL to communicate with the WCF client over SOAP. In this article , we explained step by step process to call C# .Net WCF web service in PHP SOAP client.

 

call C# .Net WCF web service in PHP SOAP client Steps to create  C# .Net WCF web service in Visual Studio 2013 :

call C# .Net WCF web service in PHP SOAP client Step 1 :

Create a Visual C# .Net  project  .In Visual Studio 2013 , go to File -> New -> Project.

call C# .Net WCF web service in PHP SOAP client  If you want , you can create a Web Site .

 

 

call C# .Net WCF web service in PHP SOAP client

 

 

 Step 2 :

Select Visual C# menu and select WCF sub menu ( left side ). Select WCF Service Application and enter any name for your project . In this example it is FirstWCFServiceExe .

call C# .Net WCF web service in PHP SOAP client

So, the project will appear at Solution Explorer (Right side).

 

 

 Step 3 :

Add a new Item to the project (Right click on the project , select Add -> New Item).

call C# .Net WCF web service in PHP SOAP client
 Step 4 :

In the New Item window , select Web -> WCF Service . Give any name to the service with .svc extension.
call C# .Net WCF web service in PHP SOAP client

 

 

 

 Step 5 :

The New Item added to the project tree.

call C# .Net WCF web service in PHP SOAP client

 

 

 Step 6 :

Copy the below code to FirstService.svc.cs and IFirstService.cs  files .

FirstService.svc.cs

 

IFirstService.cs

 

 

 

 Step 7 :

Build the project  (Ctrl+F5) .

 

 

 Step 8 :

If it build successfully  , the below window will appear . Copy the URL .
call C# .Net WCF web service in PHP SOAP client

 

 

 Step 9 :

Add ?wsdl at the end of the  URL  http://localhost:49179/FirstService.svc

Now the full URL looks like http://localhost:49179/FirstService.svc?wsdl .
Copy the URL in the web browser address bar and hit enter. Finally , you will get the WSDL file.
call C# .Net WCF web service in PHP SOAP client
Now we have the WSDL file URL to call C# .Net WCF web service in PHP SOAP client.

 

 

 

call C# .Net WCF web service in PHP SOAP client Steps to call C# .Net WCF web service in PHP SOAP client .

 Step 1 :

Download XAMPP server 

OR

Download WAMP server

Install the web server once it downloaded .

 Step 2 :

Download NuSOAP library

Extract and copy the lib folder in the server location (If the server is XAMPP , copy at htdocs folder ).

 

 Step 3 :

Create a php file in the server location (If the server is XAMPP , creare at htdocs folder ).

 

 

 

 Step 4:

Start the web server to test the application .

 

 

 Step 5 :

Enter the URL localhost/phpClient.php , finally we can get the below output.

 

 

call C# .Net WCF web service in PHP SOAP client




Related Posts :
How to create WCF web service in C# .NET ( visual studio 2013 )
How to call PHP RESTful web service in java client
How to call java RESTful web service in PHP client
How to create a java client to call PHP SOAP web service
How to create PHP RESTful web service and client with example
How to call java SOAP web service in php ( php web service client )
How to provide security to SOAP web services ( JAX-WS )
How to test a Java Web Service using SoapUI
   [will not be published]



^ <