Web Service client - Service definition selected is invalid

泄露秘密 提交于 2019-12-10 19:19:15

问题


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?


回答1:


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




回答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.




回答3:


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).




回答4:


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




回答5:


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




回答6:


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.



来源:https://stackoverflow.com/questions/8642587/web-service-client-service-definition-selected-is-invalid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!