Solved

Soap 1.2 Request from ODX - is it possible?

  • 11 August 2022
  • 2 replies
  • 54 views

Badge

Hi,

Have anyone succeeded with a Soap 1.2 call from ODX?

We have a source that only have a Soap interface. I've done a lot of testing but so far very little success.

For the moment it complains about my content-type header. Don't know why. I'm using the rest connector. Perhaps I should use a xml connector instead. 

If anyone could share a working example I would be more than happy. Perhaps it's not possible at all. I'm not sure. 

Regards

Anders Bengtsson

icon

Best answer by fwagner 23 August 2022, 01:50

View original

2 replies

Userlevel 2
Badge +3

Hi Anders,

thank you for your question!

It is possible to send SOAP requests using RSD files, the REST connector is the right one for the job.

A basic example with could look something like this:

<api:script xmlns:api="http://apiscript.com/ns?v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- See Column Definitions to specify column behavior and use XPaths to extract column values from XML. -->
    <api:info title="2" desc="Generated schema file." xmlns:other="http://apiscript.com/ns?v1">
        <!-- You can modify the name, type, and column size here.   -->
        <attr name="Field1"  xs:type="string"  readonly="false"  other:xPath="/item/Field1"     />
        <attr name="Field2"  xs:type="string"  readonly="false"  other:xPath="/item/Field2"        />
        <attr name="Field3"  xs:type="string"  readonly="false"  other:xPath="/item/Field3"     />
    </api:info>

    <api:set attr="DataModel" value="DOCUMENT" />
    <api:set attr="PushAttributes" value="true" />
    <api:set attr="EnablePaging" value="true" />

    <api:set attr="Header:Name#" value="SOAPAction"/>
    <api:set attr="URI" value="https://your.soap.endpoint.com/?wsdl" />

    <api:set attr="XPath" value="/item" />
    <api:set attr="method" value="POST"/>
    <api:set attr="Header:Name" value="Content-Type" />
    <api:set attr="Header:Value" value="text/xml" />

    <api:set attr="data">
        <?xml version="1.0" encoding="utf-8"?>
        <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uen="uen:esws">
            <soapenv:Header/>
            <soapenv:Body>
                <uen:Esws.getUsers soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
                    <p_companyID xsi:type="xsd:string">[_connection.Password]</p_companyID>
                    <p_page xsi:type="xsd:string"></p_page>
                    <p_locationID xsi:type="xsd:string">3</p_locationID>
                    <p_user_id xsi:type="xsd:string"></p_user_id>
                </uen:Esws.getUsers>
            </soapenv:Body>
        </soapenv:Envelope>
    </api:set>
    <api:set attr="XPath" value="/Envelope/Body/" />

    <!-- The GET method corresponds to SELECT. Here you can override the default processing of the SELECT statement. The results of processing are pushed to the schema's output. See SELECT Execution for more information. -->
    <api:script method="GET">
        <api:set attr="method" value="GET"/>
        <api:call op="xmlproviderGet">
            <api:push/>    
        </api:call>
    </api:script>
</api:script>

Thomas has certainly more knowledge around this, but I think this should give you an idea.

/Frank

Userlevel 6
Badge +5

Hi Frank & Anders

Yes I can confirm that using 1.2 works with SOAP. We had an ticket with the issue and we could use it same as for other editions.

The main part about using SOAP or other similar non-default calls is that the statement needs to be stored in a set data tag.

<api:set attr="data">
---
</api:set>

So it could also be some JSON body call or similar that were in here.

Reply