0

我发现了一个与我在这里尝试做的相反的问题。

向 web 服务添加方法:旧客户端是否需要更新 web 引用?

但是,基本上我有一个我继承的 Web 服务,最初有宏伟的计划,但最终只有少数方法被实际调用。我想删除以清理代码。

它仅在内部使用,我可以验证正在使用的唯一方法。问题是我目前无法更新客户端 wsdl。因此,如果我从 Web 服务中删除调用但客户端 wsdl 未更新,这会导致问题吗?

请记住,我完全肯定不会使用这些方法,因为它们都是内部的,我们控制使用 Web 服务的程序。我们可以在下次更新这些程序时为客户更新 wsdl,但这可能是明年。

4

1 回答 1

0

Not sure if you already found an answer to this. Even we had a similar requirement wherein the service provider had shared us a WSDL and later removed some not required @WebMethods from the Web service implementation file.

However, on invocation of the other methods there was an error as below which led to the conclusion that the WSDL file is validated during the web service call.

javax.xml.ws.WebServiceException: Method XXXXX is exposed as WebMethod, but there is no corresponding wsdl operation with name XXXX in the wsdl:portType

We changed the approach to read the WSDL file locally by having an entry in jax-ws-catalog.xml but even then on dynamically binding the end point the WSDL at remote server was validated and gave the same error.

And yes adding a new method does not cause a harm from the client invocation.

Hope the answer helps.

于 2015-10-06T04:47:51.777 回答