Skip to content
Snippets Groups Projects
Verified Commit abc3fe6a authored by Damien's avatar Damien
Browse files

Update Maarch WS client sample for Maarch 20.0X

parent 8b044b7f
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<MaarchWSClient>
<!-- REST FRONTAL -->
<WS name="MaarchRestWS" type="REST" uri="https://superadmin:superadmin@demo.maarchcourrier.com/rest/" />
<!-- REST SAMPLES -->
<process name="MaarchRestWSProcessFromScan">
<loop xpath="/Batch/Documents/Document">
<!--loop xpath="/Batch/Documents/Document[not(Metadata/error)]"--> <!-- sample management if no error -->
<!--loop xpath="/Batch/Documents/Document[Metadata/error=1]"--> <!-- sample management if error exists -->
<call name="/res" method="POST">
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="data">
<column>type_id</column>
<value>108</value>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>destination</column>
<value>COU</value>
<type>string</type>
</argument>
<argument name="data">
<column>priority</column>
<value>2</value>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>scan_batch</column>
<value>SVE</value>
<type>string</type>
</argument>
<argument type="entity" name="collId">letterbox_coll</argument>
<argument type="entity" name="table">res_letterbox</argument>
<argument type="entity" name="fileFormat" attribute="extension"/>
<argument type="entity" name="status">INIT</argument>
<return>
<resId metadata="resId" />
</return>
</call>
</loop>
</process>
<process name="MaarchRestWSProcessFromMail">
<loop xpath="/Batch/Documents/Document">
<call name="/res" method="POST">
<argument type="entity" name="encodedFile" eval="base64_encode(file_get_contents($Element-&gt;path))"/>
<argument type="entity" name="data">
<column>subject</column>
<value metadata="subject" />
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>doc_date</column>
<value metadata="doc_date" />
<type>date</type>
</argument>
<argument type="entity" name="data">
<column>type_id</column>
<value metadata="type_id"/>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>destination</column>
<value metadata="destination"/>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>initiator</column>
<value metadata="destination"/>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>priority</column>
<value>2</value>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>custom_t10</column>
<value xvalue="./Metadata/fromaddress" />
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>custom_t11</column>
<value xvalue="./Metadata/toaddress" />
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>custom_t12</column>
<value xvalue="./Metadata/ccaddress" />
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>source</column>
<value xvalue="./Metadata/message_id" />
<type>string</type>
</argument>
<argument type="entity" name="collId">letterbox_coll</argument>
<argument type="entity" name="table">res_letterbox</argument>
<argument type="entity" name="fileFormat" attribute="extension"/>
<argument type="entity" name="status">INIT</argument>
<return>
<resId metadata="resId" />
</return>
</call>
<call name="/resExt" method="POST">
<argument type="entity" name="resId" metadata="resId"/>
<argument type="entity" name="data">
<column>nature_id</column>
<value>email</value>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>category_id</column>
<value>incoming</value>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>exp_contact_id</column>
<value xvalue="./Metadata/fromaddress"/>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>address_id</column>
<value xvalue="./Metadata/fromaddress"/>
<type>integer</type>
</argument>
<argument type="entity" name="table">mlb_coll_ext</argument>
<argument type="entity" name="resTable">res_letterbox</argument>
<return>
<status metadata="status" />
</return>
</call>
<loop xpath="Attachments/Attachment">
<call name="/res" method="POST">
<argument type="entity" eval="base64_encode(file_get_contents($Element-&gt;path))" name="encodedFile"/>
<argument type="entity" name="data">
<column>title</column>
<value metadata="filename"/>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>res_id_master</column>
<value xvalue="ancestor::Document/Metadata/resId"/>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>coll_id</column>
<value>letterbox_coll</value>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>attachment_type</column>
<value>incoming_mail_attachment</value>
<type>string</type>
</argument>
<argument type="entity" name="collId">letterbox_coll</argument>
<argument type="entity" name="table">res_attachments</argument>
<argument type="entity" name="fileFormat" attribute="extension"/>
<argument type="entity" name="status">TRA</argument>
<return>
<resId metadata="resId" />
</return>
</call>
</loop>
</loop>
</process>
</MaarchWSClient>
......@@ -41,30 +41,10 @@
<loop xpath="Attachments/Attachment">
<call name="/attachments" method="POST">
<argument type="entity" eval="base64_encode(file_get_contents($Element-&gt;path))" name="encodedFile"/>
<argument type="entity" name="data">
<column>title</column>
<value metadata="filename"/>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>res_id_master</column>
<value xvalue="ancestor::Document/Metadata/resId"/>
<type>integer</type>
</argument>
<argument type="entity" name="data">
<column>coll_id</column>
<value>letterbox_coll</value>
<type>string</type>
</argument>
<argument type="entity" name="data">
<column>attachment_type</column>
<value>incoming_mail_attachment</value>
<type>string</type>
</argument>
<argument type="entity" name="collId">letterbox_coll</argument>
<argument type="entity" name="table">res_attachments</argument>
<argument type="entity" name="fileFormat" attribute="extension"/>
<argument type="entity" name="status">TRA</argument>
<argument type="entity" name="title" metadata="filename"/>
<argument type="entity" name="resIdMaster" xvalue="ancestor::Document/Metadata/resId"/>
<argument type="entity" name="type">incoming_mail_attachment</argument>
<argument type="entity" name="format" attribute="extension"/>
<return>
<resId metadata="resId" />
</return>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment