サーバー上に Web サービス エンドポイントを作成するために使用されるモデルがあります。クライアントにも同じモデルが使用されます。ただし、新しい操作がサーバーに追加されたが、クライアントがまだ古いモデルを使用している場合、サービスの作成は次のような例外で失敗します (わかりやすくするために改行が追加されています)。
Exception in thread "main" javax.xml.ws.WebServiceException:
Method someNewMethod is exposed as WebMethod, but there is no
corresponding wsdl operation with name someNewMethod in the
wsdl:portType{http://example.com}MyService
問題は理解できましたが、これを無視することはできますか? Web サービスを利用する際に後方互換性を維持したいと考えています。メソッドが単に追加されている限り、これはほとんどの場合問題なく動作するはずです。
問題は次のgetPort
メソッドで発生します。
Service s = Service.create(
new URL("http://example.com/foo?wsdl"),
new QName("http://example.com", "MyService"));
MyService m = s.getPort(MyService.class);