1 Reply Latest reply on Apr 8, 2010 1:29 PM by Amit Srivastava

    org.jboss.ws.WSException --> org.jboss.ws.core.jaxrpc.binding.jbossxb.UnmarshalException: Failed to parse source

    Amit Srivastava Newbie

      Hi,

       

      I'm using JBoss 5.1.0.GA for the Web Service deployment. Please find attached the relevant code snippets in "Code snippets.txt".

       

      Refer to the "Client code" section # 2 in the attached code snippet. The call seems to be failing some time after the Web Service method returns at the following line:

       

      System.out.println("Making the dynamic invocation of the Web Service method now...");
      HelloResponseVO responseVO = (HelloResponseVO)call.invoke(params);

      I'm getting the following exception when invoking the WebService method from the client:

       

      Note: The problem seems to be only when the return type from the Web Service method is a complex type data (a POJO)Things are working fine when I use the primitive data types instead of POJOs.

       

      Messages at client-side:

       

           [java] Making the dynamic invocation of the Web Service method now...
           [java] java.rmi.RemoteException: Call invocation failed; nested exception is:
           [java]  org.jboss.ws.WSException: org.jboss.ws.core.binding.BindingException: org.jboss.ws.core.jaxrpc.binding.jbossxb.UnmarshalException: Failed to parse source: fullGreetingMessage cannot appear in this position. Expected content of return is sequence: fullGreetingMessage? greetingMessage? name?
           [java]  at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:535)
           [java]  at org.jboss.ws.core.jaxrpc.client.CallImpl.invoke(CallImpl.java:275)
           [java]  at webservices.testclient.TestClientStubbedWS.callUsingJAX_RPC(Unknown Source)
           [java]  at webservices.testclient.TestClientStubbedWS.main(Unknown Source)
           [java] Caused by: org.jboss.ws.WSException: org.jboss.ws.core.binding.BindingException: org.jboss.ws.core.jaxrpc.binding.jbossxb.UnmarshalException: Failed to parse source: fullGreetingMessage cannot appear in this position. Expected content of return is sequence: fullGreetingMessage? greetingMessage? name?
           [java]  at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:249)
           [java]  at org.jboss.ws.core.soap.XMLContent.transitionTo(XMLContent.java:96)
           [java]  at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentElement.java:140)
           [java]  at org.jboss.ws.core.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:172)
           [java]  at org.jboss.ws.core.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:261)
           [java]  at org.jboss.ws.core.EndpointInvocation.getReturnValue(EndpointInvocation.java:195)
           [java]  at org.jboss.ws.core.CommonClient.syncOutputParams(CommonClient.java:511)
           [java]  at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:397)
           [java]  at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:516)
           [java]  ... 3 more

       

      Messages on the server console:

       

      13:32:04,291 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=Stubbed_WS,endpoint=HelloWS
      13:32:04,447 INFO  [TomcatDeployment] deploy, ctxPath=/Stubbed_WS
      13:32:05,166 INFO  [WSDLFilePublisher] WSDL published to: file:/D:/Amit/JBoss/server/standard/data/wsdl/Stubbed_WS.war/HelloWS.wsdl
      13:32:05,275 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
      13:32:05,291 WARNING [config] Unable to process deployment descriptor for context '/jmx-console'
      13:32:05,291 INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/jmx-console'
      13:32:05,338 INFO  [TomcatDeployment] deploy, ctxPath=/root
      13:32:05,354 WARNING [config] Unable to process deployment descriptor for context '/root'
      13:32:05,354 INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/root'
      13:32:05,385 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
      13:32:05,400 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
      13:32:05,400 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 24s:578ms
      13:32:33,963 INFO  [STDOUT] Inside HelloWS.getDetailedHelloMessage()
      13:32:33,963 INFO  [STDOUT] Sending the following message to client : Hello Maganwaa !!!
      13:32:33,963 INFO  [STDOUT] Exiting HelloWS.getDetailedHelloMessage()

       

      I have even tried by changing the modifiers in the HelloWS.wsdl as follows, but without any luck..

       

      From:

       

      <xs:complexType name='helloResponseVO'>
          <xs:sequence>
           <xs:element minOccurs='0' name='name' type='xs:string'/>
           <xs:element minOccurs='0' name='fullGreetingMessage' type='xs:string'/>
           <xs:element minOccurs='0' name='greetingMessage' type='xs:string'/>
          </xs:sequence>
         </xs:complexType>

       

      To:

       

      <xs:complexType name='helloResponseVO'>
          <xs:all>
           <xs:element minOccurs='0' name='name' type='xs:string'/>
           <xs:element minOccurs='0' name='fullGreetingMessage' type='xs:string'/>
           <xs:element minOccurs='0' name='greetingMessage' type='xs:string'/>
          </xs:all>
         </xs:complexType>

       

      Any help in this regards will be highly appreciated.

       

      Thanks in advance...

       

      Amit Srivastava