Version - webMethods 10.15
I have gone through multiple posts regarding the same where the requirement is to send a CSV or PDF or JSON files to an HTTP server using pub.mime and pub.client:http. My requirement is to push an XML file in the same way, and I have tried to replicate the solution shared in these posts but unable to get 200 OK response.
Postman POC:
My Implementation so far:
Steps:
1. Taking the XML string and converting to XMLStream using pub.io.stringToStream
2. Writing the XMLStream from step 1 to a file in FS.
3. pub.mime:createMimeData:
- mimeHeader:
Content-Type -> multipart/form-data
- subType -> form-data
4. pub.mime:addBodyPart
- mimeData -> mimeData
- xmlStream from step 1 -> Content
- mimeHeader:
Content-Disposition -> form-data; name="file"; filename="/apps/data/stage/Trial.xml" (absolute path of the file in FS)
- contenttype -> application/xml
5. pub.mime.getEnvelopeStream:
6. calling pub.client:http with envStream mapped to data.mimeStream
I have tried to directly use the XMLStream to create the mimeData (Without writing to a file) where in Content-Disposition, filename was not included. Getting the same issue. But the ideal solution shouldn't require the XML string to be written to a file.
I have also included all the required headers such as content-type -> multipart/form-data.
I am not sure if I need to handle this differently for an XML file.
Appreciate your inputs on this.
Thanks