Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Trading Networks Built-In Services Reference | Doc Folder | Summary of Elements in this Folder | wm.tn.doc:addContentPart
 
wm.tn.doc:addContentPart
Adds a new content part to a document. A content part can be, for example, a segment of a document or an attachment.
Input Parameters
bizdoc
Object The document to which you want to add a new content part. The document must be an instance of com.wm.app.tn.doc.BizDocEnvelope.
partName
String The name of the new content part (for example, “OrderAttachment”).
partBytes
Object The content of the part you are adding to the document. The data type of partBytes must be byte[].
partStream
Object The content of the part you are adding to the document. The data type of partStream must be java.io.InputStream.
mimeType
String The MIME type of the content part you are adding (e.g. “text/plain” or “application/pdf”).
partIndex
String (optional) The position of the content part in the document's existing array of parts. The beginning position of the content part is 0.
Output Parameters
updateCount
String The number of documents that the service updated. The values indicate:
*1 The service added the new content part to the document.
*0 The service did not add the new content part to the document.
Usage Notes
This service updates the document in memory. If the document has been saved, the service also updates the database.
You must supply either partBytes or partStream to the addContentPart service, but not both. If partStream is supplied, Trading Networks will determine whether the new content part is large, and will handle it appropriately. If partBytes is supplied, Trading Networks always considers the new content part to be small, regardless of its actual size. For information about large document handling, see webMethods Trading Networks Administrator’s Guide.