0

I'm trying to run an XML post using node-fetch but I get this error: org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType

Here is the body I send:

<soapenv:Body>                  
        <e:getXMLListObject>
            <table>Enterprise</table>
            <fields>
                <item>EntCorpName</item>
                <item>EntAcronym</item>
                <item>EntSiren</item>
                <item>EntSiret</item>
                <item>EntAd1</item>
                <item>EntZip</item>
                <item>EntCity</item>
            </fields>
            <query>
                <item>
                    <item>Entid = '001152000000'</item>
                </item>
            </query>
        </e:getXMLListObject>\n                
    </soapenv:Body>

An idea please, this is the first time I use this type of body (table) for the others, it works very well.

The code: await fetch(url,options).then(response => {...} I put this xml in the body parameter in options with soapenv:Envelope ofc.

let options = {
        method: 'POST',
        body: xml,
        timeout: 10000,
        credentials: 'include',
        headers: {
            'Content-Type': 'text/xml;application/x-www-form-urlencoded;charset=UTF-8',
            'Content-Length': xml.length,
            'Accept': 'text/xml',
            'Access-Control-Allow-Credentials': true,
            'Access-Control-Allow-Origin': true,
            'soapaction': 'add',
            "Access-Control-Expose-Headers":"Authorization",
            "Cookie": cookies
        }
    };

NB : Is a client Xml.

Mounaim
  • 61
  • 1
  • 7

0 Answers0