The GetProductById function is used to to get an existing product using the product ID.

This function also requires a login token, which is obtained using the Login function.

Return values

The response is of the type Soap_Response_Product with result_object of type Soap_Product

Example request

<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:ns="https://license.x-formation.com/soap/type/vendor/version/1">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:GetProductById soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <token xsi:type="xsd:string">6b044ee33721b188e861c79647a06236004501e1</token>
         <id xsi:type="xsd:int">2</id>
      </ns:GetProductById>
   </soapenv:Body>

Example response

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://license.x-formation.com/soap/type/vendor/version/1"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:GetProductByIdResponse>
         <return xsi:type="ns1:Soap_Response_Product">
            <result_object xsi:type="ns1:Soap_Product">
               <id xsi:type="xsd:int">2</id>
               <name xsi:type="xsd:string">p1</name>
               <version xsi:type="xsd:string">2</version>
               <description xsi:type="xsd:string"/>
               <ProductTemplates SOAP-ENC:arrayType="ns1:Soap_ProductTemplate[1]" xsi:type="ns1:ArrayOfSoap_ProductTemplate">
                  <item xsi:type="ns1:Soap_ProductTemplate">
                     <id xsi:type="xsd:int">2</id>
                     <name xsi:type="xsd:string">Default</name>
                  </item>
               </ProductTemplates>
            </result_object>
            <result_code xsi:type="xsd:int">0</result_code>
            <result_string xsi:nil="true"/>
         </return>
      </ns1:GetProductByIdResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</soapenv:Envelope>
  • No labels