Ignore missing method in JAX-WS client
Just for reference. You can also annotate the method with
@WebMethod(exclude=true)
This will make sure the method is ignored for comparing with the wsdl.
Related videos on Youtube
musiKk
It's musiKk (6D, 75, 73, 69, 4B, 6B). Not music, musik, musick, musikK, musikk, musickk, etc... Author of plyj GitHub
Updated on September 15, 2022Comments
-
musiKk over 1 year
I have a model that is used to create a Web Service endpoint on a server. The same model is used for the client. However when a new operation is added to the server but the client still uses the older model, service creation fails with an exception like the following (line breaks added for clarity):
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
I understand the problem but is it possible to ignore this? I'd like to be backwards compatible when consuming the Web service. As long as methods are merely added this should work just fine most of the time.
The problem occurs in the
getPort
method:Service s = Service.create( new URL("http://example.com/foo?wsdl"), new QName("http://example.com", "MyService")); MyService m = s.getPort(MyService.class);
-
musiKk over 11 yearsI'll have to see if that works. The WSDL is generated by JAX-WS and split into multiple WSDL and schema files (cuz that's how JAX-WS rolls). I guess those have to be merged or the lookup of the
schemaLocation
fails. -
AlexWien over 11 yearsThe generated schema files source code, of course in the client stays. It is only neccessary that the schema stays compatible, and that the new fields, methods, are marked as optional (default, i think) in the server WSDL
-
AlexWien over 11 yearsUpdated answer, in my case it was a change attribute, not a method
-
NBPalomino almost 5 yearsThis worked for me, thanks... I use Weblogic 12.2.1.3 with Java 8 and Spring Boot 1.5.15