Oracle SOA Suite Online Training

Interested in learning Oracle SOA Suite 12c?
Learn from the author of this blog!
A complete and comprehensive course on the #1 platform on SOA - Oracle SOA Suite

Click here to find the complete course details
Click here to check the first session on Oracle SOA Suite 12c

================================================================================================

The assign activity of the to node query is returning zero node.

Exception :
<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
   <part name="summary">
      <summary>XPath query string returns zero node.
The assign activity of the to node query is returning zero node.
Either the to node data or the xpath query in the to node was invalid.
According to BPEL4WS spec 1.1 section 14.3, verify the to node value at line number 830 in the BPEL source.</summary>
   </part>
</selectionFailure>


This happens when the TO/Target node that you are assigning is null.
This usually happens when the element is optional, and you assign a value when the element is not having a value. In such cases, you can use the 'ignoreMissingToData' by right clicking the individual assignment in the assign activity.

In cases where you are dealing with arrays, visit this post

Appending repeating elements using Assign

Criteria element in the following schema repeats - and is Optional aswell




You might want to add some <Criteria> elements to your XML.
You can do this either in Assign activity or XSLT.

Using Assign Activity

First, append the <Criteria> element those number of times that you want the array to be.
Remember that the Criteria element before appending has to exist. Otherwise, only the parent <Criteria> tag gets appended and the children (KeyName, KeyValue) doesn't get appended, and you will get the following error in the assign activity

<selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
   <part name="summary">
      <summary>XPath query string returns zero node.
The assign activity of the to node query is returning zero node.
Either the to node data or the xpath query in the to node was invalid.
According to BPEL4WS spec 1.1 section 14.3, verify the to node value at line number 830 in the BPEL source.</summary>
   </part>
</selectionFailure>

If you feel the <Criteria> element might be null, first you stuff the first element, and then append.
Something like this

Next, APPEND the <Criteria[1]> (which you had just created) from the variable to the same variable those number of times that you want the array to be.

Note : If you don't specify the '[]' / Array nomenclature, the assignment happens even if the element is null. But if you specify the '[]' / Array nomenclature, you have to have the element. Otherwise, you will get the error mentioned above.

 Using XSLT

Using XSLT is straight forward.
You can loop over the source elements and assign the values.
If the source elements from which you want to copy the values are not in a loop, and if you know exactly how many array elements you want to add, go to the source editor of the xslt and manually add the elements, something like this

<criteria>
    <KeyName>SomeHardKey1</KeyName>
    <KeyValue><xslt:value-of select="..."/></KeyValue>
</criteria><criteria>
    <KeyName>SomeHardKey2</KeyName>
    <KeyValue><xslt:value-of select="..."/></KeyValue>
</criteria>
...

Hope it helps!
Thanks.

WSDLException: faultCode=OTHER_ERROR: Database Type not supported

Sometimes, while creating a dbAdapter for a stored procedure, you can browse the SP from the database adapter wizard, but when you click on finish, you might encounter the following error


WSDLException: faultCode=OTHER_ERROR: Database Type not supported
Encountered a database type XX that is either not supported or is not implemented.
Parameter YY is of type ZZ which is either not supported or is not an implemented datatype



This happens when the user you are using to connect to the database from the Database Adapter wizard is not given grants to the stored procedure.
Everytime the Stored Procedure or its types are modified in the db, grants to this user has to be given again.