0

I'm trying to send the attachments using custom java app ( using Apache commons ) to Ariba network as suggested in the below post / cXML user guide.

Problem Posting MIME encoded attachment to Ariba Supplier Network

Getting "EOF Skipping Headers" error response from Ariba

As per my research above error will thrown when the ending boundary not found, but my message has the end boundary.

Please let me know if any one ran into similar issue and able to resolve.

Thanks for your help.

Here is the message format that I was posting to Ariba.

Below are the HTTP headers:

POST / HTTP/1.1
Content-Type: multipart/related;boundary="1403166176143"; type="text/xml"; start="<987654321@xxx.com>"
User-Agent: Jakarta Commons-HttpClient/3.0.1
Content-Length: 4356
Host: Target Server

& This is body of the message

--1403166176143
Content-Type: text/xml; charset=UTF-8
Content-Disposition: attachment; filename=PO.xml
Content-ID: <987654321@xxx.com>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.021/cXML.dtd">

All the PO related cXML

 <Comments>Tax Rates:<Attachment><URL>cid:123456789@xxx.com</URL></Attachment></Comments>
      </ItemOut>
    </OrderRequest>
  </Request>
</cXML>


--1403166176143
Content-type: text/plain;
Content-ID: <123456789@xxx.com>
Content-Disposition: attachment; filename=FirstAttach.txt
Content-length: 44
VGhpcyBpcyB0aGUgZmlyc3QgUE8gYXR0YWNobWVudC4=
--1403166176143--

using Apache commons PostMethod

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
ssan
  • 190
  • 1
  • 4
  • 14

1 Answers1

1

The final MIME part has a number of problems.

  • There is no empty line between the part's headers and its body. This is a fatal error which prevents the structure from being properly parsed.
  • There is no Content-Transfer-Encoding: header. The body is clearly in base64; in the absence of a proper identifying header, it will be regarded as just text. This causes incorrect parsing of the attached data, but does not introduce a syntax error.
  • The Content-Type: header appears to be truncated. It is permissible to omit the charset= parameter, but if you did not intend to include it, why does the field end with a semicolon? This is not a crucial omission, but hints at a possible additional problem. (The encoded data is currently pure ASCII, so the default character set will be fine.)
tripleee
  • 175,061
  • 34
  • 275
  • 318
  • Thank you so much for prompt response!!!. I made correction to second part as you suggested and able to post attachment successfully. – ssan Aug 06 '14 at 21:53