User Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

XQuery Implementation

AquaLogic Service Bus uses the BEA AquaLogic Data Services Platform implementation of the XQuery engine which fully supports all of the language features that are described in the World Wide Web (W3C) specification for XQuery with one exception: modules.

It also supports the following XQuery functions:

All of the BEA function extensions use the following function prefix fn-bea: . For example, the full XQuery notation for an extended function is: fn-bea: function_name.

 


Supported Function Extensions from AquaLogic Data Services Platform

AquaLogic Service Bus supports all function extensions that BEA AquaLogic Data Services Platform provides except for the following:

BEA recommends that you do not use the following functions in AquaLogic Service Bus—they are better covered by other language features:

For a list of all AquaLogic Data Services Platform function extensions and a description of each function, see BEA XQuery Implementation in the XQuery Developer's Guide.

 


Function Extensions from AquaLogic Service Bus

AquaLogic Service Bus provides the following XQuery function:

fn-bea:lookupBasicCredentials()

The fn-bea:lookupBasicCredentials function returns the user name and unencrypted password from a specified service account. You can specify any type of service account (static, pass-through, or user-mapping). See Service Account in Using the AquaLogic Service Bus Console.

Use the fn-bea:lookupBasicCredentials function as part of a larger set of XQuery functions that you use to encode a user name and password in a custom transport header or in an application-specific location within the SOAP envelope. You do not need to use this function if you only need user names and passwords to be located in HTTP Authentication headers or as WS-Security user name tokens. AquaLogic Service Bus already retrieves user names and passwords from service accounts and encodes them in HTTP Authentication headers or as WS-Security user name tokens when required.

The function has the following signature:

fn-bea:lookupBasicCredentials( $service-account as xs:string ) as UsernamePasswordCredential

where $service-account is the path and name of a service account in the following form:

project-name[/folder[...]]/service-account-name

The return value is an XML element of this form:

<UsernamePasswordCredential
   xmlns="http://www.bea.com/wli/sb/services/security/config">
   <username>
name</username>
   <password>
unencrypted-password</password>
</UsernamePasswordCredential>

You can store the returned element in a user-defined variable and retrieve the user name and password values from this variable when you need them.

For example, your AquaLogic Service Bus project is named myProject. You create a static service account named myServiceAccount in a folder named myFolder1/myFolder2. In the service account, you save the user name of pat with a password of patspassword.

To get the user name and password from your service account, invoke the following function:

fn-bea:lookupBasicCredentials( myProject/myFolder1/myFolder2/myServiceAccount )

The function returns the following element:

<UsernamePasswordCredential
   xmlns="http://www.bea.com/wli/sb/services/security/config">
   <username>pat</username>
   <password>patspassword</password>
</UsernamePasswordCredential>

fn-bea: uuid()

The function fn-bea:uuid() returns a universally unique identifier. The function has the following signature:

fn-bea:uuid() as xs:string

You can use this function in the proxy pipeline to generate a unique identifier. You can insert the generated unique identifier into an XML document as an element. You cannot generate a unique identifier to the system variable. You can use this mainly to modify the payload. Following use case illustrates the usage of the function to generate a unique identifier:

Suppose you want to generate a unique identifier to add to a message for tracking purpose. You could use this function to generate a unique identifier. The function returns a string, and add it to the SOAP header.

fn-bea:serialize()

You can use the fn-bea:serialize() function if you need to represent an XML Document as a string instead of as an XML element. For example, you may want to exchange an XML document through an EJB interface and the EJB method takes String as argument. The function has the following signature:

fn-bea:serialize($input as item()) as xs:string


  Back to Top       Previous  Next