Question

I'm new to java web services.

Now i'm trying to create a web service client to access a WSDL based web service. So using eclipse i generated the required client stubs/Binding stubs/Port/Port proxy/ServiceLocator etc.

According to my understanding next step is to create a class with the main method to invoke it. Can anyone help me to write that piece of code or at least some links to refer?

EDITED Thank you so much for the hint @pavan-kumar. Finally i come up with following code and it works. Thanks again.

package clients;

import requiredClasses;

public class TestClient {
    public static void main(String args[]) throws Exception
    {
        TestPortProxy tProxy = new TestPortProxy();

        RequestEntity rEntity = new RequestEntity();
        rEntity.setAttribute1(100);
        rEntity.setAttribute2("value1");

        tProxy.webServiceAction(rEntity);   
    }
}
Was it helpful?

Solution

You already generated required client files with the WSDL ,so next create your own class in that create an object for proxy class which is generated by WSDL, by using that object you can call web service methods in your application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top