Avatar of kcmovies
kcmovies
 asked on

Issue with jax-ws webservice client using annotations

Hi,
I am using RAD8.5 and websphere server 7.  I am trying to develop jax-ws webservice client using annotations. I followed instructions in link webservice client

I am getting following error.
Caused by: javax.xml.ws.WebServiceException: EndpointDescription: PortQName was null and could not be determined by runtime for class org.temp.SmpleService; ServiceDescription: org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl

Not sure what i need to do ? Please help ?
I also need to include "Usernametokens" in SOAP header. Please let me know if you have any sample.

Thanks in advance.
Java EEWeb Services

Avatar of undefined
Last Comment
mccarl

8/22/2022 - Mon
mccarl

Can you post your code AND the WSDL that you used in "wsimport" and point to in the code?
kcmovies

ASKER
Sorry mccarl, the WSDL I used is not in public domain.
I used below sample code. Please let me know if you need any more details ?

public class HelloClient {
  @WebServiceRef(wsdlLocation="http://localhost:8080/
      helloservice/hello?wsdl")
  HelloService service;

  public static void main(String[] args) {
    try {
      HelloClient client = new HelloClient();
      client.doTest(args);
    } catch(Exception e) {
      e.printStackTrace();
    }
  }

  public void doTest(String[] args) {
    try {
      System.out.println("Retrieving the port from 
          the following service: " + service);
      Hello port = service.getHelloPort();
      System.out.println("Invoking the sayHello operation 
          on the port.");

      String name;
      if (args.length > 0) {
        name = args[0];
      } else {
        name = "No Name";
      }

      String response = port.sayHello(name);
      System.out.println(response);
    } catch(Exception e) {
      e.printStackTrace();
    }
  }

Open in new window

kcmovies

ASKER
Please let me know if provided details are not enough to troubleshoot ?

Thanks
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
mccarl

Sorry kcmovies, somehow I have missed your posts until now.


As to your problem, I am a little confused. Your comments in relation to the WSDL lead me to believe that this WSDL is something specific to you and/or your application, but the code that you posted is the sample code from the link you include in your original question. So I am wondering, are you trying just to get the sample from that link going, or are you trying to get your particular app working?

If you are just trying to get the sample going, then you would be using the WSDL that the web service exposes and the sample code that you posted above. But if you are trying to get YOUR application going then, then you would use the non-public domain WSDL that you have but with java code that corresponds to that WSDL. Sorry if this is stating the obvious, but it isn't clear from your post. The code needs to be specific to the WSDL of the service you are trying to connect with; you can't use your WSDL but with the same sample code from that link!
kcmovies

ASKER
Sorry mccarl for confusion.

Posted issue is with my application WSDL and code. I used posted sample code as to develop my web service client code.

Could you please give any clues to trouble shoot this issue ?

I am able to communicate web service with out using annotations, means using normal JAX-WS client code.  

Thanks
ASKER CERTIFIED SOLUTION
mccarl

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question