When attaching SOAP Message Validation in API proxy, am getting error while adding .xsd file to soap message validation policy
1. When creating policy, if I select file type as "XSD" and Script file as "Create new script", am getting error message "Script has no source, it should be a new one, an imported one or an existing one."
Hi, thanks for reporting this. Can you attach a screenshot for each of these two errors?
Hi , This is the screenshot of the following error
Hi,
Can you confirm which version of Apigee you are on? I gave this a try on Apigee X using the GCP Console based UI and the behavior works as expected. However, the screen shot looks like one of the older user experiences.
Hi @ark123 , @malashree ,
I was able to recreated the issue in an Apigee Edge SaaS organization. Is that the version of Apigee you are using? I will log this as a bug internally for our team to address. I'd also suggest log a support ticket so you can be kept up to date on this.
On a positive note I did find a workaround (detailed below) so you don't have to wait on a fix to be deployed.
See below for an example proxy I have working using this workaround for reference. The proxy follows this example.
MessageValidation policy:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageValidation continueOnError="false" enabled="true" name="MV-Message-Validator">
<DisplayName>MV-Message-Validator</DisplayName>
<Properties/>
<Source>request</Source>
<ResourceURL>xsd://note-schema.xsd</ResourceURL>
</MessageValidation>
Schema (note-schema.xsd):
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Default.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<PreFlow name="PreFlow">
<Request>
<Step>
<Name>MV-Message-Validator</Name>
</Step>
</Request>
<Response/>
</PreFlow>
<Flows/>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<HTTPProxyConnection>
<BasePath>/message-validation-test</BasePath>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="noroute"/>
</ProxyEndpoint>
Conforming Request:
<note>
<to>Fred Rogers</to>
<from>Nick Danger</from>
<heading>Greetings from my neighborhood</heading>
<body>Just writing to say hello.</body>
</note>
Non-Conforming Request:
<note>
<to>Fred Rogers</to>
<from>Nick Danger</from>
<heading>Greetings from my neighborhood</heading>
<body>Just writing to say hello.</body>
<new>element</new>
</note>
Positive Test:
curl -X POST --header "Content-Type:text/xml;charset=UTF-8" --data @request.xml https://my-test.apigee.net/message-validation-test
Negative Test:
curl -X POST --header "Content-Type:text/xml;charset=UTF-8" --data @bad-request.xml https://my-test.apigee.net/message-validation-test
Alright Thanks !