samedi 9 mai 2015

JAXB support for SOAP style arrayType

I'm trying to make a new version of a server that previously used Axis 1.4 to respond to SOAP RPC requests using Spring-WS. I have a few of the RPC calls working, but I'm stuck trying to satisfy a request that expects a SOAP body that looks like this:

<rpcCallResponse soapenv:encodingStyle="http://ift.tt/wEYywg">
   <responseElement soapenc:arrayType="xsd:string[5]" 
        xsi:type="soapenc:Array" 
        xmlns:soapenc="http://ift.tt/wEYywg">
      <responseElement xsi:type="xsd:string">val1</responseElement>
      <responseElement xsi:type="xsd:string">val2</responseElement>
      <responseElement xsi:type="xsd:string">val3</responseElement>
      <responseElement xsi:type="xsd:string" xsi:nil="true"/>
      <responseElement xsi:type="xsd:string" xsi:nil="true"/>
   </responseElement>
</rpcCallResponse>

I'm struggling to write the XML schema for this, and to get the JAXB marshaller to shove the xsi:type annotations into the response.

What's the correct XML schema to use/set of annotations to use to get this to marhsal (Java -> XML) correctly?

Aucun commentaire:

Enregistrer un commentaire