Skip to main content

How to ignore extra WSDL operation when using JAX-WS?

Please note these forums are being decommissioned and use the new and improved forums at
2 replies [Last post]
Joined: 2011-08-12

I'm migrating from Apache Axis2 to JAX-WS and i'm having the following issue:
I have a large WSDL file of size = 140 KB, however my client application invokes only 2 operations, so i removed all the other operations from the WSDL.

I successfully generated the stubs using wsimport on the trimmed WSDL, and i put the original WSDL location in the Service constructor:
MyService stub = new MyService(new URL(<original WSDL location>), new QName(<package>, <MyServiceName>));

when i ran the client, i got the following exception:
The Endpoint validation failed to validate due to the following errors: :: Invalid Endpoint Interface :: :: The operation names in the WSDL portType do not match the method names in the SEI or Web service implementation class.

Because of that, i got the original WSDL again, run wsimport on it, but it fails this time, with this error:
[ERROR] undefined simple or complex type 'soapenc:Array'
line 1086 of file:/root/DecisionControllerWS.wsdl

Googling the error, JAX-WS doesn't support RPC/Encoding.

So i'm stuck here, can't work with the trimmed WSD, can't generate the stubs with the full WSDL!

Any advise? thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-08-12

I'm not a WSDL guru, but it seems that the location of the web service implementation is defaulted to the local host in the WSDL:

<port binding="s0:DecisionControllerWSSoapBinding" name="DecisionControllerWS">
<s1:address location="http://localhost:7001/rtds/webservices-adapter/DecisionControllerWS"/>

That's why i put the original WSDL location when i created the service, to point to the web service implementation, Was i wrong? because i found a property which can achieve that for me:

What if i edited the address location in the trimmed WSDL to point to the implementation, and used the default Service constructor to point to the local trimmed WSD file?

Joined: 2011-08-12

Just in case someone has the same issue, I'm gonna answer my question.

Yes, it is possible to specify the wsdl location to a local trimmed WSDL, and use the of the binding provider, To specify the endpoint implementation URL at runtime.