2 Replies Latest reply: Mar 24, 2010 10:26 PM by 843830 RSS

    OpenESB: XML JMS message not being parsed

    843830
      I've been working on this for 2 days now, and wonder if anyone else knows what may be going wrong.

      I have a BPEL process that receives from an XML message from a JMS queue. The WSDL for this BPEL process takes in an XML object (called wrapper, which has 5 complex type elements) that I've defined in a schema, so in the Receive activity it supposedly assigns part1 of the JMS message to the object JMSInput (which is of the same type as the object specified in the WSDL and schema).

      If I log the part1 request object, it shows all the XML data, but if I try to log any of the inner objects I get nothing.
      Trying to convert them to a string strips out all the XML and leaves me with values.

      For example:
      Logging the part1 object of the request results in this:
      <?xml version="1.0" encoding="UTF-8"?><jbi:part xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper">
               <getCodeById>
                  <id>3</id>
               </getCodeById>
            </jbi:part>
      Logging the getCodeById object though results in this (added in >> and << to show where the output starts and finishes):
      >>         
                  3
               
            <<
      If anyone has any ideas, let me know as I'm been trying to figure this out for 2 days and it's driving me nuts!

      Thanks,

      Daniel
        • 1. Re: OpenESB: XML JMS message not being parsed
          843830
          Just for information, heres the schema and WSDL for the BPEL process.

          Schema
          <?xml version="1.0" encoding="UTF-8"?>
          
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              targetNamespace="http://xml.netbeans.org/schema/Wrapper"
              xmlns:tns="http://xml.netbeans.org/schema/Wrapper"
              elementFormDefault="qualified" xmlns:ns0="http://webservice.shdds.sapol.sa.gov.au/">
              <xsd:import schemaLocation="http://jd-shdp-sapol-liferay-dev:8080/SHDPDataServices/OcbaReferenceCodeWebServiceService?xsd=1" namespace="http://webservice.shdds.sapol.sa.gov.au/" />
              <xsd:complexType name="wrapper">
                  <xsd:sequence>
                      <xsd:element name="delete" type="ns0:delete" minOccurs="0" ></xsd:element>
                      <xsd:element name="getAllActiveCodes" type="ns0:getAllActiveCodes" minOccurs="0" ></xsd:element>
                      <xsd:element name="getAllCodes" type="ns0:getAllCodes" minOccurs="0" ></xsd:element>
                      <xsd:element name="getCodeById" type="ns0:getCodeById" minOccurs="0" ></xsd:element>
                      <xsd:element name="save" type="ns0:save" minOccurs="0" ></xsd:element>
                  </xsd:sequence>
              </xsd:complexType>
          </xsd:schema>
          WSDL
          <?xml version="1.0" encoding="UTF-8"?>
          <definitions name="OcbaJBIWSDL" targetNamespace="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL"
              xmlns="http://schemas.xmlsoap.org/wsdl/"
              xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" xmlns:ns="http://xml.netbeans.org/schema/Wrapper" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
              <types>
                  <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL">
                      <xsd:import namespace="http://xml.netbeans.org/schema/Wrapper" schemaLocation="Wrapper.xsd"/>
                  </xsd:schema>
              </types>
              <message name="OcbaJBIWSDLOperationRequest">
                  <part name="part1" type="ns:wrapper"/>
              </message>
              <message name="OcbaJBIWSDLOperationResponse">
                  <part name="part1" type="xsd:anyType"/>
              </message>
              <portType name="OcbaJBIWSDLPortType">
                  <operation name="OcbaJBIWSDLOperation">
                      <input name="input1" message="tns:OcbaJBIWSDLOperationRequest"/>
                      <output name="output1" message="tns:OcbaJBIWSDLOperationResponse"/>
                  </operation>
              </portType>
              <plnk:partnerLinkType name="OcbaJBIWSDL">
                  <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes. 
          In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
          A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
                  <plnk:role name="OcbaJBIWSDLPortTypeRole" portType="tns:OcbaJBIWSDLPortType"/>
              </plnk:partnerLinkType>
          </definitions>
          • 2. Re: OpenESB: XML JMS message not being parsed
            843830
            And also the BPEL source:

            BPEL
            <?xml version="1.0" encoding="UTF-8"?>
            <process
                name="ocbaJBI"
                targetNamespace="http://enterprise.netbeans.org/bpel/OcbaJBI/ocbaJBI"
                xmlns:tns="http://enterprise.netbeans.org/bpel/OcbaJBI/ocbaJBI"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
                xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace" 
                xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor"
                xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2" xmlns:ns0="http://xml.netbeans.org/schema/Wrapper" xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" xmlns:ns1="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ns2="http://webservice.shdds.test.com/">
                <import namespace="http://enterprise.netbeans.org/bpel/OcbaReferenceCodeWebServiceServiceWrapper" location="OcbaReferenceCodeWebServiceServiceWrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
                <import namespace="http://webservice.shdds.test.com/" location="http://jd-shdp-sapol-liferay-dev:8080/SHDPDataServices/OcbaReferenceCodeWebServiceService?wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
                <import namespace="http://xml.netbeans.org/schema/Wrapper" location="Wrapper.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
                <import namespace="http://webservice.shdds.test.com/" location="http://jd-shdp-sapol-liferay-dev:8080/SHDPDataServices/OcbaReferenceCodeWebServiceService?xsd=1" importType="http://www.w3.org/2001/XMLSchema"/>
                <import namespace="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" location="OcbaJBIWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
                <partnerLinks>
                    <partnerLink name="PartnerLink1" xmlns:tns="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" partnerLinkType="tns:OcbaJBIWSDL" myRole="OcbaJBIWSDLPortTypeRole"/>
                    <partnerLink name="OcbaWS" xmlns:tns="http://enterprise.netbeans.org/bpel/OcbaReferenceCodeWebServiceServiceWrapper" partnerLinkType="tns:OcbaReferenceCodeWebServiceLinkType" partnerRole="OcbaReferenceCodeWebServiceRole"/>
                </partnerLinks>
                <variables>
                    <variable name="OcbaJBIWSDLOperationOut" xmlns:tns="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" messageType="tns:OcbaJBIWSDLOperationResponse"/>
                    <variable name="OcbaJBIWSDLOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" messageType="tns:OcbaJBIWSDLOperationRequest"/>
                    <variable name="GetCodeByIdOut" xmlns:tns="http://webservice.shdds.test.com/" messageType="tns:getCodeByIdResponse"/>
                    <variable name="GetCodeByIdIn" xmlns:tns="http://webservice.shdds.test.com/" messageType="tns:getCodeById"/>
                    <variable name="SaveOut" xmlns:tns="http://webservice.shdds.test.com/" messageType="tns:saveResponse"/>
                    <variable name="SaveIn" xmlns:tns="http://webservice.shdds.test.com/" messageType="tns:save"/>
                    <variable name="DeleteOut" xmlns:tns="http://webservice.shdds.test.com/" messageType="tns:deleteResponse"/>
                    <variable name="DeleteIn" xmlns:tns="http://webservice.shdds.test.com/" messageType="tns:delete"/>
                </variables>
                <sequence>
                    <receive name="Receive1" createInstance="yes" partnerLink="PartnerLink1" operation="OcbaJBIWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" portType="tns:OcbaJBIWSDLPortType" variable="OcbaJBIWSDLOperationIn">
                    </receive>
                    <if name="If1">
                        <condition>boolean($OcbaJBIWSDLOperationIn.part1/ns0:delete)</condition>
                        <sequence name="Delete">
                            <assign name="Assign1">
                                <copy>
                                    <from>$OcbaJBIWSDLOperationIn.part1/ns0:delete</from>
                                    <to variable="DeleteIn" part="parameters"/>
                                </copy>
                            </assign>
                            <!-- Invoke goes here -->
                            <assign name="Assign2">
                                <copy>
                                    <from variable="DeleteOut" part="parameters"/>
                                    <to variable="OcbaJBIWSDLOperationOut" part="part1"/>
                                </copy>
                            </assign>
                        </sequence>
                        <elseif>
                            <condition>boolean($OcbaJBIWSDLOperationIn.part1/ns0:save)</condition>
                            <sequence name="Save" xmlns:tns="http://webservice.shdds.test.com/">
                                <assign name="AssignSave">
                                    <copy>
                                        <from>$OcbaJBIWSDLOperationIn.part1/ns0:save</from>
                                        <to variable="SaveIn" part="parameters"/>
                                    </copy>
                                </assign>
                                    <invoke name="invokeSave" partnerLink="OcbaWS" operation="save" xmlns:tns="http://webservice.shdds.test.com/" portType="tns:OcbaReferenceCodeWebService" inputVariable="SaveIn" outputVariable="SaveOut"/>
                                    <assign name="AssignSaveOut">
                                        <copy>
                                            <from variable="SaveOut" part="parameters"/>
                                            <to variable="OcbaJBIWSDLOperationOut" part="part1"/>
                                        </copy>
                                    </assign>
                            </sequence>
                        </elseif>
                        <elseif>
                            <condition>boolean($OcbaJBIWSDLOperationIn.part1/ns0:getCodeById)</condition>
                            <sequence name="Sequence1">
                                <assign name="Assign3">
                                    <copy>
                                        <from>$OcbaJBIWSDLOperationIn.part1/ns0:getCodeById</from>
                                        <to variable="GetCodeByIdIn" part="parameters"/>
                                    </copy>
                                </assign>
                                <invoke name="Invoke2" partnerLink="OcbaWS" operation="getCodeById" xmlns:tns="http://webservice.shdds.test.com/" portType="tns:OcbaReferenceCodeWebService" inputVariable="GetCodeByIdIn" outputVariable="GetCodeByIdOut"/>
                                <assign name="Assign4">
                                    <copy>
                                        <from variable="GetCodeByIdOut" part="parameters"/>
                                        <to variable="OcbaJBIWSDLOperationOut" part="part1"/>
                                    </copy>
                                </assign>
                            </sequence>
                        </elseif>
                        <else>
                            <sequence name="Sequence2">
                                <assign name="Assign5">
                                    <copy>
                                        <from>'Nothing happened'</from>
                                        <to variable="OcbaJBIWSDLOperationOut" part="part1"/>
                                    </copy>
                                </assign>
                            </sequence>
                        </else>
                    </if>
                    <reply name="Reply1" partnerLink="PartnerLink1" operation="OcbaJBIWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/OcbaJBI_1/OcbaJBIWSDL" portType="tns:OcbaJBIWSDLPortType" variable="OcbaJBIWSDLOperationOut"/>
                </sequence>
            </process>
            Edited by: daniel.conradi on Mar 24, 2010 8:25 PM