4 Replies Latest reply on Jun 30, 2006 8:02 PM by Alejandro Guizar

    How to reference elements in a sequence within a complexType

    Jiehuan Li Newbie

      I am using the following schema:

      <schema targetNamespace="com:vizuri:bpel:svc" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="com:vizuri:bpel:svc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <complexType name="EnrollmentMessageType">
       <sequence>
       <element name="addressLine1" nillable="true" type="string" />
       <element name="city" nillable="true" type="string" />
       <element name="dateOfBirth" nillable="true" type="dateTime" />
       <element name="firstName" nillable="true" type="string" />
       <element name="lastName" nillable="true" type="string" />
       <element name="state" nillable="true" type="string" />
       <element name="zip" nillable="true" type="string" />
       </sequence>
       </complexType>
       </schema>
      


      And I am trying to reference 'firstName' on my .bpel file like following:

      <assign name="connectionBetween">
       <copy>
       <from variable="svc2OutputMsg" part="result" />
       <to variable="svcReq" part="EnrollmentMessageType_1" query="/EnrollmentMessageType_1/svc:firstName" />
       </copy>
       </assign>
      


      But I am getting the following exception:
      18:54:44,613 ERROR [SOAPFaultExceptionHelper] SOAP request exception
      javax.xml.rpc.JAXRPCException: org.jboss.ws.binding.BindingException: javax.xml.bind.JAXBException: Failed to parse source: Requested element {com:vizuri:bpel:svc}firstName is not allowed in this posi
      tion in the sequence. The next element should be {com:vizuri:bpel:svc}addressLine1
       at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:307)
       at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
       at org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103)
       at org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
       at org.jboss.ws.server.ServiceEndpointInvokerJSE.invokeServiceEndpoint(ServiceEndpointInvokerJSE.java:94)
       at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:118)
       at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:234)
       at org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServlet.java:120)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.ws.binding.BindingException: javax.xml.bind.JAXBException: Failed to parse source: Requested element {com:vizuri:bpel:svc}firstName is not allowed in this position in the sequence
      . The next element should be {com:vizuri:bpel:svc}addressLine1
       at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:108)
       at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:262)
       ... 27 more
      Caused by: javax.xml.bind.JAXBException: Failed to parse source: Requested element {com:vizuri:bpel:svc}firstName is not allowed in this position in the sequence. The next element should be {com:vizur
      i:bpel:svc}addressLine1
       at org.jboss.ws.jaxb.JAXBUnmarshallerImpl.unmarshal(JAXBUnmarshallerImpl.java:82)
       at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:97)
       ... 28 more
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Requested element {com:vizuri:bpel:svc}firstName is not allowed in this position in the sequence. The next element should be {
      com:vizuri:bpel:svc}addressLine1
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:141)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:127)
       at org.jboss.ws.jaxb.JAXBUnmarshallerImpl.unmarshal(JAXBUnmarshallerImpl.java:78)
       ... 29 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Requested element {com:vizuri:bpel:svc}firstName is not allowed in this position in the sequence. The next element should be {com:vizuri:bpel:s
      vc}addressLine1
       at org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1.startElement(SequenceBinding.java:214)
       at org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding$Cursor.startElement(ModelGroupBinding.java:151)
       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:189)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:299)
       at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:137)
       ... 31 more
      18:54:44,633 ERROR [StartListener] could not start process instance
      java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:208)
       at org.jbpm.bpel.def.Receive_$$_javassist_24.accept(Receive_$$_javassist_24.java)
       at org.jbpm.bpel.def.ProcessInstanceStarter.visit(ProcessInstanceStarter.java:82)
       at org.jbpm.bpel.def.Sequence.accept(Sequence.java:84)
       at org.jbpm.bpel.def.ProcessInstanceStarter.visit(ProcessInstanceStarter.java:29)
       at org.jbpm.bpel.def.BpelDefinition.messageReceived(BpelDefinition.java:110)
       at org.jbpm.bpel.relation.jms.StartListener.onMessage(StartListener.java:94)
       at org.jboss.mq.SpyMessageConsumer.run(SpyMessageConsumer.java:694)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jbpm.graph.def.DelegationException
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:88)
       at org.jbpm.graph.def.Transition.take(Transition.java:119)
       at org.jbpm.graph.def.Node.leave(Node.java:382)
       at org.jbpm.bpel.def.Activity.leave(Activity.java:148)
       at org.jbpm.bpel.def.ProcessInstanceStarter.visit(ProcessInstanceStarter.java:43)
       at org.jbpm.bpel.def.Receive.accept(Receive.java:64)
       ... 13 more
      Caused by: org.jbpm.graph.def.DelegationException
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:88)
       at org.jbpm.graph.def.Transition.take(Transition.java:119)
       at org.jbpm.graph.def.Node.leave(Node.java:382)
       at org.jbpm.bpel.def.Activity.leave(Activity.java:148)
       at org.jbpm.bpel.def.Assign.execute(Assign.java:41)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:83)
       ... 18 more
      Caused by: org.jbpm.graph.def.DelegationException
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:88)
       at org.jbpm.graph.def.Transition.take(Transition.java:119)
       at org.jbpm.graph.def.Node.leave(Node.java:382)
       at org.jbpm.bpel.def.Activity.leave(Activity.java:148)
       at org.jbpm.bpel.def.Invoke.execute(Invoke.java:29)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:83)
       ... 23 more
      Caused by: org.jbpm.graph.def.DelegationException
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:349)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:343)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:88)
       at org.jbpm.graph.def.Transition.take(Transition.java:119)
       at org.jbpm.graph.def.Node.leave(Node.java:382)
       at org.jbpm.bpel.def.Activity.leave(Activity.java:148)
       at org.jbpm.bpel.def.Assign.execute(Assign.java:41)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:83)
       ... 28 more
      Caused by: org.jbpm.bpel.xml.BpelException: soap fault does not include a detail element
       at org.jbpm.bpel.service.consumer.PortConsumer.readFault(PortConsumer.java:419)
       at org.jbpm.bpel.service.consumer.PortConsumer.call(PortConsumer.java:100)
       at org.jbpm.bpel.relation.jms.JmsRelationService.invoke(JmsRelationService.java:146)
       at org.jbpm.bpel.def.Invoke.execute(Invoke.java:28)
       at org.jbpm.bpel.def.Activity.enter(Activity.java:83)
       ... 33 more
      


      If I change query="/EnrollmentMessageType_1/svc:firstName" to query="/EnrollmentMessageType_1/svc:addressLine1", it works. So I guess my question is how to access elements in a sequence other than the first element.

      Thanks!