Thursday, December 11, 2014

Reference does not exist as wire target

This error normally comes when we try to comment out some existing references from composite.xml

Normally to disable a particular invocation we comment out the respective reference section in the composite.xml

But at the sametime we need to ensure that

In the composite.xml we comment out the import statement for that reference

Open the .componentType file and comment out the corresponding reference section there as well.

If there is a mismatch between composite.xml and .componentType file, the above error occurs

Monday, December 8, 2014

could not resolve xpath function "getServiceProperty", because missing xpath function meta-data


getServiceProperty method is one of the xpath functions available in aia.jar

If you are getting the above error during project compilation , it means the aia.jar is not attached to your project.

You may get the AIAServiceConstructor using the jdev updates and restart jdev  or explicitly attach aia,jar using the project preferences as shown below


Friday, December 5, 2014

Dynamic PartnerLink in BPEL 2.0

Often we may want to call the target endpoints dynamically. In such cases WS Addressing comes for our help.

In BPEL 1.1 we can assign the following snippet to the partner link and it will try to hit the endpoint mentioned in the snippet.

<wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
    <wsa:Address>http://localhost:8001/soa-infra/services/default/TargetService</wsa:Address>
</wsa:EndpointReference>

But in BPEL 2.0 the above approach was not working for me.

I have achieved the dynamic partner link requirement achieved in BPEL 2.0 as follows

Download the ws-bpel_serviceref.xsd  and add it to your project

Create a variable of element type service-ref , which is defined in the above xsd

<variable name="partnerlink-reference" element="sref:service-ref"/>






For the example purpose I am storing my target endpoint in a variable. (You may use DVM or AIAServiceConfigurationProperty file to store your target endpoint at real time.)

<copy>
        <from>'http://localhost:8001/soa-infra/services/default/TargetService'</from>
        <to>$TargetService</to>
      </copy>


Using append xml fragment option the following xml snippet to the above variable  partnerlink-reference

 <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
    <wsa:Address/>
</wsa:EndpointReference>

Now enrich the   partnerlink-reference xml with the actual endpoint you need
     <copy>
        <from>$TargetService</from>
        <to>$partnerlink-reference/wsa:EndpointReference/wsa:Address</to>
      </copy>

Finally copy partnerlink-reference variable  to the target partner link

 <copy>
        <from>$partnerlink-reference</from>
        <to partnerLink="TargetServicePartnerLink"/>
      </copy>

The entire Assign activity will look like as follows

<assign name="Assign1">
      <copy>
        <from>'http://localhost:8001/soa-infra/services/default/TargetService'</from>
        <to>$TargetService</to>
      </copy>
      <extensionAssignOperation>
        <bpelx:append>
          <bpelx:from><bpelx:literal><wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
    <wsa:Address/>
</wsa:EndpointReference></bpelx:literal></bpelx:from>
          <bpelx:to>$partnerlink-reference</bpelx:to>
        </bpelx:append>
      </extensionAssignOperation>
      <copy>
        <from>$TargetService</from>
        <to>$partnerlink-reference/wsa:EndpointReference/wsa:Address</to>
      </copy>
      <copy>
        <from>$partnerlink-reference</from>
        <to partnerLink="TargetServicePartnerLink"/>
      </copy>
    </assign>



Save and deploy your project. Test your flow, you can see your partnerlink's target address is changed to the one you updated from your BPELprocess



Tuesday, December 2, 2014

WS Security Error while trying to invoke a BPEL Component

In case of any WS Security error while trying to invoke a BPEL service, verify whether any security policies are attached to that service.

To override the security requirement you can attach the no-authentication policy to the reference exposed to the client . i.e client_ep



This can be done either from emconsole after deployment of the service or in jdev before deploying