1 Reply Latest reply on May 9, 2012 1:18 PM by Daryl DAngelo

    Attaching a csv file to a cXML document and using MIME

    Gita Mooney Newbie

      What method should I use to transmit a csv file and a cXML document in the same envelope using MIME? my choices are HTTP POST (does not work since Ariba tries to parse the MIME headers in the cXML document and rejects it),  or FTP (if this, what is the location to place the files?

        • Re: Attaching a csv file to a cXML document and using MIME
          Daryl DAngelo Newbie

          You must use MIME over secure http POST to send attachments...

           

          The http header of your multi-part MIME payload (set via commands you us to open the port) should include the following:

           

          Content-type: multipart/related; boundary=something unique; type="text/xml"; start=<uniqueCID>

           

          for example, the header would contain:

          Content-type: multipart/related; boundary=abc;type="text/xml"; start=<uniqueCID>

           

          Depending on the language/library (java/apache shown here) you use to create this transaction, the setting of these headers will change, but should look something like:

          ...

          payload.setHeader("Content-type", "multipart/related");

          payload.setHeader("type", "text/xml");

          payload.setHeader("boundary", "abc");

          payload.setHeader("start","<uniqueCID>");

           

          where payload is defined as an open https connection to the Ariba Network.

           

          then the http payload would contain (important that it starts with the boundary you defined):

          --abc

          Content-type: text/xml

          Content-id: <uniqueCID>

           

          <?xml version="1.0" encoding="UTF-8"?>

          <Attachment>

          <URL>cid:myCSVFile</URL>

          </Attachment>

          ...

          </cXML>

          --abc

          Content-type: text/plain

          Content-id: <myCSVFile>

           

          1,2,3,4,5

          4,5,6,7

          --abc--

           

           

          This is described in cXML User Guide, Chapter 2, under the topic 'Wrapping Layers'