wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
742 stars 720 forks source link

SOAP service crashes when updating the IdentitySAMLSSOConfigService wsld file #16227

Open hwupathum opened 1 year ago

hwupathum commented 1 year ago

Describe the issue

When the wsdl file and the stub for the IdentitySAMLSSOConfigService soap service are modified, a 500 error is returned when attempting to call the soap service via the management console. Following is the stack trace shown in the terminal

[2023-07-07 15:40:35,188] [c9aec29f-71ec-499b-a392-597cd9920dc7] ERROR {org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[bridgeservlet]} - Servlet.service() for servlet [bridgeservlet] in context with path [/] threw exception [javax.servlet.ServletException: java.lang.StackOverflowError] with root cause java.lang.StackOverflowError
    at java.base/java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:73)
    at jdk.internal.reflect.GeneratedConstructorAccessor295.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at java.base/java.lang.Class.newInstance(Class.java:584)
    at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:42)
    at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:446)
    at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:492)
    at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:492)
    at org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:492)
    ...

How to reproduce

  1. Add the following config to the deployment toml of IS pack
    [admin_service.wsdl]  
    enable= true
  2. Goto https://localhost:9443/services/IdentitySAMLSSOConfigService?wsdl url and download the wsdl file
  3. Replace the https://github.com/wso2-extensions/identity-inbound-auth-saml/blob/master/components/org.wso2.carbon.identity.sso.saml.stub/src/main/resources/IdentitySAMLSSOConfigService.wsdl file
  4. Build the org.wso2.carbon.identity.sso.saml.stub component and patch the IS pack and restart
  5. Goto management console, create a service provider. Goto Inbound Authentication Configuration and try to create a SAML2 SSO config
  6. The management console shows a 500 error

Related PRs

hwupathum commented 1 year ago

When the following lines are commented in the wsdl file, the error does not heppen

<xs:complexType name="SAMLSSOServiceProviderDTO">
<!--  <xs:complexContent>-->
<!--  <xs:extension base="ax2381:InboundConfigurationProtocol">-->
             <xs:sequence>
                 <xs:element minOccurs="0" name="assertionConsumerUrl" nillable="true" type="xs:string"/>
                 <xs:element maxOccurs="unbounded" minOccurs="0" name="assertionConsumerUrls" nillable="true" type="xs:string"/>
                 ....
                 <xs:element minOccurs="0" name="supportedAssertionQueryRequestTypes" nillable="true" type="xs:string"/>
             </xs:sequence>
<!--   </xs:extension>-->
<!--   </xs:complexContent>-->
</xs:complexType>