java2db

How to create a java client to call PHP SOAP web service



SOAP web service  is an XML-based communication protocol service that can be used by the programming languages to communicate each other and transfer data in a client server manner.The process explained below to create a java client to call PHP SOAP web service .

 
Basic Requirements to create PHP SOAP web service .

 Web Server for PHP XAMPP or WAMP .

 nusoap library 

 

to create a java client to call PHP SOAP web serviceSteps to create a PHP SOAP web service

 Step 1 :

Download and unzip the  nusoap library  . copy all library files to server location.
create a java client to call PHP SOAP web service

 

 Step 2 :

Create the below php files in the server location (If you are using XAMPP , create in hotdocs folder).

Example : C:\xampp\htdocs\phpServiceExe

 

create a java client to call PHP SOAP web service

functions.php

soapWebService.php

 

 Step 3 :

Start the web server.

 

create a java client to call PHP SOAP web service Step 4:

Open a web browser and enter the below URL

URL : http://localhost/phpServiceExe/soapWebService.php

http://  represents the protocol.

localhost is the local machine IP(127.0.0.1)

phpServiceExe is the directory which is having our php files.

soapWebService.php is the php file name.

 

create a java client to call PHP SOAP web service

 

create a java client to call PHP SOAP web service Step 5 :

If you enter the url ,you can see the above screen . Click on WSDL link . The below content will display on the browser.
create java client to call PHP SOAP web service

Now we have the WSDL URL of the PHP SOAP web service . So , this is the time to create java client to call PHP SOAP web service .

 

to create a java client to call PHP SOAP web service Steps to create a java client to call PHP SOAP web service :

Basic requirements :

create java client to call PHP SOAP web service Java  (click here to download)

create java client to call PHP SOAP web service Eclipse IDE  (click here to download)

 

create a java client to call PHP SOAP web service Step 1: 

First , create a java  project in the Eclipse ide . Create  a package and a java class (client) to call the PHP SOAP web service.

 

create java client to call PHP SOAP web service

 

 

 Step 2 :

Create the Web service client using  WSDL URL like below .
WSDL in java Web Services

 

 Step 3 :

Copy the below code to client java class.

JavaClientForPHPSoapWebService.java

 

 Step 4 :

Run the client java class like normal stand alone java application. Finally , you will get the below output on the console.

 

WSDL in java Web Services

 

 

create a servletMake sure that the web server(XAMPP or WAMP) is in running mode to create a java client to call PHP SOAP web service.



Related Posts :
How to call C# .Net WCF web service in PHP SOAP client
How to call PHP RESTful web service in java client
How to call java RESTful web service in PHP client
How to create PHP RESTful web service and client with example
How to call java SOAP web service in php ( php web service client )
   [will not be published]



^ <