在Weblogic Service Bus 10g中,我有一个带有函数的XQuery文件,我想在另一个XQuery文件的函数中使用它。我怎样才能在OSB中实现这一目标?
Projects / projectA / getMessageType XQuery:
declare namespace xf = "http://tempuri.org/projectA/getMessageType/";
declare function xf:getMessageType($anyType as element())
as xs:string {
...
};
declare variable $anyType as element() external;
xf:getMessageType($anyType)
Projects / projectB / process XQuery:
declare namespace xf = "http://tempuri.org/projectB/process/";
declare function xf:process($data as element())
as element() {
// call projectA's getMessageType($data) here!!!
...
};
提前致谢, PM
答案 0 :(得分:2)
您需要将xf:getMessageType
函数从projectA
播放到库模块而不是主模块。然后,您可以导入库模块。
考虑类似的事情:
Projects / projectA / getMessageType XQuery:
import module namespace common = "http://your.site.com/common";
declare namespace xf = "http://tempuri.org/projectA/getMessageType/";
declare variable $anyType as element() external;
common:getMessageType($anyType)
Projects / projectB / process XQuery:
import module namespace common = "http://your.site.com/common";
declare namespace xf = "http://tempuri.org/projectB/process/";
declare function xf:process($data as element())
as element() {
common:getMessageType(data)
...
};
项目/普通/ common.xqy
module namespace common = "http://your.site.com/common";
declare function common:getMessageType($anyType as element())
as xs:string {
...
};
您可能需要在at
语句中添加import module
语句,指定公共库模块的文件位置,但我不确定WebLogic OSB中的确切位置。< / p>