3 Replies Latest reply on Jul 11, 2011 6:08 AM by Revathy Kuberan

    problem with @WebParam header

    simon bohdanowicz Newbie

      I've found wierd problem. To show it I've produced example wsdl:

       

      <definitions name="KodMorsaTlumacz" targetNamespace="http://www.example.org/"
          xmlns="http://schemas.xmlsoap.org/wsdl/"
          xmlns:tns="http://www.example.org/"
          xmlns:ns1="http://www.example.org/schema/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
          <types xmlns:xs="http://www.w3.org/2001/XMLSchema">
              <xs:schema targetNamespace="http://www.example.org/schema/" version="1.0">
                  <xs:element name="morse2Txt" type="xs:string" />
                  <xs:element name="txt2Morse" type="xs:string" />
                  <xs:element name="morse2TxtRsp" type="xs:string" />
                  <xs:element name="txt2MorseRsp" type="xs:string" />
                  <xs:element name="exampleHeader" type="xs:string" />
              </xs:schema>
          </types>
          <message name="morse2TxtRequest">
              <part element="ns1:morse2Txt" name="morse2Txt" />
              <part name="exampleHeader" element="ns1:exampleHeader" />
          </message>
          <message name="txt2MorseResponse">
              <part element="ns1:txt2MorseRsp" name="txt2morsersp" />
          </message>
          <message name="txt2MorseRequest">
              <part element="ns1:txt2Morse" name="txt2Morse" />
              <part name="exampleHeader" element="ns1:exampleHeader" />
          </message>
          <message name="morse2TxtResponse">
              <part element="ns1:morse2TxtRsp" name="morse2txtrsp" />
          </message>
          <portType name="MorseCode">
              <operation name="morse2Txt" parameterOrder="morse2Txt">
                  <input message="tns:morse2TxtRequest" />
                  <output message="tns:morse2TxtResponse" />
              </operation>
              <operation name="txt2Morse" parameterOrder="txt2Morse">
                  <input message="tns:txt2MorseRequest" />
                  <output message="tns:txt2MorseResponse" />
              </operation>
          </portType>
          <binding name="MorseCodeBinding" type="tns:MorseCode">
              <soap:binding style="document"
                  transport="http://schemas.xmlsoap.org/soap/http" />
              <operation name="morse2Txt">
                  <soap:operation soapAction="morse2Txt" />
                  <input>
                      <soap:body parts="morse2Txt" use="literal" />
                      <soap:header message="tns:morse2TxtRequest" part="exampleHeader"
                          use="literal" />
                  </input>
                  <output>
                      <soap:body use="literal" />
                  </output>
              </operation>
              <operation name="txt2Morse">
                  <soap:operation soapAction="txt2Morse" />
                  <input>
                      <soap:body parts="txt2Morse" use="literal" />
                      <soap:header message="tns:txt2MorseRequest" part="exampleHeader"
                          use="literal" />
                  </input>
                  <output>
                      <soap:body use="literal" />
                  </output>
              </operation>
          </binding>
          <service name="MorseCodeTranslator">
              <port binding="tns:MorseCodeBinding" name="MorseCodePort">
                  <soap:address location="http://localhost:8080/KodMorsa/MorseCode" />
              </port>
          </service>
      </definitions>

       

      I'm running wsconsume with it and I'm getting all the source files correctly, service interface looks like this:

       

      package org.example;

       

      import javax.jws.WebMethod;
      import javax.jws.WebParam;
      import javax.jws.WebResult;
      import javax.jws.WebService;
      import javax.jws.soap.SOAPBinding;
      import javax.xml.bind.annotation.XmlSeeAlso;
      import org.example.schema.ObjectFactory;

       


      /**
      * This class was generated by the JAX-WS RI.
      * JAX-WS RI 2.1.3-b02-
      * Generated source version: 2.1
      *
      */
      @WebService(name = "MorseCode", targetNamespace = "http://www.example.org/")
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
      @XmlSeeAlso({
          ObjectFactory.class
      })
      public interface MorseCode {

       


          /**
           *
           * @param morse2Txt
           * @param exampleHeader
           * @return
           *     returns java.lang.String
           */
          @WebMethod(action = "morse2Txt")
          @WebResult(name = "morse2TxtRsp", targetNamespace = "http://www.example.org/schema/", partName = "morse2txtrsp")
          public String morse2Txt(
              @WebParam(name = "morse2Txt", targetNamespace = "http://www.example.org/schema/", partName = "morse2Txt")
              String morse2Txt,
              @WebParam(name = "exampleHeader", targetNamespace = "http://www.example.org/schema/", header = true, partName = "exampleHeader")
              String exampleHeader);

       

          /**
           *
           * @param txt2Morse
           * @param exampleHeader
           * @return
           *     returns java.lang.String
           */
          @WebMethod(action = "txt2Morse")
          @WebResult(name = "txt2MorseRsp", targetNamespace = "http://www.example.org/schema/", partName = "txt2morsersp")
          public String txt2Morse(
              @WebParam(name = "txt2Morse", targetNamespace = "http://www.example.org/schema/", partName = "txt2Morse")
              String txt2Morse,
              @WebParam(name = "exampleHeader", targetNamespace = "http://www.example.org/schema/", header = true, partName = "exampleHeader")
              String exampleHeader);

       

      }

       

      But when I'm trying to deploy it on the server(JBoss 5.1 AS) I'm getting exceptions:

       

      14:09:37,531 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/apps/jboss-5.1.0.GA/server/default/deploy/KodMorsaTopDown2.war/ state=PreReal mode=Manual requiredState=Real

      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/apps/jboss-5.1.0.GA/server/default/deploy/KodMorsaTopDown2.war/

          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:619)

      Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException: faultCode=INVALID_WSDL: Could not determine element name from header: {http://example.org/}MorseCode_morse2Txt->exampleHeader

          at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)

          at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:293)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:174)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:50)

          at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:61)

          at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.start(UnifiedMetaDataDeploymentAspect.java:64)

          at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:129)

          at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:76)

          at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:60)

          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

          ... 24 more

      Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=INVALID_WSDL: Could not determine element name from header: {http://example.org/}MorseCode_morse2Txt->exampleHeader

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processBindingReference(WSDL11Reader.java:1520)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processBindingInput(WSDL11Reader.java:1433)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processBindingOperation(WSDL11Reader.java:1384)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processBindingOperations(WSDL11Reader.java:1344)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processBinding(WSDL11Reader.java:1173)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processPort(WSDL11Reader.java:1681)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processPorts(WSDL11Reader.java:1666)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processServices(WSDL11Reader.java:1636)

          at org.jboss.ws.tools.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:182)

          at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:129)

          ... 34 more

      14:09:37,531 WARN  [HDScanner] Failed to process changes

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      *** DEPLOYMENTS IN ERROR: Name -> Error

       

      vfsfile:/C:/apps/jboss-5.1.0.GA/server/default/deploy/KodMorsaTopDown2.war/ -> org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/apps/jboss-5.1.0.GA/server/default/deploy/KodMorsaTopDown2.war/

       

       

      DEPLOYMENTS IN ERROR:

       

        Deployment "vfsfile:/C:/apps/jboss-5.1.0.GA/server/default/deploy/KodMorsaTopDown2.war/" is in error due to the following reason(s): javax.wsdl.WSDLException: WSDLException: faultCode=INVALID_WSDL: Could not determine element name from header: {http://example.org/}MorseCode_morse2Txt->exampleHeader

       

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:619)

       

      Especially interesting is this part:

      faultCode=INVALID_WSDL: Could not determine element name from header: {http://example.org/}MorseCode_morse2Txt->exampleHeader

       

      I was playing with it for a while and I've discovered that when I change:


      @WebService(name = "MorseCode", targetNamespace = "http://www.example.org/")

       

      to

       

      @WebService(name = "MorseCode", targetNamespace = "http://example.org/") (target namespace after http:// have to be the same as name of the java package)

       

      it can be deployed.

       

      Any ideas about this strange bug ?? Should I post it as an issue in the official bug track?

      All hints will be appreciated.

       

      Thanks in advance,

      Simon