Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » BPEL Designer » Xpath query help(I cannot seem to isolate one variable)
Xpath query help [message #521669] Thu, 18 March 2010 09:04
Pembar  is currently offline Pembar
Messages: 3
Registered: March 2010
Junior Member
Hey guys,

I am very new to BPEL and I've been struggling with this problem for 2 days now. I used the example at:

http://www.eclipse.org/bpel/users/howto/ode.php

I managed to get the example working. As an added difficulty, I decided to challenge myself to add a second input. I managed to do that after reading

http://www.ibm.com/developerworks/webservices/library/ws-whi chwsdl/

I realised that having two elements in the schema is better than having two parts in a message.

Anyway, with the two inputs declared in the wsdl file as:

<element name="HelloWorldRequest">
                <complexType>
                    <sequence>
                        <element name="input" type="string"/>
                        <element name="inputB" type="string"/>
                    </sequence>
                </complexType>
            </element>


I get the following message in the log files when I run the service:

<message><payload><HelloWorldRequest xmlns="http://helloWorld" xmlns:q0="http://helloWorld" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <input>fr asra3</input>
      <inputB> asfdasra 2</inputB>
    </HelloWorldRequest></payload></message>


My difficulty is trying to extract only one of the inputs, either <input> or <inputB> (not both)

I managed to modify the assign function to

<bpel:assign validate="no" name="Assign">
	            <bpel:copy>
	                <bpel:from>
	                    bpel:getVariableData('input', 'payload')
	                </bpel:from>
	                <bpel:to part="payload" variable="output">
	                    
	                </bpel:to>
	            </bpel:copy>
	        </bpel:assign>


But the entire payload is being printed, both <input> and <inputB>. I have tried
bpel:getVariableData('input', 'payload','/inputB')


And other variations, but it doesn't seem to work. I'd like to output only inputB for now.

Thank you so much for the help.


The declaration of the Partnerlink and Variables in the BPEL file as as follows:

<bpel:partnerLinks>
        <!-- The 'client' role represents the requester of this service. -->
        <bpel:partnerLink name="client"
                     partnerLinkType="tns:HelloWorld"
                     myRole="HelloWorldProvider"
                     />
    </bpel:partnerLinks>
  
    <!-- ================================================================= -->         
    <!-- VARIABLES                                                         -->
    <!-- List of messages and XML documents used within this BPEL process  -->
    <!-- ================================================================= -->         
    <bpel:variables>
        <!-- Reference to the message passed as input during initiation -->
        <bpel:variable name="input"
                  messageType="tns:HelloWorldRequestMessage"/>
                  
        <!-- 
          Reference to the message that will be returned to the requester
          -->
        <bpel:variable name="output"
                  messageType="tns:HelloWorldResponseMessage"/>
    </bpel:variables>


I will include the wsdl file being used, as below:

<?xml version="1.0"?>
<definitions name="HelloWorld"
        targetNamespace="http://helloWorld"
        xmlns:tns="http://helloWorld"
        xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     TYPE DEFINITION - List of types participating in this BPEL process 
     The BPEL Designer will generate default request and response types
     but you can define or import any XML Schema type and use them as part 
     of the message types.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    
    <types>
        <schema attributeFormDefault="unqualified" elementFormDefault="qualified" 
                targetNamespace="http://helloWorld" 
                xmlns="http://www.w3.org/2001/XMLSchema">

            <element name="HelloWorldRequest">
                <complexType>
                    <sequence>
                        <element name="input" type="string"/>
                        <element name="inputB" type="string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="HelloWorldResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="string"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
    </types>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     MESSAGE TYPE DEFINITION - Definition of the message types used as 
     part of the port type defintions
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    
    <message name="HelloWorldRequestMessage">
        <part name="payload" element="tns:HelloWorldRequest"/>
    </message>
    <message name="HelloWorldResponseMessage">
        <part name="payload" element="tns:HelloWorldResponse"/>
    </message>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PORT TYPE DEFINITION - A port type groups a set of operations into
     a logical service unit.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    

    <!-- portType implemented by the HelloWorld BPEL process -->
    <portType name="HelloWorld">
        <operation name="process">
            <input  message="tns:HelloWorldRequestMessage" />
            <output message="tns:HelloWorldResponseMessage"/>
        </operation>
    </portType>
  

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PARTNER LINK TYPE DEFINITION
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    
    <plnk:partnerLinkType name="HelloWorld">
        <plnk:role name="HelloWorldProvider" portType="tns:HelloWorld"/>
    </plnk:partnerLinkType>
    
    <binding name="HelloWorldSOAPBinding" type="tns:HelloWorld">
    	<soap:binding style="document"
    		transport="http://schemas.xmlsoap.org/soap/http" />
    	<operation name="process">
    		<soap:operation soapAction="http://helloWorld/process" />
    		<input>
    			<soap:body use="literal" />
    		</input>
    		<output>
    			<soap:body use="literal" />
    		</output>
    	</operation>
    </binding>
    <service name="HelloWorldProcessService">
    	<port name="HelloWorldProcessPort" binding="tns:HelloWorldSOAPBinding">
    		<soap:address location="http://localhost:8080/ode/processes/HelloWorld" />
    	</port>
    </service>
</definitions>

Previous Topic:BPEL process containing xsl files
Next Topic:How to get BPEL source ?
Goto Forum:
  


Current Time: Mon Jul 28 04:29:50 EDT 2014

Powered by FUDForum. Page generated in 0.01976 seconds