3

i am building a web service on eclipse using Apache AXIS 2 Webservice runtime using Apache Tomcat server (apache-tomcat-7.0.23) while running it on tomcat server it sucessfully shows that the web service is running...

But while creating Webservice client to test the web service and using the wsdl url in the server definition (http://localhost:9090/Axis2WSTest/services/Converter?wsdl), this gives below mentioned error and not letting me to create Webservice client:

The service definition selected is invalid

Can you please suggest me the error and possible solution for it?

MrJames
  • 676
  • 2
  • 8
  • 20
Nishit Jain
  • 1,549
  • 8
  • 21
  • 33
  • Please check if you can access the wsdl url (http://localhost:9090/Axis2WSTest/services/Converter?wsdl) in browser . – Santosh Dec 27 '11 at 08:44
  • yes it shows me a page full of xml tags but with a message at the top of the page: This XML file does not appear to have any style information associated with it. The document tree is shown below. – Nishit Jain Dec 27 '11 at 09:51
  • also the web service have some warnings in two xml files :: axis2.xml and services.xml and the warning is::::::::::::::::::::::::::::::: No grammar constraints (DTD or XML schema) detected for the document. – Nishit Jain Dec 27 '11 at 09:53
  • 2
    It's related with proxy configuration on your eclipse (Windows->Preferences->General->Network Connections) ... check eclipse forum http://www.eclipse.org/forums/index.php/t/158872/ – MrJames May 30 '12 at 14:32
  • The problem could be that your wsdl needs http authentication http://stackoverflow.com/questions/10941796/generate-client-from-http-authenticated-wsdl – gary69 Nov 23 '15 at 20:19

6 Answers6

3

The problem could be that your wsdl needs http authentication. I was getting the same error in eclipse, but it was because the server I was connecting to needed authentication and was returning a 401 error, so eclipse was saying it wasn't a wsdl. Eclipse doesn't seem to have the functionality to prompt for authentication, I was able to generate a client in netbeans using the same wsdl url because netbeans knows to ask for authentication.

Generate client from http authenticated wsdl

Community
  • 1
  • 1
gary69
  • 3,620
  • 6
  • 36
  • 50
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/10310108) – Jatin Nov 23 '15 at 21:39
  • Come on man don't downvote me, it was a link to another answer on this site. – gary69 Nov 23 '15 at 23:04
  • It was not me.. but you might have got because it was link only answer.. now it seems to be fine.. – Jatin Nov 24 '15 at 00:13
  • The link is an internal link to stackoverflow ! It's not a problem. – Luciano Apr 12 '16 at 22:18
2

I was searching for the whole day for an answer for this,generally localhost will be added in your bypass proxy list and hence you will not encounter an error.

Go to windows--> preference-->general--> network-connection and see whether localhost is listed in your proxybypass list.If you are trying to access a external wsdl link and you under some corporate network having proxy firewall you have to set http proxy/https proxy.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
sayannayas
  • 764
  • 9
  • 15
0

Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way

rdp
  • 2,072
  • 4
  • 31
  • 55
0

I had exactly same situation. For me the following worked:

I got the lead from rdp's response - "Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way"

Using IP didn't work for me. What worked for me:

Instead of - http://servername/SomeWebService/Service.asmx?WSDL

putting FQDN for servername. For example -

http://servername.my.company.com/SomeWebService/Service.asmx?WSDL

Ajay Kumar
  • 2,906
  • 3
  • 23
  • 46
0

I had the same issue and I was able to generate the stubs using soapUI. Please follow the this post. Which contains GENERATING CLIENT JAVA CODE FOR WSDL USING SOAP UI – AXIS2 WSDL2JAVA. Before that please download apache axis2 binary from here and extract it.

tk_
  • 16,415
  • 8
  • 80
  • 90
0

Is this how you are trying to generate client stub ?? If yes, just simply create a java project in eclipse, click on it, then press Ctrl+N, select web service client and enter your wsdl url. (make sure you have made sure you can access the wsdl url, by simply giving it in a browser).

Community
  • 1
  • 1
Anuj Balan
  • 7,629
  • 23
  • 58
  • 92
  • May be there is problem selecting the client project where it needs to generate the client stub. – Anuj Balan Dec 27 '11 at 11:08
  • 1
    As i said that while giving wsdl url in the browser it shows me a page full of xml but while selecting the web service client application and pushing the wsdl url in its server definition field it doesnot take it and gives error:::::: The server definition selected is invalid.. – Nishit Jain Dec 27 '11 at 14:18