Я отправляю счета, сгенерированные в NetSuite, в сеть поставщиков Ariba через cXML. Недавно один из наших клиентов изменил требование, чтобы вложения в формате PDF сопровождали все представленные счета.
Я могу получить URL-адрес PDF-файла счета-фактуры из сохраненного поиска NetSuite. Могу ли я передать этот URL в элемент вложения? Нужно ли мне также использовать конверт MIME для создания вложения в Ariba?
Это то, что я пытаюсь передать с POSTMAN. Я получаю следующий статус обратно.
Не удалось проанализировать документ: содержимое не разрешено в прологе. (строка 1, столбец 1) [ANCLS-125007011]
Content-Type: multipart/mixed; boundary=RJM4809370DO2978413
--RJM4809370DO2978413
Content-type: text/xml; charset="UTF-8"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.035/InvoiceDetail.dtd">
<cXML payloadID="IN.DO2978413.20190309110306"
<InvoiceDetailRequestHeader invoiceDate="2019-03-09T11:32:55-05:00"
<Extrinsic name="invoicePDF">
<Attachment>
<URL>cid:system.na2.netsuite.com/core/media/media.nl?id=4417380&c=XXXXXX&h=7528d4b175c15c719e89&_xt=.pdf</URL>
</Attachment>
</Extrinsic>
</InvoiceDetailRequestHeader>
............
</cXML>
--RJM4809370DO2978413
Content-Type: application/pdf
Content-ID:<system.na2.netsuite.com/core/media/media.nl?id=XXXXXX&c=4086366&h=7528d4b175c15c719e89&_xt=.pdf>
Content-Disposition: attachment; filename=11315307.PDF
--RJM4809370DO2978413--
Вот необработанный запрос.
POST
https://service.ariba.com/service/transaction/cxml.asp
12:46:10.923
Request Headers:
Content-Type:"Multipart/mixed; boundary="RJM4809370DO2978413";type="text/xml""
cache-control:"no-cache"
Postman-Token:"973410c7-0db8-4140-822c-4ac4dffe3dcd"
User-Agent:"PostmanRuntime/7.6.1"
Accept:"*/*"
Host:"service.ariba.com"
accept-encoding:"gzip, deflate"
content-length:7844
Request Body:"--RJM4809370DO2978413
Content-Type: text/xml; charset=UTF-8
Content-Disposition: attachment
Content-ID:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.035/InvoiceDetail.dtd">
<cXML payloadID="IN.DO2978413.20190311140375" timestamp="2019-03-11T14:34:19.758Z">
<Header>
<From>
<Credential domain="AribaNetworkUserID">
<Identity>ariba@XXXXXXX.com</Identity>
</Credential>
</From>
<To>
<Credential domain="NetworkID">
<Identity>XXXXXXXXXX</Identity>
</Credential>
</To>
<Sender>
<Credential domain="AribaNetworkUserID">
<Identity>ariba@XXXXXX.com</Identity>
<SharedSecret>XXXXXXXXX</SharedSecret>
</Credential>
<UserAgent>Celigo Invoice Request</UserAgent>
</Sender>
</Header>
<Request deploymentMode="production">
<InvoiceDetailRequest>
<InvoiceDetailRequestHeader invoiceDate="2019-03-11T14:34:19-05:00" invoiceID="11315307" invoiceOrigin="supplier" operation="new" purpose="standard">
<InvoiceDetailHeaderIndicator/>
<InvoiceDetailLineIndicator isAccountingInLine="yes" isTaxInLine="yes" />
<InvoicePartner>
<Contact role="remitTo">
<Name xml:lang="en-US">XXXXXXXXX</Name>
<PostalAddress>
<Street>XXXXXXX</Street>
<Street></Street>
<Street></Street>
<City>XXXXXXXX</City>
<State>XX</State>
<PostalCode>XXXXXX</PostalCode>
<Country isoCountryCode="">United States</Country>
</PostalAddress>
</Contact>
<IdReference domain="supplierTaxID" identifier="XXXXXXXX"/>
</InvoicePartner>
<InvoicePartner>
<Contact role="billTo">
<Name xml:lang="en-US">XXXXXXXXXX</Name>
<PostalAddress>
<Street>XXXXXXXXX</Street>
<Street>XXXXXXXX</Street>
<City>XXXXXX</City>
<State>XXX</State>
<PostalCode>XXXXX</PostalCode>
<Country isoCountryCode="US">United States</Country>
</PostalAddress>
</Contact>
</InvoicePartner>
<InvoicePartner>
<Contact role="soldTo">
<Name xml:lang="en-US">XXXXXXXX</Name>
<PostalAddress>
<Street>XXXXXXXX</Street>
<Street></Street>
<City>XXXXXX</City>
<State>XX</State>
<PostalCode>XXXXXXXX</PostalCode>
<Country isoCountryCode="US">United States</Country>
</PostalAddress>
</Contact>
</InvoicePartner>
<InvoiceDetailShipping>
<Contact role="shipFrom">
<Name xml:lang="en-US">XXXXXX</Name>
<PostalAddress>
<Street>XXXXXX</Street>
<Street></Street>
<Street></Street>
<City>XXXXXXX</City>
<State>XXX</State>
<PostalCode>XXXXXX</PostalCode>
<Country isoCountryCode="">United States</Country>
</PostalAddress>
</Contact>
<Contact role="shipTo">
<Name xml:lang="en-US">XXX</Name>
<PostalAddress>
<Street>XXXXX</Street>
<Street></Street>
<Street></Street>
<City>XXXXXX</City>
<State>XXXXXX</State>
<PostalCode>XXXXXX</PostalCode>
<Country isoCountryCode=""></Country>
</PostalAddress>
</Contact>
</InvoiceDetailShipping>
<Extrinsic name="invoicePDF">
<Attachment>
<URL>cid:https://system.na2.netsuite.com/core/media/media.nl?id=XXXXXXXXXXXh=7528d4b175c15c719e89&_xt=.pdf</URL>
</Attachment>
</Extrinsic>
</InvoiceDetailRequestHeader>
<InvoiceDetailOrder>
<InvoiceDetailOrderInfo>
<OrderReference orderID="DO2978413">
<DocumentReference payloadID="1551826564527.841867458.000002574@Hdw2llNIeZN+Ro4D2ATtzEA2KaI="/>
</OrderReference>
</InvoiceDetailOrderInfo>
<InvoiceDetailItem invoiceLineNumber="1" quantity="2">
<UnitOfMeasure>EA</UnitOfMeasure>
<UnitPrice>
<Money currency="USD">1000.00</Money>
</UnitPrice>
<InvoiceDetailItemReference lineNumber="1">
<ItemID>
<SupplierPartID>XXXXXX</SupplierPartID>
</ItemID>
<Description xml:lang="en">XXXXXX</Description>
</InvoiceDetailItemReference>
<Extrinsic name="punchinItemFromCatalog">no</Extrinsic>
</InvoiceDetailItem>
</InvoiceDetailOrder>
<InvoiceDetailSummary>
<SubtotalAmount>
<Money currency="USD">2000</Money>
</SubtotalAmount>
<Tax>
<Money currency="USD">0</Money>
<Description xml:lang="en-US"/>
<TaxDetail category="sales">
<TaxableAmount>
<Money currency="USD">2000</Money>
</TaxableAmount>
<TaxAmount>
<Money currency="USD">0</Money>
</TaxAmount>
<Description xml:lang="en">Sales tax</Description>
</TaxDetail>
</Tax>
<ShippingAmount>
<Money currency="USD">332</Money>
</ShippingAmount>
<GrossAmount>
<Money currency="USD">2332</Money>
</GrossAmount>
<NetAmount>
<Money currency="USD">2332</Money>
</NetAmount>
<DueAmount>
<Money currency="USD">2332</Money>
</DueAmount>
</InvoiceDetailSummary>
</InvoiceDetailRequest>
</Request>
</cXML>
--RJM4809370DO2978413
Content-Type: application/pdf
Content-ID: <https://system.na2.netsuite.com/core/media/media.nl?id=XXXXXXXXXXXX&h=7528d4b175c15c719e89&_xt=.pdf>
Content-Disposition: attachment; filename=11315307.PDF
--RJM4809370DO2978413--
"
Response Headers:
Date:"Mon, 11 Mar 2019 16:46:11 GMT"
Server:"Apache"
Content-Length:"350"
Content-Encoding:"gzip"
Vary:"User-Agent"
Keep-Alive:"timeout=15, max=100"
Connection:"Keep-Alive"
Content-Type:"text/html; charset=UTF-8"
Strict-Transport-Security:"max-age=31536000"
Response Body:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.041/cXML.dtd">
<cXML timestamp="2019-03-11T09:46:11-07:00" payloadID="1552322771952-2933358902296997425@10.162.97.171">
<Response>
<Status code="500" text="Internal Server Error">ANERR-110000000000000000345730259:can not have stream of negative length(start 7610, end 7585, original length 7844)</Status>
</Response>
</cXML>