100% found this document useful (2 votes)
4K views2 pages

How To Add Web Service SOAP Call On Netbeans IDE

Describes briefly how to add SOAP web service call using Netbeans 6.5 IDE built in wizards for both J2ME and J2EE/J2SE platforms

Uploaded by

mohamed shaheen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
4K views2 pages

How To Add Web Service SOAP Call On Netbeans IDE

Describes briefly how to add SOAP web service call using Netbeans 6.5 IDE built in wizards for both J2ME and J2EE/J2SE platforms

Uploaded by

mohamed shaheen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

How to call SOAP webservice On Netbeans IDE

Posted on http://m-shaheen.blogspot.com

In these below lines I describe briefly how to add SOAP web service call using
Netbeans 6.5 IDE built in wizards for both J2ME and J2EE/J2SE platforms:

J2ME platform

1. Right click the project item : New>MIDP>Java ME Web Service Client

2. Press Next

3. enter WSDL file URL

4. Press Finish

This will create SOAP stub classes for that web service

5. in the midlet code insatiate the web service stup class (not use the interface)

Sample code:

eis_wsbackendService_Stub backend = new


eis_wsbackendService_Stub();

backend._setProperty(

eis_wsbackendService_Stub.SESSION_MAINTAIN_PROPERTY,

new Boolean(true)

);

try {

Integer userID = new Integer(10245);

aa = backend.getAccounts(userID);

} catch (RemoteException ex) {

ex.printStackTrace();

}
J2EE/J2SE
1. Right click the project item : New>WebServiceClient

2. enter WSDL URL

this will create the SOAP stub classes for the referenced Web service

3. Drag and drop the web service reference from the IDE this will create the
following code :

try {

// Call Web Service Operation

com.galaxy.test.eis.ws.EisWsbackendService service = new


com.galaxy.test.eis.ws.EisWsbackendService();

com.galaxy.test.eis.ws.EisWsbackend port =
service.getEisWsbackendPort();

// TODO initialize WS operation arguments here

Integer userID = 10245;

// TODO process result here

java.lang.String result = port.getAccounts(userID);

System.out.println("Result = "+result);

} catch (Exception ex) {

ex.printStackTrace();

You might also like