I have a WSDL file in an online URL. This file contains references to xsd schemas that have http in their URLs. But the actual files lie under the https protocol, so following the http link redirects to the https page. But the XML validation method does not follow the redirect and gives an error trying to read the redirection page as an XML.
I cannot change the WSDL.
Operating System
Windows 10
Katalon Studio version
Standalone version 8.5.5
Steps to reproduce
Create a SOAP request based on an XML schema
Create a verification script that will validate the server response (or any xml) against a schema. The WSDL schema should contain XSD imports with links that will redirect to a different page
Expected Behavior
XML validator follows redirects from WSDL links. The server response is validated against the given schema
Actual Behavior
Fatal error: The element type “hr” must be terminated by the matching end-tag “”. That is because the requested URL to XSD gives a response like this (redirects not followed)
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center>
<h1>301 Moved Permanently</h1>
</center>
<hr>
<center>nginx</center>
</body>
</html>
By the way, there’s a “Follow redirects” option in the request configuration, but i believe it’s reserved only for the request object itself. It doesn’t help in this situation.
Fatal error: The element type “hr” must be terminated …
This is not the real issue. WSResponseManager is not capable to do anything meaningful for a HTML document.
The real issue is that Katalon is not doing “follow redirects” for you. So you should try to find how to let Katalon do “follow redirects”.
You should be able to create a SOAP request with com.kms.katalon.core.testobject.RequestObject.setFollowRedirect( true ) and setRedirectTimes( some integer larger than 0), shouldn’t you?
If you set the RequestObject with “follow redirects” option enabled, Katalon Studio may perform “follow redirects” when it received a reply “HTTP status=301 Moved Permanent”. (I have never tried it so i am not sure)
If Katalon Studio performs following redirects, eventually SOAP service would reply a valid XML SOAP response; then WSResponseManager would have a chance to validate the XML document. If Katalon Studio does not perform following redirects, no valid XML document would be passed to WSResponseManager.
testobject.RequestObject.setFollowRedirect doesn’t have a setFollowRedirect method or i misunderstand something. And judging from the method name it returns void, not a request object. So it would be a method to set a redirect parameter, not an object.
I tried creating a test object with findTestObject(‘ObjectName’), but it doesn’t have any redirect setting methods either.
Well, i did find a workaround by downloading the WSDL and changing the XSD links inside it (trying to refer to them locally doesn’t work either). And schema validation is optional in my case.
I would like to use Katalon since it makes test organization fairly easy. Something like Postman is not so great for that as every request in it is separate and can’t really be reused. And, uhh, SoapUI interface is pretty horrible.
But it does seem like i’ll have to deal with more issues in the future…