0 Replies Latest reply: May 20, 2013 9:57 AM by Sandro.Simas RSS

    Mismatch Assign: cannot set a nonmessage value to a message-based variable

    Sandro.Simas
      Hi all, i'm trying to build a bpel process that receive a xml and iterates over the elements, calling a web service for each element found.
      This is a summary of the xml:

      <interfaces>
      <interface>
      <headers>
      <header><key>Key1</key><value>Value1</value></header>
      </headers>
      <body>Any Content 2</body>
      </interface>
      <interface>
      <headers>
      <header><key>Key1</key><value>Value2</value></header>
      </headers>
      <body>Any Content 2</body>
      </interface>
      </interfaces>

      I need to iterate over all interface element, calling a webservice sending the body element as input.
      With this, i created the follow flow:

      <sequence name="main">
      <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess.wsdl) -->
      <receive name="receiveInput" partnerLink="bpelprocess_client"
      portType="client:BPELProcess" operation="process"
      variable="inputVariable" createInstance="yes"/>
      <forEach parallel="yes" counterName="forEachOperationCounter"
      name="forEachOperation">
      <startCounterValue>1</startCounterValue>
      <finalCounterValue>count($inputVariable.payload/ifaces:interface)</finalCounterValue>
      <scope name="Scope1">
      <variables>
      *<variable name="interface" element="ifaces:interface"/>*
      *<variable name="body" element="ifaces:body"/>*
      <variable name="serviceInput" messageType="ns1:body_msg_in"/>
      <variable name="serviceOutput" messageType="ns1:body_msg_out"/>
      </variables>
      <sequence name="Sequence1">
      <assign name="assignValues">
      *<copy>
      <from>$inputVariable.payload/ifaces:interface[$forEachOperationCounter]</from>
      <to>$interface</to>
      </copy>
      <copy>
      <from>$interface/ifaces:body</from>
      <to>$body</to>
      </copy>
      <copy>
      <from>$body</from>
      <to>$serviceInput.body</to>*
      </copy>
      </assign>
      <invoke name="serviceInvoke" partnerLink="gcc"
      portType="ns1:create_client_ptt" operation="create_client"
      inputVariable="serviceInput" outputVariable="serviceOutput"
      bpelx:invokeAsDetail="no"/>
      <assign name="assignResult">
      <copy>
      <from>$serviceOutput.body</from>
      <to>$outputVariable.payload</to>
      </copy>
      </assign>
      </sequence>
      </scope>
      </forEach>
      <!-- Generate reply to synchronous request -->
      <reply name="replyOutput" partnerLink="bpelprocess_client"
      portType="client:BPELProcess" operation="process"
      variable="outputVariable"/>
      </sequence>

      When i run this process on the server, i receive this error:
      Mismatch Assign: cannot set a nonmessage value to a message-based variable
      I think that i'm missing anything here:

      <copy>
      <from>$body</from>
      <to>$serviceInput.body</to>*
      </copy>

      Anyone can help-me, please ???