How to check for WS-I compliance for WSDL files to be imported as custom connectors for Logic App
When creating a custom connector using WSDL files, you may face an error stating -
'The validation of the WSDL document failed’. This might mean that the WSDL file is not WS-I compliant.
On elaborating the error message, you may notice that certain child elements are invalid are not included in the list of possible expected elements.
'The element '…' in namespace 'http://schemas.xmlsoap.org/wsdl/' has invalid child element '…' in namespace 'http://schemas.xmlsoap.org/ws/2004/09/policy'.
List of possible elements expected: 'documentation, operation' in namespace 'http://schemas.xmlsoap.org/wsdl/'.'. '.'. Status code: 'BadRequest'.
Custom connectors for Logic app are based on API Management Service, thus, if you try uploading the WSDL file into APIM, you should get the same error.
Currently there is no method the skip WS-I compliance validation check in APIM for WSDL files, thus, the WSDL file must be WS-I compliant.
Providing steps on how to perform the WS-I compliance check on WSDL file -
What we need for this:
- soapUI, you may download the latest version from the official homepage: http://www.soapui.org/
soapUI is a tool for Web Service Testing. soapUI is Free and Open Source and is used for Inspecting Web Services, Invoking Web Services, Developing Web Services, Web Service Simulation and Web Service Mocking and Functional Testing of Web Services Load Testing of Web Services over HTTP.
- soapUI includes integrated support for the WS-I organizations Basic Profile validation tools for 2 situations:
Validating WSDL definitions - from the Interface Menu with the "Check WSI Compliance" option. This will run the WS-I Test Tools and validate the WSDL definition accordingly.
Validating SOAP request/response messages - from within the Request Editors response popup with the "Check WSI Compliance" option (as described under Message Validation).
If you are not using the latest SoapUI version, then you might first need to download either the Java™ or C# version (soapUI will use whichever is available) of the WS-I Interoperability Testing Tools 1.1 from the WS-I deliverables page. Once you download it unzip the file into a local directory and specify the contained "wsi test tools" directory in the soapUI together with the desired settings.
For example, if you have downloaded wsi-tools from the above link and extracted it to root of drive d: then you should go to File -> Preferences -> WS-I settings and in the Tool Location field enter: d:\wsi-test-tools
Additionally, you will need to set an environment variable for WSI_HOME to be wherever you extracted the wsi-test-tools directory.
How to test:
- Start soapUI, click on File -> New WSDL Project, specify the Project name and your initial WSDL that you would like to test, click OK.
- It will appear in the left side frame, expand your project, so, you can see your WSDL, then right click on the WSDL and click on "Check WS-I compliance".
- You will get a generated report with the detailed summary. Also, it can be useful to save it to an HTML file, so, support can review it as well.
Once you have made sure the WSDL file is WS-I compliant, please check for the restriction document mentioned below.
Here is the restriction document according to which the WSDL file should comply - Restrictions and details of API formats support - Azure API Management | Microsoft Docs
After ensuring the WSDL file is WS-I compliant and going through the restriction document, try to import the WSDL file again for the custom connector and the APIM service.