erpSOAPPartner е набор от Web services API функции, които имат за цел да обслужват двупосочен обмен на данни между външен за системата клиент и приложния сървър, хостващ Colibri® ERP.
Пълното описание на тези методи под формата на WDSL са достъпни на адрес:
(erp_server_path)/ws/wsdl-viewer.php/ws/wsbase.php
(erp_server_path)/ws/wsbase.php?wsdl
Или на:
(erp_server_path)/ws/wsdl-viewer.php
erpSOAPPartner..GetCustomer erpSOAPPartner..GetCustomerList erpSOAPPartner..RegCustomer
Пример 51. erpSOAPPartner..GetCustomer
Description Returns ONE customer info for given filter. For filter rule field, use only keys from erpPartnerInfo simple type elements, like PNum, PPNum, etc. Style rpc Operation type Request-response. The endpoint receives a message, and sends a correlated message. SOAP action urn:erpgate#erpSOAPPartner..GetCustomer Input erpSOAPPartner..GetCustomerRequest (soap:body, use = encoded) • filter type erpFilter - array of type erpFilterRule • field type string • value type string • oper type string Output erpSOAPPartner..GetCustomerResponse (soap:body, use = encoded) • return type erpPartnerInfo • idPartner type integer • PNum type string • PName type string • PGLN type string • PPNum type string • PAddr type string • PCity type string • PZip type string • PState type string • PCountry type string • PPhone type string • PFax type string • Pemail type string • PWeb type string • PCSalutation type string • PCPerson type string • lang type string • PNameL type string • PAddrL type string • PCityL type string • PStateL type string • PCPersonL type string • PDanR type string • PDanN type string • PBulStat type string • PMOL type string • PMOLPassport type string • PNote type string • dtCreated type dateTime • dtModified type dateTime
Пример 52. erpSOAPOrderC.. GetCustomerList
Description Returns list of customers according to given params. Style rpc Operation type Request-response. The endpoint receives a message, and sends a correlated message. SOAP action urn:erpgate#erpSOAPPartner..GetCustomerList Input erpSOAPPartner..GetCustomerListRequest (soap:body, use = encoded) • params type erpFilterParams • filter type erpFilter - array of type erpFilterRule o field type string o value type string o oper type string • ext_filter type erpFilter - array of type erpFilterRule o field type string o value type string o oper type string • sort type erpSort - array of type erpSortRule o field type string o dir type string • set type erpSetParams - array of type erpSetParam o key type string o value type string • limit type limitRange o offset type integer o count type integer Output erpSOAPPartner..GetCustomerListResponse (soap:body, use = encoded) • return type erpPartnerInfoArray - array of type erpPartnerInfo • idPartner type integer • PNum type string • PName type string • PGLN type string • PPNum type string • PAddr type string • PCity type string • PZip type string • PState type string • PCountry type string • PPhone type string • PFax type string • Pemail type string • PWeb type string • PCSalutation type string • PCPerson type string • lang type string • PNameL type string • PAddrL type string • PCityL type string • PStateL type string • PCPersonL type string • PDanR type string • PDanN type string • PBulStat type string • PMOL type string • PMOLPassport type string • PNote type string • dtCreated type dateTime • dtModified type dateTime
Пример 53. erpSOAPPartner..RegCustomer
Description Try to register a customer and returns registered customer short info. Style rpc Operation type Request-response. The endpoint receives a message, and sends a correlated message. SOAP action urn:erpgate#erpSOAPPartner..RegCustomer Input erpSOAPPartner..RegCustomerRequest (soap:body, use = encoded) • customer type erpPartnerInfo • idPartner type integer • PNum type string • PName type string • PGLN type string • PPNum type string • PAddr type string • PCity type string • PZip type string • PState type string • PCountry type string • PPhone type string • PFax type string • Pemail type string • PWeb type string • PCSalutation type string • PCPerson type string • lang type string • PNameL type string • PAddrL type string • PCityL type string • PStateL type string • PCPersonL type string • PDanR type string • PDanN type string • PBulStat type string • PMOL type string • PMOLPassport type string • PNote type string • dtCreated type dateTime • dtModified type dateTime Output erpSOAPPartner..RegCustomerResponse (soap:body, use = encoded) • idPartner type integer • PNum type string • PPNum type string • Message type string
Масив (erpPartnerInfoArray) с данни за клиент (erpPartnerInfo). Виж атрибута doc за всеки елемент за неговото описание.
<xsd:complexType name="erpPartnerInfo"> <xsd:all> <xsd:element name="idPartner" type="xsd:integer" doc="ERP internal partner number" /> <xsd:element name="PNum" type="xsd:string" doc="Partner number" /> <xsd:element name="PName" type="xsd:string" doc="Partner name" /> <xsd:element name="PGLN" type="xsd:string" doc="Partner GLN number" /> <xsd:element name="PPNum" type="xsd:string" doc="Clients's system partner number" /> <xsd:element name="PAddr" type="xsd:string" doc="Partner official (billing) address" /> <xsd:element name="PCity" type="xsd:string" /> <xsd:element name="PZip" type="xsd:string" /> <xsd:element name="PState" type="xsd:string" /> <xsd:element name="PCountry" type="xsd:string" /> <xsd:element name="PPhone" type="xsd:string" /> <xsd:element name="PFax" type="xsd:string" /> <xsd:element name="Pemail" type="xsd:string" /> <xsd:element name="PWeb" type="xsd:string" /> <xsd:element name="PCSalutation" type="xsd:string" doc="First contact person salutation" /> <xsd:element name="PCPerson" type="xsd:string" doc="First contact person full name" /> <xsd:element name="lang" type="xsd:string" doc="Partner communcation language" /> <xsd:element name="PNameL" type="xsd:string" doc="sane as above, but in partner's local language" /> <xsd:element name="PAddrL" type="xsd:string" /> <xsd:element name="PCityL" type="xsd:string" /> <xsd:element name="PStateL" type="xsd:string" /> <xsd:element name="PCPersonL" type="xsd:string" /> <xsd:element name="PDanR" type="xsd:string" doc="Use 'yes' if partner is having VAT registration" /> <xsd:element name="PDanN" type="xsd:string" doc="Partner VAT number if registered" /> <xsd:element name="PBulStat" type="xsd:string" doc="Partner locar registration number (EIK)" /> <xsd:element name="PMOL" type="xsd:string" doc="Partner MOL person" /> <xsd:element name="PMOLPassport" type="xsd:string" /> <xsd:element name="PNote" type="xsd:string" /> <xsd:element name="dtCreated" type="xsd:dateTime" /> <xsd:element name="dtModified" type="xsd:dateTime" /> </xsd:all> </xsd:complexType> <xsd:complexType name="erpPartnerInfoArray"> <xsd:complexContent> <xsd:restriction base="SOAP-ENC:Array"> <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:erpPartnerInfo[]" /> </xsd:restriction> </xsd:complexContent> </xsd:complexType>
Услугата поддържа сесии чрез cookies, така че това трябва да съобразено от страната на клиента на услугата. Всички заявки в рамките на една сесия използват един сесиен ключ.
Всички сесии на обръщение към Web Service: erpserver трябва да започват с
erpSOAPServer..Login
… и да завършват с
erpSOAPServer..Login
erpSOAPPartner..GetCustomer
Request v.1: – филтър по PNum (номер на клиента в Colibri® ERP)
<urn:erpSOAPPartner..GetCustomer> <filter xsi:type="urn:erpFilter" soapenc:arrayType="urn:erpFilterRule[]"> <item xsi:type="urn:erpFilterRule"> <field xsi:type="xsd:string">PNum</field> <value xsi:type="xsd:string">OL-00001</value> </item> </filter> </urn:erpSOAPPartner..GetCustomer>
Response: (не е посочен пълния код)
<ns1:erpSOAPPartner..GetCustomerResponse xmlns:ns1="urn:erpgate"> <return xsi:type="tns:erpPartnerInfo"> <idPartner xsi:type="xsd:integer">487</idPartner> <PNum xsi:type="xsd:string">OL-00001</PNum> <PName xsi:type="xsd:string">EX-Name</PName> <PPNum xsi:type="xsd:string">EX-0001</PPNum> <PAddr xsi:type="xsd:string">Address line</PAddr> .. .. <dtCreated xsi:type="xsd:dateTime">2017-03-10 11:58:59</dtCreated> <dtModified xsi:type="xsd:dateTime">2017-03-10 11:58:59</dtModified> </return> </ns1:erpSOAPPartner..GetCustomerResponse>
Request: v.2 - филтър по PDanN (ДДС номер на клиента в Colibri® ERP)
<urn:erpSOAPPartner..GetCustomer> <filter xsi:type="urn:erpFilter" soapenc:arrayType="urn:erpFilterRule[]"> <item xsi:type="urn:erpFilterRule"> <field xsi:type="xsd:string">PDanN</field> <value xsi:type="xsd:string">BG000123321</value> </item> </filter> </urn:erpSOAPPartner..GetCustomer>
Response:
<ns1:erpSOAPPartner..GetCustomerResponse xmlns:ns1="urn:erpgate"> <return xsi:type="tns:erpPartnerInfo"> <idPartner xsi:type="xsd:integer">230</idPartner> <PNum xsi:type="xsd:string">К000000114</PNum> <PName xsi:type="xsd:string">"ВАЛДЕС"ЕООД</PName> .. . <PDanN xsi:type="xsd:string">BG000123321</PDanN> <PBulStat xsi:type="xsd:string">000123321</PBulStat> .. . </return> </ns1:erpSOAPPartner..GetCustomerResponse>
erpSOAPPartner..GetCustomerList
Request:
<urn:erpSOAPPartner..GetCustomerList> <params xsi:type="urn:erpFilterParams"> <!--You may enter the following 5 items in any order--> <filter xsi:type="urn:erpFilter" soapenc:arrayType="urn:erpFilterRule[]"> <item xsi:type="urn:erpFilterRule"> <field xsi:type="xsd:string">PNum</field> <value xsi:type="xsd:string">OL-00001</value> </item> <item xsi:type="urn:erpFilterRule"> <field xsi:type="xsd:string">PNum</field> <value xsi:type="xsd:string">OL-00003</value> </item> </filter> <ext_filter xsi:type="urn:erpFilter" soapenc:arrayType="urn:erpFilterRule[]" /> <sort xsi:type="urn:erpSort" soapenc:arrayType="urn:erpSortRule[]" /> <set xsi:type="urn:erpSetParams" soapenc:arrayType="urn:erpSetParam[]" /> <limit xsi:type="urn:limitRange"> <count xsi:type="xsd:integer">10</count> </limit> </params> </urn:erpSOAPPartner..GetCustomerList>
Response: (не е посочен пълния код)
<ns1:erpSOAPPartner..GetCustomerListResponse xmlns:ns1="urn:erpgate"> <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:erpPartnerInfo[2]"> <item xsi:type="tns:erpPartnerInfo"> <idPartner xsi:type="xsd:integer">487</idPartner> <PNum xsi:type="xsd:string">OL-00001</PNum> .. . </item> <item xsi:type="tns:erpPartnerInfo"> <idPartner xsi:type="xsd:integer">489</idPartner> <PNum xsi:type="xsd:string">OL-00003</PNum> .. .. </item> </return> </ns1:erpSOAPPartner..GetCustomerListResponse>
Request v.2:
<urn:erpSOAPPartner..GetCustomerList> <params xsi:type="urn:erpFilterParams"> <ext_filter xsi:type="urn:erpFilter" soapenc:arrayType="urn:erpFilterRule[]"> <item xsi:type="urn:erpFilterRule"> <field xsi:type="xsd:string">PNum</field> <value xsi:type="xsd:string">OL-00001</value> <oper xsi:type="xsd:string">gt</oper> </item> <item xsi:type="urn:erpFilterRule"> <field xsi:type="xsd:string">PNum</field> <value xsi:type="xsd:string">OL-00003</value> <oper xsi:type="xsd:string">lt</oper> </item> </ext_filter> <limit xsi:type="urn:limitRange"> <count xsi:type="xsd:integer">10</count> </limit> </params> </urn:erpSOAPPartner..GetCustomerList>
Request v.2: (не е посочен пълния код)
<ns1:erpSOAPPartner..GetCustomerListResponse xmlns:ns1="urn:erpgate"> <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:erpPartnerInfo[1]"> <item xsi:type="tns:erpPartnerInfo"> <idPartner xsi:type="xsd:integer">488</idPartner> <PNum xsi:type="xsd:string">OL-00002</PNum> .. .. </item> </return> </ns1:erpSOAPPartner..GetCustomerListResponse>
erpSOAPPartner..RegCustomer
Request v.1: (Минимален комплект от данни за регистриране на клиент)
<urn:erpSOAPPartner..RegCustomer> <customer xsi:type="urn:erpPartnerInfo"> <PNum xsi:type="xsd:string"></PNum> <PName xsi:type="xsd:string">EX-Name 4</PName> <PGLN xsi:type="xsd:string"></PGLN> <PPNum xsi:type="xsd:string">EX-0004</PPNum> <PAddr xsi:type="xsd:string">Address line 1</PAddr> <PCity xsi:type="xsd:string">City 2</PCity> <PZip xsi:type="xsd:string">3000</PZip> <PState xsi:type="xsd:string">State 4</PState> <PCountry xsi:type="xsd:string">BG</PCountry> <PPhone xsi:type="xsd:string">555-555555</PPhone> <PFax xsi:type="xsd:string">6</PFax> <Pemail xsi:type="xsd:string">abv@abv.bg</Pemail> <PWeb xsi:type="xsd:string">url</PWeb> <PCSalutation xsi:type="xsd:string"></PCSalutation> <PCPerson xsi:type="xsd:string">Contact person</PCPerson> <lang xsi:type="xsd:string"></lang> <PNameL xsi:type="xsd:string">EX-Name-L</PNameL> <PAddrL xsi:type="xsd:string">9</PAddrL> <PCityL xsi:type="xsd:string">10</PCityL> <PStateL xsi:type="xsd:string">11</PStateL> <PCPersonL xsi:type="xsd:string">Contact person-L</PCPersonL> <PDanR xsi:type="xsd:string">yes</PDanR> <PDanN xsi:type="xsd:string">00000000</PDanN> <PBulStat xsi:type="xsd:string">00000000</PBulStat> <PMOL xsi:type="xsd:string">EX-MOL</PMOL> <PMOLPassport xsi:type="xsd:string"></PMOLPassport> <PNote xsi:type="xsd:string">12</PNote> </customer> </urn:erpSOAPPartner..RegCustomer>
Response: (при успех)
<ns1:erpSOAPPartner..RegCustomerResponse xmlns:ns1="urn:erpgate"> <idPartner xsi:nil="true" xsi:type="xsd:integer" /> <PNum xsi:type="xsd:string">OL-00004</PNum> <PPNum xsi:type="xsd:string">EX-0004</PPNum> <Message xsi:type="xsd:string">Новият клиент е регистриран успешно!</Message> </ns1:erpSOAPPartner..RegCustomerResponse> </ns1:erpSOAPOrderC..RegOrderResponse>
Response: (при опит за регистриране на вече съществуващ клиент)
<ns1:erpSOAPPartner..RegCustomerResponse xmlns:ns1="urn:erpgate"> <idPartner xsi:nil="true" xsi:type="xsd:integer" /> <PNum xsi:type="xsd:string">OL-00004</PNum> <PPNum xsi:type="xsd:string">EX-0004</PPNum> <Message xsi:type="xsd:string">Партьор с този номер вече съществува!</Message> </ns1:erpSOAPPartner..RegCustomerResponse>
В Colibri® ERP трябва да се създаде нов потребител от вид „Потребител“ и тип „Web service“ и да му се направят необходимите настройки.
Забележка | |
---|---|
Тук ще опишем само настройките, необходими за описанта функционалност. |
Настройка на документите;
Този потребител трябва да може да създава „Списък клиенти“.
Номерации на документи и списъци.
Първо в Партньори за трябва да се създаде нова маска за номерация. После в за нови потребители - секция Партньори за избирате новосъздадената маска.
секция