<definitions targetNamespace="urn:microsoft-dynamics-schemas/codeunit/spiderExternalSystemAPI" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:microsoft-dynamics-schemas/codeunit/spiderExternalSystemAPI">
  <types>
    <schema elementFormDefault="qualified" targetNamespace="urn:SmartApps-Spider/xmlports/v1.0/ExternalSystem/GetChangedRecords" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:SmartApps-Spider/xmlports/v1.0/ExternalSystem/GetChangedRecords">
      <complexType name="PrimaryKeyField">
        <sequence />
        <attribute name="No" type="string" use="required" />
        <attribute name="Name" type="string" use="required" />
        <attribute name="Value" type="string" use="required" />
      </complexType>
      <complexType name="ChangedRecord">
        <sequence>
          <element minOccurs="1" maxOccurs="unbounded" name="PrimaryKeyField" type="tns:PrimaryKeyField" />
        </sequence>
        <attribute name="EntryNo" type="string" use="required" />
        <attribute name="TableNo" type="string" use="required" />
        <attribute name="TableName" type="string" use="required" />
        <attribute name="TypeOfChange" type="string" use="required" />
        <attribute name="ChangedByUserID" type="string" use="required" />
        <attribute name="ChangedAt" type="string" use="required" />
      </complexType>
      <complexType name="ChangedRecords" mixed="true">
        <sequence>
          <element minOccurs="0" maxOccurs="unbounded" name="ChangedRecord" type="tns:ChangedRecord" />
        </sequence>
      </complexType>
      <element name="ChangedRecords" type="tns:ChangedRecords" />
    </schema>
    <schema elementFormDefault="qualified" targetNamespace="urn:microsoft-dynamics-schemas/codeunit/spiderExternalSystemAPI" xmlns="http://www.w3.org/2001/XMLSchema">
      <element name="GetChangedRecords">
        <complexType>
          <sequence>
            <element minOccurs="1" maxOccurs="1" name="systemCode" type="string" />
            <element minOccurs="1" maxOccurs="1" name="fetchId" type="string" />
            <element minOccurs="1" maxOccurs="1" name="changedRecords" type="q1:ChangedRecords" xmlns:q1="urn:SmartApps-Spider/xmlports/v1.0/ExternalSystem/GetChangedRecords" />
          </sequence>
        </complexType>
      </element>
      <element name="GetChangedRecords_Result">
        <complexType>
          <sequence>
            <element minOccurs="1" maxOccurs="1" name="return_value" type="int" />
            <element minOccurs="1" maxOccurs="1" name="fetchId" type="string" />
            <element minOccurs="1" maxOccurs="1" name="changedRecords" type="q2:ChangedRecords" xmlns:q2="urn:SmartApps-Spider/xmlports/v1.0/ExternalSystem/GetChangedRecords" />
          </sequence>
        </complexType>
      </element>
      <element name="MoveChangedRecordsToHistory">
        <complexType>
          <sequence>
            <element minOccurs="1" maxOccurs="1" name="systemCode" type="string" />
            <element minOccurs="1" maxOccurs="1" name="fetchId" type="string" />
          </sequence>
        </complexType>
      </element>
      <element name="MoveChangedRecordsToHistory_Result">
        <complexType>
          <sequence />
        </complexType>
      </element>
    </schema>
  </types>
  <message name="GetChangedRecords">
    <part name="parameters" element="tns:GetChangedRecords" />
  </message>
  <message name="GetChangedRecords_Result">
    <part name="parameters" element="tns:GetChangedRecords_Result" />
  </message>
  <message name="MoveChangedRecordsToHistory">
    <part name="parameters" element="tns:MoveChangedRecordsToHistory" />
  </message>
  <message name="MoveChangedRecordsToHistory_Result">
    <part name="parameters" element="tns:MoveChangedRecordsToHistory_Result" />
  </message>
  <portType name="spiderExternalSystemAPI_Port">
    <operation name="GetChangedRecords">
      <input name="GetChangedRecords" message="tns:GetChangedRecords" />
      <output name="GetChangedRecords_Result" message="tns:GetChangedRecords_Result" />
    </operation>
    <operation name="MoveChangedRecordsToHistory">
      <input name="MoveChangedRecordsToHistory" message="tns:MoveChangedRecordsToHistory" />
      <output name="MoveChangedRecordsToHistory_Result" message="tns:MoveChangedRecordsToHistory_Result" />
    </operation>
  </portType>
  <binding name="spiderExternalSystemAPI_Binding" type="tns:spiderExternalSystemAPI_Port">
    <binding transport="http://schemas.xmlsoap.org/soap/http" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
    <operation name="GetChangedRecords">
      <operation soapAction="urn:microsoft-dynamics-schemas/codeunit/spiderExternalSystemAPI:GetChangedRecords" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
      <input name="GetChangedRecords">
        <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
      </input>
      <output name="GetChangedRecords_Result">
        <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
      </output>
    </operation>
    <operation name="MoveChangedRecordsToHistory">
      <operation soapAction="urn:microsoft-dynamics-schemas/codeunit/spiderExternalSystemAPI:MoveChangedRecordsToHistory" style="document" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
      <input name="MoveChangedRecordsToHistory">
        <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
      </input>
      <output name="MoveChangedRecordsToHistory_Result">
        <body use="literal" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
      </output>
    </operation>
  </binding>
  <service name="spiderExternalSystemAPI">
    <port name="spiderExternalSystemAPI_Port" binding="tns:spiderExternalSystemAPI_Binding">
      <address location="https://api.businesscentral.dynamics.com/v2.0/[tenantId]/[environmentName]/WS/[companyName]/Codeunit/spiderExternalSystemAPI" xmlns="http://schemas.xmlsoap.org/wsdl/soap/" />
    </port>
  </service>
</definitions>