pixiImportAddXML
You have the possibility to add Xmls in OpenTrans or BMECat format.
Since pixi version: LOU Official (6.3.0.4452) Additional notes: pixiImportAddXml allow you to add XMLs to pixi* which arte visible in pixi* ControlCenter. You need at least one Import Channel which is active. This Channel does not need any urls configured.
**Important**
When you send XMLs via Api it can happen that some information gets lost or the call can not be executed because some characters in the XML itself. Please wrap your XML into CDATA to cover everythign which is in the XML.
<![CDATA[ /** � */ ]]>
It can be also helpfull to modify the SOAP Client that you are using.
**Example:**
require "vendor/autoload.php";
use Pixi\API\Soap\Client as SoapClient;
use Pixi\Api\Soap\Options as SoapClientOptions;
/**
* Initialize API client and test it
*/
$username = "pixiAPP";
$password = "*******";
$endpoint = "https://api.pixi.eu/soap/pixiAPP/";
$options = new SoapClientOptions($username, $password, $endpoint);
$options->allowSelfSigned();
$options->setOptions(array("use" => SOAP_LITERAL)); // To avoid encoding of the xml
$soapClient = new SoapClient(null, $options->getOptions());
Before you send an XML to pixi* via Api. Please following articles about XML formating:
**BMECat**
http://help.pixi.eu/bmecat-syntax-spezifikationen-fuer-die-uebergabe-im-xml-format
**openTRANS**
http://help.pixi.eu/opentrans-syntax-spezifikationen-fuer-die-uebergabe-im-xml-format
**Sample Call: **
$this->getSoapClient->pixiImportAddXML([
"ChannelRef" => 2,
"OperationType" => "item",
"XML" => <![CDATA[ /* here you add your XML */ ]]>,
"ParameterXml" => "" ]);
Request
Request body
Name | Type | Required | Description |
---|---|---|---|
XML | string | false | Please wrap your XML into CDATA (Additional Information) Type: varchar(-1) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
ChannelRef | integer | true | Use pixiImportGetChannels to get a list of your channels and references Type: int Default value: 0 Example: 123 Available from: LOU Official (6.3.0.4452) |
ParameterXML | string | false | This Paramater you can also use for XML but leave XML parameter empty Type: varchar(-1) Default value: NULL Example: abcdefg Available from: LOU Official - Update 46 (6.9.46.27927) |
OperationType | string | false | It can be either ITEM for Item import XML or ORDER if you want to import an order XML Type: varchar(20) Default value: NULL Example: abcdefg Available from: LOU Official (6.3.0.4452) |
Request Example
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="">
<pixiImportAddXML>
<ChannelRef>0</ChannelRef>
<OperationType>string</OperationType>
<XML>string</XML>
<ParameterXML>string</ParameterXML>
</pixiImportAddXML>
</Body>
</Envelope>
Response
1. Result for imported XML
Name | Type | Description |
---|---|---|
XMLLogKey | integer | Key for created XML Type: int Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiImportAddXMLPost200TextXmlResponse>
<XMLLogKey>0</XMLLogKey>
</PixiImportAddXMLPost200TextXmlResponse>
2. Result for imported XML
Name | Type | Description |
---|---|---|
XMLKey | integer | Key for created XML Type: int Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiImportAddXMLPost200TextXmlResponse>
<XMLLogKey>0</XMLLogKey>
</PixiImportAddXMLPost200TextXmlResponse>
3. Error message
Name | Type | Description |
---|---|---|
ErrorNr | integer | Error Code Type: int Available from: 25.06 (25.6.0.58802) |
ErrorMsg | string | Error Message Type: nvarchar(max) Available from: 25.06 (25.6.0.58802) |
Response Example
<PixiImportAddXMLPost200TextXmlResponse>
<XMLLogKey>0</XMLLogKey>
</PixiImportAddXMLPost200TextXmlResponse>
HTTP Example
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
# echo -n '{{username}}:{{password}}' | base64 | pbcopy
Authorization: Basic {{token}}
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="https://apigateway.descartes.com/tms/pixi/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:pixiImportAddXML>
<XML xsi:type="xsd:string">abcdefg</XML>
<ChannelRef xsi:type="xsd:integer">123</ChannelRef> <!-- required -->
<ParameterXML xsi:type="xsd:string">abcdefg</ParameterXML>
<OperationType xsi:type="xsd:string">abcdefg</OperationType>
</ns1:pixiImportAddXML>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
PHP Example
<?php
getPixiSoapClientResponse('pixiImportAddXML', [
'XML' => 'abcdefg', // string
'ChannelRef' => '123', // integer (required)
'ParameterXML' => 'abcdefg', // string
'OperationType' => 'abcdefg', // string
]);
function getPixiSoapClientResponse(string $method, array $arguments = [])
{
$soapArguments = [];
foreach ($arguments as $key => $value) {
$soapArguments[] = new SoapVar($value, null, '', '', $key);
}
$soapClient = new SoapClient(null, [
'login' => '...',
'password' => '...',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
]);
return $soapClient->__call($method, $soapArguments);
}