Oracle Web Services On Demand Guide > Using Attachments with Web Services On Demand > Specifying File Attachment Content >

Attaching a Text File


When attaching a text file (a nonbinary file in printable ASCII format), no Base64 encoding is required.

The following SOAP request illustrates how a text file can be attached:

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

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Body>

<AccountWS_AccountInsert_Input xmlns="urn:crmondemand/ws/account/10/2004">

<ListOfAccount>

<Account>

   <Description>Account with text attachment</Description>

   <Location>Bangalore</Location>

   <AccountName>Attach Text</AccountName>

   <NumberEmployees>300</NumberEmployees>

   <ListOfAttachment>

      <Attachment>

         <FileNameOrURL>Attach Text</FileNameOrURL>

         <FileExtension>txt</FileExtension>

         <DisplayFileName>My Rantings</DisplayFileName>

         <Attachment AttachmentIsTextData="true">

         The quick brown fox jumps over the lazy dog..

         </Attachment>

      </Attachment>

   </ListOfAttachment>

</Account>

</ListOfAccount>

</AccountWS_AccountInsert_Input>

</soap:Body>

</soap:Envelope>

The AttachmentIsTextData attribute of the <Attachment> element has the value true to indicate that the content is plain text and that no Base64 encoding or decoding is required to be performed by the Web Services framework.

Oracle Web Services On Demand Guide, Version 25.0 (Oracle CRM On Demand Release 37) Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.