You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by Feng Tang <fe...@thedistillery.com.au> on 2005/04/04 05:36:22 UTC

RE: Find service by category bag problem.

That's good to me. :-)

Thanks



-----Original Message-----
From: Steve Viens [mailto:steve@viens.net]
Sent: Wednesday, 16 March 2005 3:39 PM
To: steve@viens.net; juddi-user@ws.apache.org;
feng.tang@thedistillery.com.au
Subject: RE: Find service by category bag problem.



I meant to say that support for the "orAllKeys" find qualifier when
searching by CategoryBag had been implemented.

-----Original Message-----
From: Steve Viens [mailto:steve@viens.net]
Sent: Tuesday, March 15, 2005 11:28 PM
To: 'juddi-user@ws.apache.org'; 'feng.tang@thedistillery.com.au'
Subject: RE: Find service by category bag problem.

Feng,



I committed a fix for this tonight - and corrected the same problem in
find_business, find_binding and find_tModel.  Support for the
"andAllKeys" findQualifier when searching by CategoryBag was also
implemented.



At the moment this LOGICAL AND issue still exists with the find_xx
methods when searching by TModelBag.



Steve

-----Original Message-----
From: Feng Tang [mailto:fengt@thedistillery.com.au]
Sent: Wednesday, March 02, 2005 11:03 PM
To: juddi-user@ws.apache.org
Subject: Find service by category bag problem.

Hi,

I met a find service by category bag problem, and after I search this
forum, I found one guy has asked this same question in last September.
But unfortunately, there is no reply for his question, I want to know
any body can help me now? Because we met the same problem.



I re-post his message in the following:





Date: Tue, 14 Sep 2004 17:39:03 +0200

From: Franck.Wielgus@alcatel.fr <Fr...@alcatel.fr>

Subject: findservice by categorybag with logical AND on two keys

Content-Type: text/plain; charset=ISO-8859-1; format=flowed



Hi,



I'm a new user of  jUDDI and the jUDDI mailing list. I hope my problem

has not been already discussed (I haven't found an exactly similar

situation) or that I haven't misunderstood the UDDI concepts.



Here is my problem : I record 3 services in jUDDI and I categorize them

through Categorybags and two KeyedReferences. The KeyedReferences names

are "param1" and "param2", and their respective possible values are

"net1"/"net2" and "enabled"/"disabled". The three services are as
follows :



The saved Service : HelloWorld_1

The ServiceKey    : 87DD4210-065D-11D9-8210-BDEDD53581D8

parameter identifier     : param1      value   :net1

parameter identifier     : param2      value   :enabled



The saved Service : HelloWorld_2

The ServiceKey    : 87FE85B0-065D-11D9-85B0-BD3F75CD791F

parameter identifier     : param1      value   :net2

parameter identifier     : param2      value   :enabled



The saved Service : HelloWorld_3

The ServiceKey    : 88119880-065D-11D9-9880-E16130BA2D5E

parameter identifier     : param1      value   :net2

parameter identifier     : param2      value   :disabled



Then I try to find all services with particular values for param1 and

param2, I'm particularly interested in queries with logical AND. For

example services with param1=net1 AND param2=enabled. In such case, the

problem is that the included services in the response are :



Search results :



Name of Service : HelloWorld_1

Service key     : 87DD4210-065D-11D9-8210-BDEDD53581D8

parameter identifier     : param1      value   :net1

parameter identifier     : param2      value   :enabled



Name of Service : HelloWorld_2

Service key     : 87FE85B0-065D-11D9-85B0-BD3F75CD791F

parameter identifier     : param1      value   :net2

parameter identifier     : param2      value   :enabled





It seems that the query is a logical OR (I tried param1=net2 AND

param2=enabled and I got the 3 services). If I correctly read the UDDI

v2 and v3 specifications, and the UDDI4J javadoc concerning the

findservice operation, a logical AND should be used... and I tried the

"AndAllkeys" parameter but it does not work as well.

Here is my source code for that query :





* Building the categorybag for searching



//        save searchbag

       CategoryBag searchBag = new CategoryBag();

       //        param1.setKeyValue("net1");

       //        param2.setKeyValue("disabled");

       KeyedReference params1 = new KeyedReference("param1", "net1");

       params1.setTModelKey("uddi:uddi-org:general_keywords");

       KeyedReference params2 = new KeyedReference("param2", "enabled");

       params2.setTModelKey("uddi:uddi-org:general_keywords");

             vect.clear();

       vect.addElement(params1);

       vect.addElement(params2);

             searchBag.setKeyedReferenceVector(vect);



       System.out.println("\nSearch results:");

       helloQuery.hellosearch(proxyInfo, searchBag, businessKey);



