Solved

Consuming webservice using Java

Posted on 2014-03-07
5
390 Views
Last Modified: 2014-03-10
Hi Experts,

we are trying to hit the service using Java webservice and the following is what has been used. its going into exception as soon as its reading the third line.

url wsdllocation = new url("http://WSDL");
QName qName = new QName ("Host", "service");
Service s = Service.create(wsdllocation, qName);
0
Comment
Question by:kalyangkm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 166 total points
ID: 39916417
its going into exception as soon as its reading the third line
Can you please post the details of the exception?

Also, if you are able to, posting the WSDL could be of assistance.
0
 
LVL 16

Accepted Solution

by:
Valeri earned 167 total points
ID: 39916929
I think that you have not pointed to the wsdl in the right way:
if the service is for example at this endpoint:
http://sample.com/hello/HelloService, then your first line should be like that:
url = new URL("http://sample.com/hello/HelloService?wsdl");
in other words: the URL of the service and "?wsdl" at the end.
0
 
LVL 12

Assisted Solution

by:Sharon Seth
Sharon Seth earned 167 total points
ID: 39917127
QName qName = new QName ("Host", "service");

In that line , host & service shld be varibles pointing to wsdllocation and the service name
0
 

Author Comment

by:kalyangkm
ID: 39918532
Thanks guys for the responses. Actually there was an issue with the WSDL, that it has a some number attached to it at the end

like htt://XXXXXXXX?wsdl?12344559333939

and that was changing for session. So we had to go for some stub model which i am not familiar with and someone else is performing that. I will reach out if i have doubts. Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ejb stateless example 2 40
add projects t working set in maven 2 37
Eclipse with various Java releases 7 43
Visual Studio hangs on running project 6 56
In this post we will learn different types of Android Layout and some basics of an Android App.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This video teaches viewers about errors in exception handling.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question