SOAP Message Validation How it really validates:

Using “SOAP Message Validation” with no Target Proxy for mocking a request. Using Apigee Cloud

My requirement is

1. POST method should validate the input message with respect to WSDL.

2. Once validation done based on SOAP message if SOAP method is “getDetails” returns response XML1

3. If SOAP Method is anotherDetails return response XML 2

My SOAP Message Validation policy looks like below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<MessageValidation async="false" continueOnError="false" enabled="true" name="SOAP-Message-Validation-1">

<DisplayName>SOAP Message Validation-1</DisplayName>

<Properties/>

<Element namespace="https://my.mynamespace.com/">getDetails</Element>

<SOAPMessage/>

<Source>request</Source>

<ResourceURL>wsdl://ReferMyLocal-1.wsdl</ResourceURL>

</MessageValidation>

Note:

I have added SOAP Message validation with following steps for policy

Selected followed steps for creating SOAP Message Validation Policy with indicated steps

Filteype : WSDL

Script File : Import new Script

File: Browsed the WSDL file (named ReferMyLocal-1.wsdl)

This automatically created “ReferMyLocal-1.wsdl” under wsdl folder of edge

I saved my proxy goes without error and deployed to test environment

I am Sending the following request (POST request to SOAP using API Console

<?xml version="1.0" encoding="utf-8"?>

<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

<soapenv:Header>

<AuthSOAPHeader xmlns="https://my.mynamespace.com/">

</AuthSOAPHeader>

</soapenv:Header>

<soapenv:Body>

< getDetails xmlns="https://my.mynamespace.com/">

  <gref>string</gref>

</getDetails>

</soapenv:Body>

</soapenv:Envelope>

Would like to know how this SOAP validation really works.

Even If I change getDetails to getDe then also get 200 response

Even if I change the name space truncate the https://my.mynamespace.com/">

Still it gives me 200 response.Let me know if I am missing anything where really SOAP validation will fail indicateing expected error???

Solved Solved
0 2 1,696
1 ACCEPTED SOLUTION

Not applicable

@Abiram, While sending a post request via API console, can you check what the Content-type header value?

It should be application/xml, for soap message validation policy to work.

Also Can you send us the soap request and the policy configuration in a proper formatted way? The above one are not properly formatted (for example : Envelope element is not closed properly in the request which you sent above).

View solution in original post

2 REPLIES 2

Not applicable

@Abiram, While sending a post request via API console, can you check what the Content-type header value?

It should be application/xml, for soap message validation policy to work.

Also Can you send us the soap request and the policy configuration in a proper formatted way? The above one are not properly formatted (for example : Envelope element is not closed properly in the request which you sent above).

Thanks for reply @ Raunak.

This being NoTarget API for SOAP messages observed that validation does not happen I modify the SOAP Header namespace.. it just validates the namespace for element name namespace. Is there anyways to invoke such audits ? using SOAP Message Validator ?

Also is there any ways to add in Apigee Documentation about indicating the Content-type and application/xml , which riggers the policy to work...

I would like to best practices towards such design implementations for SOAP Messages with No Target for mocking

Currently all the messages undergoes initial SOAP Message Validation for each POST methods.Once validation succeeds the flow undergoes AssignMessage which aids on response adn creating the response object from calling the script (in response flow).for NoTarget Mock to respond.

For each SOAP request then I need each API Proxy to Mock, meaning if I have 10 API then require 10 Mock proxy may need to be created, correct ?

For each Mock proxy if I have multiple POST methods then I need to have that many SOAP Message validations and Mocking scripts based per elements correct ?

Is there any automatons recommendations for such Mocking SOAP API both in terms of automation or best practices for mocking... Let me know.towards Mocking practices in addition to validating the incoming Header value to non null or to valid information...