* Interesting code in the hellosearch procedure:



//        creating vector of Name Object

           Vector names = new Vector();

           names.add(new Name("Hello"));



FindQualifiers findQualifiers = new FindQualifiers();

           Vector qualifier = new Vector();

           qualifier.add(new FindQualifier(""));

           findQualifiers.setFindQualifierVector(qualifier);



           // **** Find the Business Service saved.

           // And setting the maximum rows to be returned as 5.

           ServiceList serviceList = proxy.find_service(businessKey,
names,

                   searchBag, null, findQualifiers, 5);



           // Process the returned ServiceList object

           Vector serviceInfoVector = serviceList.getServiceInfos()

                   .getServiceInfoVector();

           for (int i = 0; i < serviceInfoVector.size(); i++) {

               ServiceInfo serviceInfo = (ServiceInfo) serviceInfoVector

                       .elementAt(i);

               // Print name for each service

               System.out.println("\nName of Service : "

                       + serviceInfo.getDefaultNameString());

               System.out.println("Service key     : "

                       + serviceInfo.getServiceKey());

               ServiceDetail serviceDet =

proxy.get_serviceDetail(serviceInfo

                       .getServiceKey());

               BusinessService service = (BusinessService) serviceDet

                       .getBusinessServiceVector().get(0);

               try {

                   CategoryBag bag = service.getCategoryBag();

                   Vector paramBag = bag.getKeyedReferenceVector();

                   for (Iterator iter = paramBag.iterator();

iter.hasNext();) {

                       KeyedReference element = (KeyedReference)

iter.next();

                       System.out.println("parameter identifier     : "

                               + element.getKeyName() + "      value
:"

                               + element.getKeyValue());



                   }

               } catch (NullPointerException e) {

                   // TODO: handle exception

                   System.out.println("no Categorybag");

               }



           }





I'm using :

apache tomcat 5.0.27

apache axis 1.2beta3

apache jUDDI 0.9rc3

HSQLDB 1.7.2.2

IBM UDDI4J





Thank you in advance



Franck WIELGUS




  _____


The Distillery Pty Limited
ABN 69 080 932 467
P.O. Box 940
Dickson ACT, 2602.
Australia
Phone: +61 2 6272 0200
Fax: +61 2 62625151
Web: www.thedistillery.com.au

The Distillery Inc.
2111 Wilson Blvd, Suite 700
Arlington, Virginia 22201
USA
Phone: +1 703 351 5082
Web: www.thedistilleryinc.com

The Distillery (Europe) Ltd
53 Chandos Place
London WC2N 4HS
United Kingdom
Phone: +44 (0)20 7812 6692
Fax: +44 (0)20 7812 6677


  _____


The information contained in this email and any files attached may be
confidential and/or copyrighted information of The Distillery, Third
Parties and/or the intended recipient and may be the subject of legal
privilege or public interest immunity. You may only reproduce or
distribute the material if you are expressly authorised by us to do so.
If you are not the intended recipient, any use, disclosure, copying,
circulation, forwarding, printing or publication of this message or
attached files is strictly forbidden.

If you have received this document in error or are not an intended
recipient, please notify the sender immediately and delete from your
Inbox and/or system.

The Distillery does not represent or warrant that files attached to this
e-mail are free from computer viruses or other defects and liability is
limited to the resupply (or cost of resupply) of the attached files.


  _____




The Distillery Pty Limited
ABN 69 080 932 467
PO Box 940, Dickson ACT 2602, AUSTRALIA
Phone: +61 2 6272 0200
Fax: +61 2 6262 5151
Web: www.thedistillery.com.au

The Distillery Inc
2111 Wilson Blvd, Suite 700,
Arlington, Virginia 22201, USA
Phone: +1 703 351 5082
Web: www.thedistilleryinc.com

The Distillery (Europe) Ltd
53 Chandos Place London WC2N 4HS
Tel: +44 (0)20 7812 6692
Fax: +44 (0)20 7812 6677


---------------------------------------------------------------------
The information contained in this email and any files attached may be
confidential and/or copyrighted information of The Distillery, Third
Parties and/or the intended recipient and may be the subject of legal
privilege or public interest immunity. You may only reproduce or
distribute the material if you are expressly authorised by us to do
so. If you are not the intended recipient, any use, disclosure,
copying, circulation, forwarding, printing or publication of this
message or attached files is strictly forbidden.

If you have received this document in error or are not an intended
recipient, please notify the sender and delete from your Inbox and/or
system.

The Distillery does not represent or warrant that files attached to
this e-mail are free from computer viruses or other defects and
liability is limited to the resupply (or cost of resupply) of the
attached files.
---------------------------------------------------------------------