aspose file tools*
The moose likes Web Services and the fly likes How to write a client code for this webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to write a client code for this webservice" Watch "How to write a client code for this webservice" New topic
Author

How to write a client code for this webservice

Ajoo Bar
Ranch Hand

Joined: Mar 28, 2011
Posts: 30
Hi,

I generated stubs from this wsdl file StockQuoteService.wsdl (See a attached text WSDL file), I need to write client so that I can make a call to end point URL. I have created a mock service in the SOAP UI. http://localhost:8080/axis2/services/StockQuoteService. Can someone help me here to write client code. I have attached all stub java classes.


This is what I wrote, what I am doing wrong here.


WSDL File
Ajoo Bar
Ranch Hand

Joined: Mar 28, 2011
Posts: 30
Ok, I got this working now, I have a question where do I use StockQuoteServiceSOAP11BindingStub stub class?

System.out.println("Testing Webservice");
StockQuoteServiceSOAP11BindingStub stub;
StockQuoteServiceLocator stockServiceLocator = new StockQuoteServiceLocator();
StockQuoteServicePortType portType = (StockQuoteServicePortType)stockServiceLocator.getStockQuoteServiceSOAP11port(portAddress);
double price = portType.getPrice("ABC");

System.out.println("Price is "+price);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write a client code for this webservice