0

Possible Duplicate:
Java: Simple SOAP Client

How to create java client using WSDL? and how to run or test that client?

Community
  • 1
  • 1
Sarang
  • 754
  • 3
  • 9
  • 24
  • (I asked google for "java soap client" and the duplicate was one of the first answers on the list... the idea of SO is to create a big library of answers to common question. Please use it like that first) – Andreas Dolk Nov 23 '12 at 05:30

1 Answers1

0

Firstly, you have to genrated client stubs from the wsdl. 1. You can use Eclipse to generate client stubs 2. Or using WSDL2JAVA class of the axis.jar 3. Then, configure the PortType of the proxy and invoke appropriate operation ex:

            serviceProxy.setEndpoint(endPoint);
    Service_PortType service_PortType = serviceProxy.getService_PortType();
    ((Stub) service_PortType )._setProperty(Call.USERNAME_PROPERTY,"username");
    ((Stub) service_PortType )._setProperty(Call.PASSWORD_PROPERTY,"password");

    serviceProxy.setService_PortType(service_PortType );
    Response response = serviceProxy.operation(Request);
RajeshKashyap
  • 929
  • 5
  • 3