REST service missing Multipart form data and getting Error -400

Hello,
I am using Mediator version - 9.7.0.0 with IS_9.7_Core_Fix20.
I defined a REST service with a resource having POST method.
I am sending a request to the mediator service with Multipart form data in the request. I can see in the log, the mediator received full length of the request but when it made a call to the rest service, it did not send the full content.
Can you please help me to identify the issue. Am I missing any configuration.
Below log shows Mediator received the payload (highlighted in green with Content-Length: 140837) but it did not pass the payload to native service (highlighted in red with Content-Length: 67).
I am getting Error -400.

2018-06-05 08:55:41 BST [ISC.0039.0001D] POST /ws/DocuSignSendEnvelope/accounts/422624/envelopes
2018-06-05 08:55:41 BST [ISC.0038.0002D] <-- Accept: application/xml
2018-06-05 08:55:41 BST [ISC.0038.0002D] <-- Content-Type: multipart/form-data; boundary=BOUNDARY
2018-06-05 08:55:41 BST [ISC.0038.0002D] <-- User-Agent: Java/1.8.0_171
2018-06-05 08:55:41 BST [ISC.0038.0002D] <-- Host: vge-mktred-sms1
2018-06-05 08:55:41 BST [ISC.0038.0002D] <-- Connection: keep-alive
2018-06-05 08:55:41 BST [ISC.0038.0002D] <-- Content-Length: 140837
2018-06-05 08:55:41 BST [ISS.0033.0140T] Session 5326b830fb741c6097edffffffff2403 - Created in memory.
2018-06-05 08:55:41 BST [ISS.0012.0003T] Client did not provide a session ID. Creating a new session 5326b830fb741c6097edffffffff2403.
2018-06-05 08:55:41 BST [ISS.0012.0036D] No user found corresponding to the passed SAML assertion.
2018-06-05 08:55:41 BST [ISS.0012.0028D] DefaultLoginModule skipping invalid credentials to enable passing them to end point.
2018-06-05 08:55:41 BST [ISS.0012.0009D] Successfully authenticated user “local/Default”.
2018-06-05 08:55:41 BST [MED.0050.0653T] PGRestDispatcher.invoke - Invoking the REST service. Called the registered PGRestDispatcher.
2018-06-05 08:55:41 BST [MED.0050.0655D] Finding Operation for service DocuSignSendEnvelope routing to /ws/DocuSignSendEnvelope/accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0661T] Trying to find the operation for request path accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0662T] Found trie root node from message context for service accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0663D] Mediator found a matching tree node for your request. HTTP location of the node: /accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0664D] Mediator found an exact match for the operation in your request
2018-06-05 08:55:41 BST [MED.0050.0654D] Found service DocuSignSendEnvelope and operation {http://namespaces.DefaultOrganization.com/wsdl}POST_envelopes by PGRestDispatcher
2018-06-05 08:55:41 BST [MED.0201.0035T] PgMen incoming event handler created a new sie event for virtual service.
2018-06-05 08:55:41 BST [MED.0201.0002T] PgMen incoming handler invoked for virtual service. service name: DocuSignSendEnvelope sessionId: 5326b830fb741c6097edffffffff2403
2018-06-05 08:55:41 BST [MED.0201.0028D] PgMen incoming event handler, before attempting cache access, temporarily replaced TCCL with com.wm.app.b2b.server.ServerClassLoader@2dc042fd [Old][WmMediator] jars:<[D:\SoftwareAG\IntegrationServer\instances\default\packages\WmMediator\code\jars\mediator-core.jar, D:\SoftwareAG\IntegrationServer\instances\default\packages\WmMediator\code\jars\mediator-events.jar, D:\SoftwareAG\IntegrationServer\instances\default\packages\WmMediator\code\jars\mediator-is.jar, D:\SoftwareAG\IntegrationServer\instances\default\packages\WmMediator\code\jars\mediator-upgrade.jar]> classes dirs:<[D:\SoftwareAG\IntegrationServer\instances\default\packages\WmMediator\code\classes]>
2018-06-05 08:55:41 BST [MED.0201.0033D] PgMen incoming event handler, after accessing cache, restores TCCL to java.net.URLClassLoader@49dd1c3b
2018-06-05 08:55:41 BST [MED.0201.0022D] PgMen incoming event handler created ServiceInvokeGateway for DocuSignSendEnvelope with 0 enforcers
2018-06-05 08:55:41 BST [MED.0050.0241D] Validating http method and content-type for REST request
2018-06-05 08:55:41 BST [MED.0050.0222T] Proxy Service DocuSignSendEnvelope received a new message from 10.80.14.119 Message To: /ws/DocuSignSendEnvelope/accounts/422624/envelopes SOAPAction: null WSA-Action: null
2018-06-05 08:55:41 BST [MED.0050.0223T] Content IDs: [] for SoapMessage: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=“http://www.w3.org/2003/05/soap-envelope”>soapenv:Body<tns:POST_envelopes xmlns:tns=“http://namespaces.DefaultOrganization.com/wsdl” /></soapenv:Body></soapenv:Envelope>
2018-06-05 08:55:41 BST [MED.0050.0217T] Executing insequence mediators for virtual service: DocuSignSendEnvelope
2018-06-05 08:55:41 BST [MED.0070.0077T] Content-Encoding in the request :null
2018-06-05 08:55:41 BST [MED.0070.0016T] Enforcing mediator cannot identify the request consumer, unable to make throttling decision for: service DocuSignSendEnvelope, policies
2018-06-05 08:55:41 BST [MED.0010.0193T] Trying to initialize logging resource for class: com.softwareag.pg.logging.PGLoggingResources
2018-06-05 08:55:41 BST [MED.0010.0195T] Mediator logger context initialized. ********************************
Logger factory Context
Base logger Name : IS
Log Directory Name:null
Event Source Type :WEBMETHODS
Logger Context
Component ID : MED
Sub Component ID : 0050
Resource Bundle : com.softwareag.pg.messages
Logger Factory
TOString : com.webmethods.sc.logging.log4j.WmLoggerFactory@1179bee7


2018-06-05 08:55:41 BST [MED.0010.0194T] Logging for class com.softwareag.pg.logging.PGLoggingResources is initialized with facility code 0050 logging factility: CORE_RUNTIME and bundle name: com.softwareag.pg.messages
2018-06-05 08:55:41 BST [MED.0030.9999T] No security headers found in incoming soap request
2018-06-05 08:55:41 BST [MED.0050.0248D] Address http method set to custom
2018-06-05 08:55:41 BST [MED.0050.0250W] Could not find user-specified value for HTTP method! Defaulting to inbound request HTTP method POST
2018-06-05 08:55:41 BST [MED.0050.0251D] Updated HTTP method to POST for outgoing request endpoint https://demo.docusign.net/restapi/v2/${sys:resource_path}
2018-06-05 08:55:41 BST [MED.0050.0278D] Setting read timeout of 30,000 ms for endpoint https://demo.docusign.net/restapi/v2/${sys:resource_path}
2018-06-05 08:55:41 BST [MED.0050.0277D] Setting connection timeout of 30,000 ms for endpoint https://demo.docusign.net/restapi/v2/${sys:resource_path}
2018-06-05 08:55:41 BST [MED.0050.0095D] Sending to endpoint address: https://demo.docusign.net/restapi/v2/${sys:resource_path}
2018-06-05 08:55:41 BST [MED.0050.No addressing headers added by ESB service; using new msg id: [urn:uuid:b1281944-e87c-4030-b5ce-a7ec909aa774]T] Message not found for messageKey No addressing headers added by ESB service; using new msg id: [urn:uuid:b1281944-e87c-4030-b5ce-a7ec909aa774]
2018-06-05 08:55:41 BST [MED.0050.0409T] Native Provider request-side serialization details for service call: DocuSignSendEnvelope, Content-Type Header: multipart/form-data; boundary=BOUNDARY, Accept Header: application/xml, Message Type: multipart/form-data, Builder Type: application/xml
2018-06-05 08:55:41 BST [MED.0050.0230D] Updating endpoint: https://demo.docusign.net/restapi/v2/${sys:resource_path}
2018-06-05 08:55:41 BST [MED.0050.0231D] Request url: /ws/DocuSignSendEnvelope/accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0652D] Updating Endpoint for the new REST model
2018-06-05 08:55:41 BST [MED.0050.0232D] original request url path upto operation: /ws/DocuSignSendEnvelope
2018-06-05 08:55:41 BST [MED.0050.0233D] calculated uncited path: accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0234D] updated endpoint url: https://demo.docusign.net/restapi/v2/accounts/422624/envelopes
2018-06-05 08:55:41 BST [MED.0050.0253D] Disabling soapAction for outgoing request to REST endpoint
2018-06-05 08:55:41 BST [MED.0050.0315D] Native Provider invocation details: Sending [add = false] [sec = false] [rm = false] [ mtom = false] [ swa = false] [ format = null] [ force soap11=false] [ force soap12=false] [ pox=false] [get=false] [encoding=null] [ to Address: https://demo.docusign.net/restapi/v2/accounts/422624/envelopes]
2018-06-05 08:55:41 BST [MED.0201.0037T] PgMen outgoing handler invoked for native service. service name: DocuSignSendEnvelope sessionId: 5326b830fb741c6097edffffffff2403
2018-06-05 08:55:41 BST [ISC.0064.0015T] Opening Socket https://demo.docusign.net/restapi/v2/accounts/422624/envelopes
2018-06-05 08:55:41 BST [ISC.0064.0021T] Successfully connected to host: demo.docusign.net port: 443
2018-06-05 08:55:41 BST [ISS.0142.0001D] Registered Lifecycle Listener 6872ecc6[TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: Socket[addr=demo.docusign.net/162.248.186.25,port=443,localport=61392]]
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> POST /restapi/v2/accounts/422624/envelopes HTTP/1.1
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> User-Agent: Java/1.8.0_171
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> Accept: application/xml
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> Host: demo.docusign.net
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> Content-Type: multipart/form-data; charset=UTF-8; boundary=MIMEBoundary_25d79dd25f95713ceaef7e2143de49c078e0d1eecad397b9
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> Connection: keep-alive
2018-06-05 08:55:41 BST [ISC.0038.0002D] --> Content-Length: 67
2018-06-05 08:55:42 BST [MED.0203.0079T] Cache ClusterStatusCache found CacheManager with cluster uuid , with status STATUS_ALIVE
2018-06-05 08:55:42 BST [MED.0203.0080T] Cache ClusterStatusCache found Ehcache with guid VGE-MKTRED-SMS1/10.80.0.156-f3bd6c26-aa81-4882-be19-089f67bb692d and status STATUS_ALIVE
2018-06-05 08:55:42 BST [MED.0203.0067T] ControllingNodeLocker.run, thread id(214), still holding the lock after a nap? (true)
2018-06-05 08:55:42 BST [ISC.0040.0001D] HTTP/1.1 400
2018-06-05 08:55:42 BST [ISC.0038.0002D] <-- Cache-Control: no-cache
2018-06-05 08:55:42 BST [ISC.0038.0002D] <-- Content-Length: 321
2018-06-05 08:55:42 BST [ISC.0038.0002D] <-- Content-Type: application/xml; charset=utf-8
2018-06-05 08:55:42 BST [ISC.0038.0002D] <-- X-DocuSign-TraceToken: 1c117c68-68bc-44c0-8966-dbe81e557b8c
2018-06-05 08:55:42 BST [ISC.0038.0002D] <-- Date: Tue, 05 Jun 2018 07:55:41 GMT
2018-06-05 08:55:42 BST [ISC.0038.0002D] <-- Strict-Transport-Security: max-age=31536000; includeSubDomains
2018-06-05 08:55:42 BST [ISS.0142.0002D] Unregistered Lifecycle Listener 6872ecc6[TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: Socket[addr=demo.docusign.net/162.248.186.25,port=443,localport=61392]] is true
2018-06-05 08:55:42 BST [MED.0050.0401D] Incoming response content-type is [application/xml; charset=utf-8]
2018-06-05 08:55:42 BST [MED.0050.0403D] Updated MESSAGE_TYPE to [application/xml]
2018-06-05 08:55:42 BST [MED.0050.0402D] Updated BUILDER_TYPE to [application/xml]
2018-06-05 08:55:42 BST [MED.0201.0036T] PgMen incoming event handler received a response from native service provider. service name: DocuSignSendEnvelope sessionId: 5326b830fb741c6097edffffffff2403
2018-06-05 08:55:42 BST [MED.0201.0012T] PgMen incoming handler invoked for native service. service name: DocuSignSendEnvelope sessionId: 5326b830fb741c6097edffffffff2403
2018-06-05 08:55:42 BST [MED.0050.0206T] Error returned from native service. Native service provider error. HTTP statusCode: 400
2018-06-05 08:55:42 BST [MED.0201.0009T] PgMen outgoing handler invoked for virtual service. service name: NONE sessionId: 5326b830fb741c6097edffffffff2403
2018-06-05 08:55:42 BST [MED.0050.0027E] Mediator outbound client encountered error:Native service provider error. HTTP statusCode: 400
2018-06-05 08:55:42 BST [MED.0050.0219T] Exception while processing inbound request mediator proxy receiver. Virtual service: DocuSignSendEnvelope, sie event for thread found? true FaultHandler to Run? true Cause: Mediator outbound client encountered error:org.apache.axis2.AxisFault: Native service provider error. HTTP statusCode: 400
2018-06-05 08:55:42 BST [MED.0050.0202T] Mediator fault handler processing exception for service: DocuSignSendEnvelope, Message: Mediator outbound client encountered error:org.apache.axis2.AxisFault: Native service provider error. HTTP statusCode: 400 , StackTrace: com.softwareag.pg.exceptions.PGException: Mediator outbound client encountered error:org.apache.axis2.AxisFault: Native service provider error. HTTP statusCode: 400
at com.softwareag.pg.axis2.PGAxis2Sender.sendOn(PGAxis2Sender.java:110)
at com.softwareag.pg.axis2.PGSynapseEnvironment.send(PGSynapseEnvironment.java:101)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:297)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
at com.softwareag.pg.config.endpoints.address.PGAddressEndpoint.send(PGAddressEndpoint.java:71)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:87)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at com.softwareag.pg.axis2.PGProxyMessageReceiver.receive(PGProxyMessageReceiver.java:168)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:152)
at org.apache.axis2.transport.http.util.RESTUtil.processXMLRequest(RESTUtil.java:97)
at org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:301)
at com.wm.app.b2b.server.wss.HTTPTransportListener.doService(HTTPTransportListener.java:250)
at com.wm.app.b2b.server.wss.HTTPTransportListener.process(HTTPTransportListener.java:136)
at com.wm.app.b2b.server.HTTPRootWebServicesHandler.process(HTTPRootWebServicesHandler.java:49)
at com.wm.app.b2b.server.HTTPDispatch.handleRequest(HTTPDispatch.java:170)
at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:362)
at com.wm.util.pool.PooledThread.run(PooledThread.java:127)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axis2.AxisFault: Native service provider error. HTTP statusCode: 400
at com.softwareag.pg.axis2.PGSynapseCallbackReceiver.handleMessage(PGSynapseCallbackReceiver.java:250)
at com.softwareag.pg.axis2.PGSynapseCallbackReceiver.receive(PGSynapseCallbackReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at com.softwareag.pg.axis2.PGAxisOperationClient.send(PGAxisOperationClient.java:420)
at com.softwareag.pg.axis2.PGAxisOperationClient.executeImpl(PGAxisOperationClient.java:227)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.softwareag.pg.axis2.PGAxis2FlexibleMEPClient.send(PGAxis2FlexibleMEPClient.java:397)
at com.softwareag.pg.axis2.PGAxis2Sender.sendOn(PGAxis2Sender.java:84)
… 19 more
Caused by: java.lang.Exception: Native service provider error. HTTP statusCode: 400
at com.softwareag.pg.axis2.PGSynapseCallbackReceiver.handleMessage(PGSynapseCallbackReceiver.java:223)

Hi,

Can you post this query in the Mediator forum - http://tech.forums.softwareag.com/techjforum/forums/show/207.page ?

Regards,
Karthik G