Skip to content

Call to the “Get_Item_Quantity” function in the web service (trying to call soap api using magento restful services)

I have a function in an XML document and I want to return its parameters. My knowledge of connecting the two services is very limited. Do I need to create some middleware or is it possible just to call from Magento Swagger? Any help or resources to point me in the right direction would be super!

Function name: Get_Item_Quantity
This function takes Type, Code fields and returns Qty1, Qty2, Qty3, and Qty4
Parameters:

Type = 0 – input value
Code = ‘product100317’ – input value
Qty 1 – return value
Qty 2 – return value
Qty 3 – return value
Qty 4 – return value

How do I go about this?
This XML file does not appear to have any style information associated with it. The document tree is shown below.

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/codeunit/myWSAPI"
             targetNamespace="urn:microsoft-dynamics-schemas/codeunit/myWSAPI">
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:microsoft-dynamics-nav/xmlports/x00000"
                elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-nav/xmlports/x00000">
            <complexType name="APIDataCapture">
                <sequence>
                    <element minOccurs="1" maxOccurs="1" name="Type" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="Code" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="Qty1" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="Qty2" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="Qty3" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="Qty4" type="string"/>
                </sequence>
            </complexType>
            <complexType name="Root" mixed="true">
                <sequence>
                    <element minOccurs="1" maxOccurs="unbounded" name="APIDataCapture" type="tns:APIDataCapture"/>
                </sequence>
            </complexType>
            <element name="Root" type="tns:Root"/>
        </schema>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:microsoft-dynamics-nav/xmlports/x50014"
                elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-nav/xmlports/x50014">
            <complexType name="APIDataCapture">
                <sequence>
                    <element minOccurs="1" maxOccurs="1" name="Type" type="string"/>
                    <element minOccurs="1" maxOccurs="1" default="0" name="EntryNo" type="int"/>
                    <element minOccurs="1" maxOccurs="1" name="SalesOrderFound" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="SalesOrderNo" type="string"/>
                    <element minOccurs="1" maxOccurs="1" default="0" name="SalesOrderLineNo" type="int"/>
                    <element minOccurs="1" maxOccurs="1" name="SalesOrderETADate" type="string"/>
                    <element minOccurs="1" maxOccurs="1" name="SalesOrderItemNo" type="string"/>
                </sequence>
            </complexType>
            <complexType name="Root" mixed="true">
                <sequence>
                    <element minOccurs="1" maxOccurs="unbounded" name="APIDataCapture" type="tns:APIDataCapture"/>
                </sequence>
            </complexType>
            <element name="Root" type="tns:Root"/>
        </schema>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
                targetNamespace="urn:microsoft-dynamics-schemas/codeunit/MyWSAPI">
            <element name="Get_Item_ETA_Date">
                <complexType>
                    <sequence>
                        <element minOccurs="1" maxOccurs="1" name="itemNo" type="string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="Get_Item_ETA_Date_Result">
                <complexType>
                    <sequence>
                        <element minOccurs="1" maxOccurs="1" name="return_value" type="date"/>
                    </sequence>
                </complexType>
            </element>
            <element name="Find_Duplicate_Ext_Doc_No">
                <complexType>
                    <sequence>
                        <element minOccurs="1" maxOccurs="1" name="custNo" type="string"/>
                        <element minOccurs="1" maxOccurs="1" name="extDocNo" type="string"/>
                    </sequence>
                </complexType>
            </element>
            <element name="Find_Duplicate_Ext_Doc_No_Result">
                <complexType>
                    <sequence>
                        <element minOccurs="1" maxOccurs="1" name="return_value" type="boolean"/>
                    </sequence>
                </complexType>
            </element>
            <element name="Get_Item_Quantity">
                <complexType>
                    <sequence>
                        <element xmlns:q1="urn:microsoft-dynamics-nav/xmlports/x00000" minOccurs="1" maxOccurs="1"
                                 name="aPIDataCapture" type="q1:Root"/>
                    </sequence>
                </complexType>
            </element>
            <element name="Get_Item_Quantity_Result">
                <complexType>
                    <sequence>
                        <element xmlns:q2="urn:microsoft-dynamics-nav/xmlports/x00000" minOccurs="1" maxOccurs="1"
                                 name="aPIDataCapture" type="q2:Root"/>
                    </sequence>
                </complexType>
            </element>
            <element name="GetSalesOrderETA">
                <complexType>
                    <sequence>
                        <element xmlns:q3="urn:microsoft-dynamics-nav/xmlports/x50014" minOccurs="1" maxOccurs="1"
                                 name="aPIDataCapture" type="q3:Root"/>
                    </sequence>
                </complexType>
            </element>
            <element name="GetSalesOrderETA_Result">
                <complexType>
                    <sequence>
                        <element xmlns:q4="urn:microsoft-dynamics-nav/xmlports/x50014" minOccurs="1" maxOccurs="1"
                                 name="aPIDataCapture" type="q4:Root"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
    </types>
    <message name="Get_Item_ETA_Date">
        <part name="parameters" element="tns:Get_Item_ETA_Date"/>
    </message>
    <message name="Get_Item_ETA_Date_Result">
        <part name="parameters" element="tns:Get_Item_ETA_Date_Result"/>
    </message>
    <message name="Find_Duplicate_Ext_Doc_No">
        <part name="parameters" element="tns:Find_Duplicate_Ext_Doc_No"/>
    </message>
    <message name="Find_Duplicate_Ext_Doc_No_Result">
        <part name="parameters" element="tns:Find_Duplicate_Ext_Doc_No_Result"/>
    </message>
    <message name="Get_Item_Quantity">
        <part name="parameters" element="tns:Get_Item_Quantity"/>
    </message>
    <message name="Get_Item_Quantity_Result">
        <part name="parameters" element="tns:Get_Item_Quantity_Result"/>
    </message>
    <message name="GetSalesOrderETA">
        <part name="parameters" element="tns:GetSalesOrderETA"/>
    </message>
    <message name="GetSalesOrderETA_Result">
        <part name="parameters" element="tns:GetSalesOrderETA_Result"/>
    </message>
    <portType name="MyWSAPI_Port">
        <operation name="Get_Item_ETA_Date">
            <input name="Get_Item_ETA_Date" message="tns:Get_Item_ETA_Date"/>
            <output name="Get_Item_ETA_Date_Result" message="tns:Get_Item_ETA_Date_Result"/>
        </operation>
        <operation name="Find_Duplicate_Ext_Doc_No">
            <input name="Find_Duplicate_Ext_Doc_No" message="tns:Find_Duplicate_Ext_Doc_No"/>
            <output name="Find_Duplicate_Ext_Doc_No_Result" message="tns:Find_Duplicate_Ext_Doc_No_Result"/>
        </operation>
        <operation name="Get_Item_Quantity">
            <input name="Get_Item_Quantity" message="tns:Get_Item_Quantity"/>
            <output name="Get_Item_Quantity_Result" message="tns:Get_Item_Quantity_Result"/>
        </operation>
        <operation name="GetSalesOrderETA">
            <input name="GetSalesOrderETA" message="tns:GetSalesOrderETA"/>
            <output name="GetSalesOrderETA_Result" message="tns:GetSalesOrderETA_Result"/>
        </operation>
    </portType>
    <binding name="MyWSAPI_Binding" type="tns:MyWSAPI_Port">
        <binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="Get_Item_ETA_Date">
            <operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"
                       soapAction="urn:microsoft-dynamics-schemas/codeunit/MyWSAPI:Get_Item_ETA_Date" style="document"/>
            <input name="Get_Item_ETA_Date">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </input>
            <output name="Get_Item_ETA_Date_Result">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </output>
        </operation>
        <operation name="Find_Duplicate_Ext_Doc_No">
            <operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"
                       soapAction="urn:microsoft-dynamics-schemas/codeunit/myWSAPI:Find_Duplicate_Ext_Doc_No"
                       style="document"/>
            <input name="Find_Duplicate_Ext_Doc_No">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </input>
            <output name="Find_Duplicate_Ext_Doc_No_Result">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </output>
        </operation>
        <operation name="Get_Item_Quantity">
            <operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"
                       soapAction="urn:microsoft-dynamics-schemas/codeunit/myWSAPI:Get_Item_Quantity" style="document"/>
            <input name="Get_Item_Quantity">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </input>
            <output name="Get_Item_Quantity_Result">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </output>
        </operation>
        <operation name="GetSalesOrderETA">
            <operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/"
                       soapAction="urn:microsoft-dynamics-schemas/codeunit/myWSAPI:GetSalesOrderETA" style="document"/>
            <input name="GetSalesOrderETA">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </input>
            <output name="GetSalesOrderETA_Result">
                <body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="myWSAPI">
        <port name="myWSAPI_Port" binding="tns:MyWSAPI_Binding">
            <address xmlns="http://schemas.xmlsoap.org/wsdl/soap/"
                     location="http://test.myapi.local:7947/my/path/here/myWSAPI"/>
        </port>
    </service>
</definitions>