Solved

Consuming webservice using Java

Posted on 2014-03-07
5
389 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to Alipay 10 42
Why doesn't this text field show up on my Applet frame? 2 19
Running JavaFX on the Raspberry Pi 27 38
Create .bat File 16 28
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

809 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