user2427345
user2427345

Reputation: 11

Error While generating java classes from WSDL using wsimport

I am developing web service using JAX-WS. After Publishing the web service when I tried to generate client stubs using wsimport I have found following issue.

C:\Documents and Settings\vberi\prac_workspace_27_05_2013\WS-Client\src>wsimport
 -s . http://ntlnvn.bmb.com:8080/WS/Greeting?wsdl

parsing WSDL...

[ERROR] file:/C:/Documents%20and%20Settings/vberi/prac_workspace_27_05_2013/WS-C
lient/src/ûs

is unreachable

    Failed to parse the `WSDL`.

**I am able to open wsdl through http://mtlnvn.bmb.com:8080/WS/Greeting?wsdl**

Upvotes: 1

Views: 25630

Answers (6)

vandana p
vandana p

Reputation: 21

Try out the below steps:

  1. Go to the wsdl file http://www.webservicex.net/geoipservice.asmx?WSDL

  2. Right click save as (saving it to your local system), give some name say geoipservice (save type will be xml document by default, so don't save as geoipservice.xml again)

  3. Now type wsimport geoipservice.xml in cmd, you will get the generated class.

Upvotes: 2

Cyva
Cyva

Reputation: 1137

I had the same problem and the solution is to remove all spaces from your project path. After the change it worked well.

In your case the path should be:

    C:\Documents_and_Settings\vberi\prac_workspace_27_05_2013\WS- Client\src>wsimport...

Of course it can not be then you must change a project path.

Problem is mentoined here

Upvotes: 0

direndd
direndd

Reputation: 652

I am working on the same tutorial and faced with the same problem. Did everything suggested in these answers.

What worked for me was removing the "-s ." part from the wsimport command.

When i ran the

wsimport http://localhost:8080/WS/Greeting?wsdl command, all the files got created without an issue.

Hope this will work for others as well.

Upvotes: 1

Mustafa sabir
Mustafa sabir

Reputation: 4360

Being new to developing Webservices using JAX-WS, I was facing a similar issue, and was following this tutorial

The solution you can try is:-

o As said in one of the answers, correct the url, between ntlnvn and mtlnvn

o Make sure the project name should not contain spaces or special characters like - _ . , don't know the exact reason for it, but renaming the project has worked for me once. Maybe the wsimport command has problem dealing with spaces and special characters .

o Most important, which worked for me is that change the build command to:-

wsimport -keep http://mtlnvn.bmb.com:8080/WS/Greeting?wsdl

Upvotes: 1

Ignacio Rubio
Ignacio Rubio

Reputation: 1354

Those are the steps I made:

1.- To make sure that your connection is ok and the web service is available: Open the wsdl in a browser (as you did). Also you can test it with curl.

2.- To make sure that your configuration is all ok: You can test wsimport with another url, for example: wsimport -d C:\deleteFolder -verbose -B-XautoNameResolution http://www.xmlme.com/WSAmazonBox.asmx?WSDL

My concrete problem was that I was using a host name (file hosts from windows). I changed the name for the IP and I had another different problem (failed to read the WSDL document). Perhaps it could help.

Another test i did was to shutdown the server. I was a bit shocked when I realized that the error was the same! ([...] is unreachable, failed to parse the wsdl).

Upvotes: 0

Xargos
Xargos

Reputation: 643

I'm assuming that the link provided is only accessible inside your network.

I believe the problem might be a typo. ntlnvn against mtlnvn. First letter is not the same.

Upvotes: 0

Related Questions