cancel
Showing results for 
Search instead for 
Did you mean: 

CPI Soap Error: PayLoad elements cannot fit with the message parts of the BindingOperation

I'm getting an error running a simple iflow to perform a SOAP call using a Timer, Content Modifier, and Request/Response:

java.lang.IllegalArgumentException: The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.

This error seems to be saying thay that CPI is validating the XML payload and the validation is failing before it calls the web service. I see this problem has been posted several times and several answers given and I've tried many solutions but none have corrected the problem for me.

I successfully used SOAPUI to call the same webservice method and it worked and returned a token:

When creating the iFlow I uploaded the WSDL as a resource, and in the SOAP channel I selected the LOGIN operation and SAP auto-populated the channel operation and added the namespace to the Runtime Configuration:

The SOAP connection:

I traced the payload sent to the webservice and it looked ok:

This is the error as it appeared in the log:

The WSDL is located here:

https://test.c3reservations.com/BreakthruBev-WS/PurchaseOrderWebService?wsdl

Can anyone see what I need to change to make this work?

Thanks in advance!!!

Accepted Solutions (0)

Answers (3)

Answers (3)

I overcame the validation error by blanking out these four fields in the SOAP channel configuration:

0 Kudos

Hi, when I try to blank Service, Endpoint, OperationName and URL to WSDL...I receive an error:
org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused by: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "ws"

at [row,col {unknown-source}]: [1,17]., cause: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "ws"
at [row,col {unknown-source}]: [1,17]

This is my WSDL (http://maurelli.catalistino.it/ws_catalistino2.php), please, can you help me ?

I've found the problem. In the SOAP connection screen, if the WSDL field is filled in, the SOAP channel tries to find a complex type in the WSDL for that operation in order to validate the tags in the payload. Eg in this case I was calling the LOGIN operation, so it was looking for a complex type (it would have the tag <xs:complexType> in the WSDL) bound to the login operation, but there wasn't any, so the validation fails, and SAP issues this message "PayLoad elements cannot fit with the message parts of the BindingOperation" meaning SAP can't validate the tags in the payload.

So for me there were two possible solutions:

Solution 1: add the missing complex type to the WSDL and then populate the WSDL, Service, Endpoint and Operation Name fields. If you populate them this permits you to configure specific web service security policies for that operation. Or,

Solution 2: leave the WSDL, Service, Endpoint and Operation Name fields blank if you don't need to create a specific security policy on this operation, and CPI won't attempt to validate the tags in the payload and will just pass it to the web service.

This article was very helpful in figuring this out:

https://blogs.sap.com/2018/06/28/cloud-integration-usage-of-wsdls-in-the-soap-adapter/

0 Kudos

Hi, Ken! I need your help. I am facing the same issue but cannot find any workaround. Would you please care to help me?

0 Kudos

Hi Ken,

I have the same issue. I tried your solution 2 and removed content in WSDL, Service, Endpoint and Operation Name. But seems the namespace p1 is not valid anymore. The error message is:

org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused by: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "p1"

at [row,col {unknown-source}]: [1,53]., cause: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "p1"

Did you have the same issue before? Thanks!

Sriprasadsbhat
Active Contributor

Hello Ken,

Create a message mapping just before making call to your SOAP Service having target structure as target systems WSDL to make sure all the required namespaces are sent then it should resolve your issue

Regards,

Sriprasad Shivaram Bhat

0 Kudos

Thanks Sriprasad. I attempted this but when creating the mapping in CPI the list of structures from the WSDL does not list the login message so it seems I cannot map it using the Create message mapping function. Could this be a problem with the WSDL? The WSDL is attached.

The WSDL is located here:

https://test.c3reservations.com/BreakthruBev-WS/PurchaseOrderWebService?wsdl