cancel
Showing results for 
Search instead for 
Did you mean: 

XML Validation of Required Fields of Web service in SOAP Sender - SAP PI 7.5

smkangethe
Participant
0 Kudos

Is there any way we can validate the XML fields of a SOAP Web service so that the client gets an error message if for example a mandatory field does not contain data and preferably processing is stopped unless they rectify the data?

Currently such messages are failing in PI if this happens but the client still gets a 200 OK. This is an asynchronous scenario so there is no way of validating in backend.

We are on PI 7.5 SP19

Accepted Solutions (1)

Accepted Solutions (1)

smkangethe
Participant
0 Kudos

Thanks guys. In addition to setting the staging options and Schema Validation option in the ICO, I also had to enforce in the DT (in ESR) the minLength option. Previously I had only specified the Occurence as 1 but this seems not to be respected unless the XML tag being validated is completely missing from the payload. See screenshot.

So now everything is working. Thanks a lot for the contributions.

Answers (3)

Answers (3)

Muniyappan
Active Contributor
0 Kudos

If the messaging is EO, then I guess it will not work. When you send data to soap sender adapter, you get 200/201 status as soon as message reaches pi. It does not matter if the message fails or succeeds. This is called decoupling.

Having said that, you can give a try to this note .I am not sure if this will work for EO. 2769880 - No Fault Response Back From SOAP Sender

0 Kudos

Hi!

XML validation works fine for asynchronous EO scenarios.

Regards, Evgeniy.

Muniyappan
Active Contributor
0 Kudos

in ICO, in inbound processing, you will have schema validation. Just enable validation by adapter. Then ico will validate the xml against Message type/External defintion.

smkangethe
Participant
0 Kudos

Hi Muniyappan,

Thanks but changing this seems to have no effect. The message was still sent and failed in PI and I got a 200 OK in SoapUI.

0 Kudos

Hi!

Turn off message staging on BI and VI steps.

Regards, Evgeniy.

smkangethe
Participant
0 Kudos

Hi Evgeniy,

Thanks, I turned both staging options off but the message still goes through and fails in PI. See attached screenshots.

0 Kudos

Hi Stephen!

What kind of error do you get?

Just for case, set staging options to MS=3 only.

Regards, Evgeniy.