You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by Christian Ewers <CE...@de.ibm.com> on 2007/01/30 16:07:57 UTC
Empty nodes as result of queryResourceProperties()
Hi,
I'm using the queryResourceProperties() method to get idle resources from a
ServiceGroup.
My xpath-query is: (sg is the ServiceGroupClient)
Node[] eprs =
sg.queryResourceProperties("/wsrf-sg:ServiceGroupRP/wsrf-sg:Entry[./wsrf-sg:Content/muws2:OperationalStatus
=
'Available']/wsrf-sg:MemberServiceEPR[contains(./wsa:Address,'WSResource')]",
"http://www.w3.org/TR/1999/REC-xpath-19991116");
When their aren't any resources availaibe, the result is an correct empty
node-array. When there are available resources I get them but I get
additional "#text"-nodes for each "real" result.
For example, when I have one idle resource I get the following result for
the following loop
for (Node node : eprs) {
System.out.println((i++)+"
\n"+node.getNodeName()+"\n"+XmlUtils.toString(node));
}
----- log-----
0
#text
1
wsrf-sg:MemberServiceEPR
<?xml version="1.0" encoding="UTF-8"?>
<wsrf-sg:MemberServiceEPR
xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2">
<wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/DefaultService/services/PAIResource</wsa:Address>
<wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing">
<muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">uuid:701e1d9b-fb93-93fc-6242-20de49fa9fba</muse-wsa:ResourceId>
</wsa:ReferenceParameters>
</wsrf-sg:MemberServiceEPR>
2
#text
------end log------
Does my query result in some empty elements, or is this a bug?
Regards,
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: Empty nodes as result of queryResourceProperties()
Posted by Daniel Jemiolo <da...@us.ibm.com>.
hmmm. I'm not an XPath expert, but it looks like a bug. What do the text
nodes say? (can you send the values from getNodeValue()?)
Christian Ewers <CE...@de.ibm.com> wrote on 01/30/2007 10:07:57 AM:
>
> Hi,
>
> I'm using the queryResourceProperties() method to get idle resources
from a
> ServiceGroup.
> My xpath-query is: (sg is the ServiceGroupClient)
>
> Node[] eprs =
>
sg.queryResourceProperties("/wsrf-sg:ServiceGroupRP/wsrf-sg:Entry[./wsrf-sg:
> Content/muws2:OperationalStatus
> =
>
'Available']/wsrf-sg:MemberServiceEPR[contains(./wsa:Address,'WSResource')]",
> "http://www.w3.org/TR/1999/REC-xpath-19991116");
>
>
> When their aren't any resources availaibe, the result is an correct
empty
> node-array. When there are available resources I get them but I get
> additional "#text"-nodes for each "real" result.
> For example, when I have one idle resource I get the following result
for
> the following loop
>
> for (Node node : eprs) {
> System.out.println((i++)+"
> \n"+node.getNodeName()+"\n"+XmlUtils.toString(node));
> }
>
> ----- log-----
> 0
> #text
>
>
> 1
> wsrf-sg:MemberServiceEPR
> <?xml version="1.0" encoding="UTF-8"?>
> <wsrf-sg:MemberServiceEPR
> xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2">
> <wsa:Address
> xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:
> 8080/DefaultService/services/PAIResource</wsa:Address>
> <wsa:ReferenceParameters
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> <muse-wsa:ResourceId
> xmlns:muse-wsa="http://ws.apache.org/muse/addressing">uuid:701e1d9b-
> fb93-93fc-6242-20de49fa9fba</muse-wsa:ResourceId>
> </wsa:ReferenceParameters>
> </wsrf-sg:MemberServiceEPR>
>
> 2
> #text
> ------end log------
>
> Does my query result in some empty elements, or is this a bug?
>
> Regards,
> Christian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org