javax.xml.ws.WebServiceException: Port {http://tempuri.org/}WSHttpBinding_IDWService not found

大憨熊 提交于 2019-12-04 05:04:22

I know this post is over a year old, but it's a highly ranked search result for this error. I'm adding this answer for posterity.

Your wsdl2java command suggests your WSDL is local and you're packaging it into a web app. I suspect the app isn't finding the packaged WSDL at runtime. One option is to load it as a Java resource and pass its location into your service's constructor:

QName qname = new QName("my.name.space", "myName");
URL wsdlLocation = MyServiceClient.class.getResource("/WEB-INF/wsdl/DWService.wsdl");

dwService = new DWService(wsdlLocation, qname);

If you use this approach, triple-check the path to your WSDL. It's easy for getResource() to silently fail, which will produce the same error.

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