Soap Message Validator for WSDL with multiple xsd files

Hi

I want to validate sopa request againest WSDL file that has 4 different xsd files. I have uploaded wsdl file to wsdl subfolder under scripts and xsd files to xsd subfolder, inside my proxy. My soap message validator conf is 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="http://service.net/scalcustomerorder/SVScalCustomerOrderService/v1">PublishCustomerOrderDataRequest</Element>
<SOAPMessage version="1.1/1.2"/>
<Source>request</Source>
<ResourceURL>wsdl://SVScalCustomerOrderService_1.wsdl</ResourceURL>
</MessageValidation>

I am able to save the proxy, but not able to deploy it. I am getting below error

Error Deploying Revision 1 to sandbox
MessageValidation SOAP-Message-Validation-1: Failed to compile resource SVScalCustomerOrderService_1.wsdl. Context Revision:1;APIProxy:soap-proxy;Organization:org;Environment:sandbox.

I am not able to find proper example or doc for how to validate soap message with wsdl that has multiple xsd files dependency

1 12 2,345
12 REPLIES 12

@bob: We ran into a similar issue. I think two ways you can work around this issue.

a) Instead of WSDL with XSD's you can come up with a single wsdl where everything is inside one WSDL and no references to XSD's inside.

b) Save WSDL locally and the XSD's, change XSD paths's inside the WSDL to reference path and upload all WSDL 's and XSD's using file option. I would just refer the path as "x1.xsd" and place them all at one level.

Hope that helps!

7928-capture1.jpg

7929-capture.jpg

I have all files at one level in my local folder, when I added SOAP Message Validator, I imported WSDL file and then I imported all related xsds to XSD folder separatly. I can't upload xsds to WSDL folder above as it is complaining that it is not a WSDL file.


@bob: how you have the xsd’s referred in WSDL ? Do you have the path as “xsd/commondata.xsd” if you have your xsd’s in separate folder ?

I have them referred as if they are in same folder, but could not find a way to import both WSDL and XSDs in same folder inside proxy and I could not find any documentation or example.

@ravi m -

how are you placing your wsdl and xsds inside your proxy? I will try changing path to xsd/commondata.xsd etc. But there should be a better way to manage these files not loosing references without any manual work.

@bob : This is what we did . Modified service little bit to generate a single WSDL that contains all xsd stuff inside. You can refer to this

https://weblogs.asp.net/pglavich/making-wcf-output-a-single-wsdl-file-for-interop-purposes

If that is not possible to get a single WSDL then you can go with other option of uploading WSDL and xsd, modify the WSDL manually to refer the XSD’s

I tried with ../xsd/CommonData.xsd path and /xsd/CommonData.xsd path for all imports, still same issue. Looks like single file WSDL is the only option now, these XSD files are huge, I will raise a case to see if there is a better option while I work on single file WSDL

It worked after I flattened the WSDL file. I raised a case as well to know if there is any other option

@bob: Glad to know it worked. Please let me know if you have an answer for the other option.

@Ravi M - Apigee confirmed single WSDL is the only option. They asked me to open enhancement request

Hi Everyone, I used this tool to flatten the WSDL.

https://github.com/pkielgithub/SchemaLightener

I also followed the SOAP Validation example on the docs page here: https://docs.apigee.com/api-platform/reference/policies/message-validation-policy#samples

I created the proxy based on the WSDL and created a "passthrough" proxy. This separated out the calls by operation. For each operation, I used a separate message validation policy for each operation

Repo is an Apigee Edge Proxy and Java Callout to validate a soap message against a wsdl file and a collection of XSD schema files with relative path references.

KVM is used as a persistency storage for wsdl and schema. JSON structure describes mapping between KVM entries and logical folder tree structure that contains schema files references in schemaLocation attribute.

https://github.com/yuriylesyuk/edge-soap-validate