Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8834

"Operation [{.../wsdl}Issue] already exists" when calling JaxWsServerFactoryBean.create() for SecurityTokenService

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.0, 3.5.7, 3.6.2
    • 3.5.8, 3.6.3, 4.0.4
    • STS
    • None
    • Unknown

    Description

      In quarkus-cxf, we are executing the following snippet

      JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean();
      factoryBean.setServiceClass(Thread.currentThread().getContextClassLoader().loadClass(sei));
      factoryBean.setAddress(path);
      Server server = factoryBean.create();
      

      for all service interfaces available in the class path of an application. We do it at build time, for the sake of generating all necessary ancillary classes.

      When doing this for org.apache.cxf.ws.security.sts.provider.SecurityTokenService, the following exception is thrown:

      java.lang.IllegalArgumentException: An operation with name [{http://docs.oasis-open.org/ws-sx/ws-trust/200512/wsdl}Issue] already exists in this service
              at org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:78)
              at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:1008)
              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.createOperation(JaxWsServiceFactoryBean.java:631)
              at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:1000)
              at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:460)
              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:693)
              at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:529)
              at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
              at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
              at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
              at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)
              at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:210)
              at io.quarkiverse.cxf.deployment.CxfDeploymentUtils.createServer(CxfDeploymentUtils.java:42)
              at io.quarkiverse.cxf.deployment.QuarkusCxfProcessor.lambda$generateClasses$2(QuarkusCxfProcessor.java:213)
      ...
      

      This is caused by the fact that there are two methods annotated with @WebMethod(operationName = "Issue") in org.apache.cxf.ws.security.sts.provider.SecurityTokenService:

          @WebResult(name = "RequestSecurityTokenResponseCollection",
                     targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
                     partName = "responseCollection")
          @Action(input = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue",
                  output = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal")
          @WebMethod(operationName = "Issue")
          RequestSecurityTokenResponseCollectionType issue(
              @WebParam(partName = "request",
                        name = "RequestSecurityToken",
                        targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
              RequestSecurityTokenType request
          );
      
          @WebResult(name = "RequestSecurityTokenResponse",
                    targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512",
                    partName = "response")
          @Action(input = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue",
                  output = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal")
          @WebMethod(operationName = "Issue")
          RequestSecurityTokenResponseType issueSingle(
              @WebParam(partName = "request",
                        name = "RequestSecurityToken",
                        targetNamespace = "http://docs.oasis-open.org/ws-sx/ws-trust/200512")
              RequestSecurityTokenType request
          );
      

      I wonder whether one of the operationNames in SecurityTokenService needs to be changed?

      Attachments

        Issue Links

          Activity

            People

              reta Andriy Redko
              ppalaga Peter Palaga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: