Home > Software design >  SOAP Element/XML Type In Java/Camel
SOAP Element/XML Type In Java/Camel

Time:01-19

I'm developing a java/camel CXF service, and I have to generate this body in the WSDL read

<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:v12="nameSpace" 
xmlns:v13="otherNamespace">
   <soapenv:Body>
      <v12:consult>
         <account>
            <!--Optional:-->
            <v13:code>?</v13:code>
            <!--Optional:-->
            <v13:name>?</v13:name>
            <!--Optional:-->
            <v13:address>?</v13:address>
         </account>
      </v12:consult>
   </soapenv:Body>
</soapenv:Envelope>

In my serviceClass I declare consult like this:

            @WebParam(partName = "Parametro", name = "consult", targetNamespace = "nameSpace")
            ConsultParameters parameters,

ConsultParameters is class which utilize @XmlRootElement/@XmlType

How can I insert the v13 namespace in those attributes inside a object, can I do this modifying the serviceClass or the data class with XMLType?

CodePudding user response:

just found it

In my data class Account inside ConsultParameters in my attributes code, name, address I just add the follow annotation in each, like:

@XmlElement(namespace = "otherNamespace")
protected String code;
  •  Tags:  
  • Related