Layer7 API Management

 View Only

 Content-Transfer-Encoding changing to Binary from 8bit while using "Encode to MTOM Format" Assertion

Karan Nayak's profile image
Karan Nayak posted Jan 19, 2023 08:18 PM
Hello All, 

We have a service provider who is expecting the incoming requests in MTOM format. This is probably the first time we are setting up to send requests in mtom. 
While logging the incoming and outgoing requests to/out of the gateway, I am noticing that the Content-Transfer-Encoding header of the xml part is changing from 8bit to Binary. Hence the service provider is returning an HTTP 415 - Unsupported Media Type in the response. 

Hence I am turning myself here to check if someone else have encountered this behavior in their MTOM setup. 

For simplicity, I have kepy my policy simple : 

  • I send a request in MTOM from SOAP UI 
  • I audit Content-Transfer-Encoding before the message is decoded  :  ${}
  • I validate and decode it using "Validate MTOM Message" and "Decode to MTOM format" assertion respectively. 
  • I encode the message using "Encode to MTOM format" assertion. 
  • I again audit the Content-Transfer-Encoding which is now "Binary" 
  • I route the request to the service provider and receive HTTP 415. 
The notations I am using : 

Part 1 : XML part - 8bit
Part 2 : Attachement part  - Binary

Still I am not sure 100% if this is what is causing the 415 response. 

Thanks in advance!