When defining the new custom xpath functions for use in the service bus make sure you don’t prefix the name of the function you want to use
<?xml version="1.0" encoding="UTF-8"?>
<xpf:xpathFunctions xmlns:xpf="http://www.bea.com/wli/sb/xpath/config">
<xpf:category id="%OSB_FUNCTIONS%">
<xpf:function>
<xpf:name>customConcat</xpf:name>
<xpf:comment>%FUNC_CUSTOM_CONCAT_COMMENT%</xpf:comment>
<xpf:namespaceURI>http://nl.iteye/osb/custom/functions/OsbUtils</xpf:namespaceURI>
<xpf:className>nl.iteye.osb.custom.functions.OsbUtils</xpf:className>
<xpf:method>java.lang.String customConcat(java.lang.String, java.lang.String)</xpf:method>
<xpf:isDeterministic>false</xpf:isDeterministic>
<xpf:scope>Pipeline</xpf:scope>
<xpf:scope>SplitJoin</xpf:scope>
</xpf:function>
</xpf:category>
</xpf:xpathFunctions>
Use
<xpf:name>customConcat</xpf:name>
instead of
<xpf:name>util:customConcat</xpf:name>
no namespace prefix on the name
Otherwise on designtime you will receive some error message like :
!MESSAGE [Error Handler, FinalErrorHandler, Assign action] XQuery expression validation failed: line 6, column 32: {err}FONS0003: "func4": prefix not defined in static context
Popularity: 8% [?]



3 Responses to “Oracle Service Bus custom xpath functions, prefix not defined in static context”
{
{
if (fn:contains (data($MethodResponseActivation), ‘not’ ))
then
1Everytime a declare a path to retrieve the value “1″ using the following path :
$statusCode1/ctx:route/ctx:status/code:statuscode ….
I get the following error:
prefix not defined in static context for “code”
did you add the namespace ‘code’ ?
when you use assign/replace/etc at the right of the window/popup you have an option to show all the current added namespaces, is your there ?
Hi Eric,
I have a requirement like three different requests all are converted in to standard format.For this scenario I use dyamic X-query transformation.For Example RequestA,RequestB and RequesrC what ever request it should be converted into one standard format say Response.For this I create three X-Query transformations,and proxy service.If i get the request from RequestA related XQuery will execute (RequstA to Response transformation).
RequestA——Response
RequestB——Response
RequestC——Response
Actually my idea is based on requset schema name (like RequestA) it will convert,for this scenario how can I set condition in dynamicXquery.
Thanks in advance.