Wednesday, November 19, 2014

Multiple markers at this line - An error occurred compiling the XQuery resource: The use of an unbound current node is not supported for XQuery resources

Error: Multiple markers at this line - An error occurred compiling the XQuery resource: The use of an unbound current node is not supported for XQuery resources.

We can observe this error some times during the XQuery development in OSB.
I faced this error and it was quite annoying.
Checked each line but could not find any mapping mistake.

In the last attempt there is a silly mistake which happened during copy pate.

In one of the mappings, variable name was wrongly copied.

Wrong mapping : <test>{data(testVar/GroupNumber)}</test>

Correct mapping : <test>{data($testVar/GroupNumber)}</test>

HTTP 411 error in business service

If there is a HTTP 411 error when invoking WSDL based business service within a proxy service, make sure of the following things.

1.  ServiceAccount is required if the web service has basic authentication. Add it in ServiceAccount are of HTTPTransport page of the business service configuration
2. Click on AdvancedSettings in  HTTPTransport page of the business service configuration and uncheck "UseChunkedStreamingMode"

Following is the screenshot.


Wednesday, August 13, 2014

Useful XQuery functions

Following are the useful XQuery functions which can come handy while doing the OSB programming.

Function to join different strings with a delimiter:

fn:string-join(
for $empName in $empList/emp:Employee/emp:Name
return
data($empName/text()),',')

DateToString and StringToDate conversion functions:

fn-bea:date-to-string-with-format('MM/dd/yyyy',fn-bea:date-from-string-with-format('MM-dd-yyyy', $requestDate))
fn-bea:date-from-string-with-format('yyyy/MM/dd', $requestDate)

Code snippet to convert any phone number format to the USA phone number format:

fn:replace(fn:replace($phoneNbr,"\(|-|\)| ",""),'(\d{3})(\d{3})(\d{4})', '($1) $2-$3')

Rounding to an integer value:

xs:int(fn:round($varTranSeqID))