Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write a client code for this webservice

 
Ajoo Bar
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic