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

Problem accessing webservice from client code

 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shall i know where to put jaxws-catalog.xml ? and what it should contain.
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic