REMOVE THE XSI TAGS AND SOAP RESPONSE XMLNS

0

I have a webservice that returns the following response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
  <ns2:ZCuadre_ConSolResponse xmlns:ns2="http://sap.ws.xxxxx.com/">
     <return>
        <coemp>XXXXX</coemp>
        <fecon xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">XXXXX</fecon>
        <ejerc>XXXXX</ejerc>
        <perio>XXXXX</perio>
        <nucta>XXXXX</nucta>
        <ledger>XXXXX</ledger>
        <saldo xsi:type="xs:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">XXXXX</saldo>
     </return>
  </ns2:ZCuadre_ConSolResponse>

What I'm trying to do is remove the XSI and XMLNS tags from the answer fields so that something like this follows:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
  <ns2:ZCuadre_ConSolResponse xmlns:ns2="http://sap.ws.xxxxx.com/">
     <return>
        <coemp>XXXXX</coemp>
        <fecon>XXXXX</fecon>
        <ejerc>XXXXX</ejerc>
        <perio>XXXXX</perio>
        <nucta>XXXXX</nucta>
        <ledger>XXXXX</ledger>
        <saldo>XXXXX</saldo>
     </return>
  </ns2:ZCuadre_ConSolResponse>

Will it be possible? and if you can ... how do I do it? Thanks for your help.

    
asked by Marcos Alberto Flores Valda 03.10.2017 в 23:48
source

1 answer

0

So far I used the tags @XmlElement, @XmlRootElement and @XmlElementRef, the XmlElement worked for me by defining the namespaces within their properties (@XmlElement (name="coemp", type = Integer.class, namespace=" link ") more or less like this and in the root I put this @XmlRootElement (namespace=" link ") although I do not know if it is correct), but the only thing I could get is to make the namespaces disappear and not the xsi tag:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
  <ns2:ZCuadre_ConSolResponse xmlns:ns2="http://sap.ws.xxxxx.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <return>
        <xsi:coemp>XXXXX</xsi:coemp>
        <fecon xsi:type="xs:string">XXXXX</fecon>
        <ejerc>XXXXX</ejerc>
        <perio>XXXXX</perio>
        <nucta>XXXXX</nucta>
        <ledger>XXXXX</ledger>
        <saldo xsi:type="xs:string">XXXXX</saldo>
     </return>
  </ns2:ZCuadre_ConSolResponse>

    
answered by 04.10.2017 в 00:08