misco
misco

Reputation: 1952

How to rename the element of SOAP respond in CXF?

I use CXF for web services, and I would like to change name of return element. Node type is generated JAXB class from XSD schema. Any ideas how to change it?

I have:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <GetNodesRespond>
         <return>
            <idNode>1</idNode>
            ...
         </return>
         ...
      </GetNodesRespond>
   </soap:Body>
</soap:Envelope>

I want:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <GetNodesRespond>
         <Node>
            <idNode>1</idNode>
            ...
         </Node>
         ...
      </GetNodesRespond>
   </soap:Body>
</soap:Envelope>

Upvotes: 1

Views: 791

Answers (1)

Jason Pyeron
Jason Pyeron

Reputation: 2528

Apply the xml element annotation to the interface for the method.

@XmlElement(name="Node")

Upvotes: 1

Related Questions