TL;DR: How can I have an optional <part> in the response <message> for a wsdl service.
I am:
- targeting an existing service
- writing a client to talk to the service
- implemented the service definition as a Java interface
The problem: Depending on the version of the service there could be an additional element in the response Body element.
With the following service definition I can target v1 of the service:
<message name="CreateResponse">
<part name="ResourceCreated" element="ns7:ResourceCreated" />
</message>
And this one works with v2 of the service:
<message name="CreateResponse">
<part name="ResourceCreated" element="ns7:ResourceCreated" />
<part name="Shell" element="ns8:Shell" />
</message>
Question: How can I target both versions with the same service definition? I don't really need the second element so just ignoring it would be fine.
Details:
- The service is the
Windows Remote Management Service
. - I am writing a Java client to target it.
- The code is available at https://github.com/cloudsoft/winrm4j
- When talking to Windows 7 the
Create
response contains a singleResponseCreated
element. - When talking to Windows 2012 the
Create
response contains two elements -ResponseCreated
andShell
.