wood burning stoves 2.0*
The moose likes Web Services and the fly likes Problem accessing webservice from client code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem accessing webservice from client code" Watch "Problem accessing webservice from client code" New topic
Author

Problem accessing webservice from client code

murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
I have developed a WebService by using Sun-JaxWs-ri and service is working fine, i am able to access wsdl. Then i have generated the client code by using wsdl with "wsimport" tool from jdk6.

Problem:
Unable to execute the client code. Getting following exception.



Please find the attached wsdl file, client class, service class and port class and its data types.

wsdl file:


Client code:


Port class:


Service class:
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 631
well from error stack its clear that exception is thrown from line 11 of LoginValidationTest so Port class is not in picture yet. also it is shouting about null argument and only possibility from line 46 of LoginValidation is LOGINVALIDATION_WSDL_LOCATION being null.
I assumed you have overridden WSDL location to http://localhost:8082/JaxWsSunTopDown/LoginServicePort?wsdl is the ?wsdl correct here? I think it should be just [b]http://localhost:8082/JaxWsSunTopDown/LoginServicePort. so you need to rerun wsimport

if this does not work then try using jax-ws-catalog.xml with systemId=http://localhost:8082/JaxWsSunTopDown/LoginServicePort and uri=path of your wsdl, something like wsd/LoginServicePort.wsdl.

hope this helps.

-P

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
I ran the the command "wsimport -keep -s ./src -p com.training.jaxws.sun.topdown.client -d ./build/classes http://localhost:8082/JaxWsSunTopDown/LoginServicePort?wsdl"

If i remove ?wsdl it is not working and giving error invalid wsdl. So i must give "http://localhost: 8082/JaxWsSunTopDown /LoginServicePort?wsdl".
murali kankanala
Ranch Hand

Joined: Nov 15, 2004
Posts: 110
Shall i know where to put jaxws-catalog.xml ? and what it should contain.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 631
http://docs.oracle.com/cd/E13222_01/wls/docs103/webserv_adv/xml.html

it should be in your classpath, i guess one dir above wsdl directory.
 
wood burning stoves
 
subject: Problem accessing webservice from client code