perfsonar-dev - Re: [pS-dev] LS XQuery problem
Subject: perfsonar development work
List archive
- From: Yee-Ting Li <>
- To: Maciej Glowiak <>
- Cc:
- Subject: Re: [pS-dev] LS XQuery problem
- Date: Fri, 30 Mar 2007 08:34:19 -0700
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=sntROwyD2MkTjJZZE1pavbkBoTsNqKuF7cX7jmUYRUr1SxXWQh/T5Dq+ZaLTor+zZyNx/yV0TW7hISu6ccpDteXLhF2OMBwVFQbV4mCsoOViNnfsFKbsnTTJsHHomPMT7DWTD3f9gYigTHKqgYF+d38zPYPpkZQEML+JuifeuSo=
Thanks for the response Maciej,
Regarding the 3 question, i do include the <eventType/> element; and the query works fine; however, if i try to return some other text (such as an escaped xml element), i the report responds with that error:
sending the following to http://selena.acad.bg:8070/axis/services/ LookupService:
===
<nmwg:message
type="LSQueryRequest"
id="#lsQuery1"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"
xmlns:xquery="http://ggf.org/ns/nmwg/tools/org/perfsonar/service/ lookup/xquery/1.0/">
<nmwg:metadata id="#meta1">
<xquery:subject id="#sub1">
declare namespace nmwg="http://ggf.org/ns/nmwg/base/2.0/";
declare namespace perfsonar="http://ggf.org/ns/nmwg/tools/ org/perfsonar/1.0/";
declare namespace psservice="http://ggf.org/ns/nmwg/tools/ org/perfsonar/service/1.0/";
declare namespace xquery="http://ggf.org/ns/nmwg/tools/org/ perfsonar/service/lookup/xquery/1.0/";
declare namespace netutil="http://ggf.org/ns/nmwg/ characteristic/utilization/2.0/";
declare namespace nmwgt="http://ggf.org/ns/nmwg/topology/2.0/";
for $data in /nmwg:store/nmwg:data
let $endpoint := data($data/@metadataIdRef)
let $interface := data($data/nmwg:metadata/ netutil:subject/nmwgt:interface/nmwgt:ifAddress[@type="ipv4"])
return hello $interface
</xquery:subject>
<nmwg:eventType>service.lookup.xquery</nmwg:eventType>
</nmwg:metadata>
<nmwg:data metadataIdRef="#meta1"/>
</nmwg:message>
====
Returns
====
<nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/" id="#lsQuery1_resp" messageIdRef="#lsQuery1" type="LSQueryResponse">
<nmwg:metadata id="resultCodeMetadata">
<nmwg:eventType>error.common.storage.xmldb.query</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="resultDescriptionData_for_resultCodeMetadata" metadataIdRef="resultCodeMetadata">
<nmwgr:datum xmlns:nmwgr="http://ggf.org/ns/nmwg/result/ 2.0/">Can't perform XQuery: org.exist.xquery.StaticXQueryException: unexpected token: $ [at line 12, column
30]</nmwgr:datum>
</nmwg:data>
</nmwg:message>
====
However, removing the 'hello' works fine. i've also tried playing around with '{}'s but that also reports the same error.
Cheers,
Yee.
On 28 Mar 2007, at 00:33, Maciej Glowiak wrote:
Hi Yee,
Yee-Ting Li napisaĆ(a):
i' ve been playing around with the lookup service for some automated analysis.Yes, that's normal behaviour. In fact, the responce for XQuery may be any XML (or even not valid XML, just a string without root element), so we decided to encode XML. Of course in most of cases the content will be NMWG but we cannot guarantee it.
i have a few problems i was hoping someone could shed some light on:
1) when i query the LS, it appears that all data within the response's <psservice:datum/> elements are returned as a string (ie. the < and > become < and >); is this normal?
2) with registered netutil metadata (showing the interface's metadata), the supplied entries do not appear to be namespaced correctly; nmwgt is not defined as a namespace within the service.
Services register by themselves, so perhaps the mistake is in the registration message. LS stores everything what was sent to be registered.
3) queries where i try to use the standard '{}' and element definitions to format the output of the query do not appear to work with an error 'xmltypelsserviceengine: no eventType in metadata (type of query) error.
You must use <eventType>...</enventType> inside subjests. Now I don't have the details for that, but you may see the example of query request (LSLookupRequest) on the SVN (or the tarball release) in schema/example-instances/.../LS/test
(sorry for not providing you all the details but I am on the meeting and have just configured network) :)
If it doesn't help, let me know, I'll provide more details.
Best regards
Maciej
- LS XQuery problem, Yee-Ting Li, 03/27/2007
- Re: [pS-dev] LS XQuery problem, Maciej Glowiak, 03/28/2007
- Re: [pS-dev] LS XQuery problem, Yee-Ting Li, 03/30/2007
- Re: [pS-dev] LS XQuery problem, Maciej Glowiak, 03/28/2007
Archive powered by MHonArc 2.6.16.