You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by chainerlt <ch...@gmail.com> on 2011/02/21 11:00:50 UTC
juddiv3 (3.0.4) finding all business/services
Hello,
I've been looking for this answer for like a week now. Seems like I've
googled everything and everywhere. Even posted in this forum:
http://old.nabble.com/Re%3A-jUDDIv3.-Find-all-services.-td28329206.html here
. So here is my story:
I'm using juddi-portal-bundle-3.0.4 at the moment. Juddy behaves happy and
works properly, but here comes some problems (or lack of my knowledge) when
I wanna get a list of all business and/or services.
So I was learning juddi for a while and now I'm able to manage
business/services via soapui (let's say in a manual way) or programmatically
(via java). So I've created some temp business with services and here's how
they look from UDDIBrowser Portlet:
http://old.nabble.com/file/p30975809/uddibrowserportlet.png
I've read that for searching all business you need to use search name "%",
but seems like it is not working for me. I've tried both: programmatically
and via soapui:
> import org.apache.juddi.ClassUtil;
> import org.apache.juddi.api_v3.*;
> import org.apache.juddi.v3.client.config.UDDIClientContainer;
> import org.apache.juddi.v3.client.transport.Transport;
> import org.apache.juddi.v3_service.JUDDIApiPortType;
> import org.uddi.api_v3.*;
> import org.uddi.v3_service.*;
> ...
> private static UDDISecurityPortType security = null;
> private static JUDDIApiPortType juddiApi = null;
> private static UDDIPublicationPortType publish = null;
> private static UDDIInquiryPortType inquiry = null;
>
> public Tools() throws Exception
> {
> String clazz =
> UDDIClientContainer.getUDDIClerkManager(null).getClientConfig()
> .getUDDINode("default").getProxyTransport();
> Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
> if (transportClass != null)
> {
> Transport transport = (Transport)
> transportClass.getConstructor(String.class)
> .newInstance("default");
> security = transport.getUDDISecurityService();
> juddiApi = transport.getJUDDIApiService();
> publish = transport.getUDDIPublishService();
> inquiry = transport.getUDDIInquiryService();
> }
> }
> ...
> public BusinessList findBusiness(String searchPattern) throws
> Exception
> {
> FindBusiness fb = new FindBusiness();
> Name findName = new Name();
> findName.setValue(searchPattern);
> fb.getName().add(findName);
> return inquiry.findBusiness(fb);
> }
> ...
> findBusiness("%");
>
It brings me empty BusinessList. Here's how it looks while debugging:
http://old.nabble.com/file/p30975809/debugFindBusinessWildCard.png
However it works when I search for exact business name, for instance "My
Business2":
http://old.nabble.com/file/p30975809/MyBusiness2found.png
Same via soapUI (3.6.1):
Request:
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:uddi-org:api_v3">
> <soapenv:Header/>
> <soapenv:Body>
> <urn:find_business>
> <!--Zero or more repetitions:-->
> <urn:name>My Business2</urn:name>
> </urn:find_business>
> </soapenv:Body>
> </soapenv:Envelope>
>
Respond:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <businessList xmlns:ns10="urn:uddi-org:policy_v3_instanceParms"
> xmlns:ns9="urn:uddi-org:vs_v3" xmlns:ns8="urn:uddi-org:repl_v3"
> xmlns:ns7="urn:uddi-org:policy_v3" xmlns:ns6="urn:uddi-org:subr_v3"
> xmlns:ns5="urn:uddi-org:sub_v3" xmlns:ns4="urn:uddi-org:vscache_v3"
> xmlns:ns3="urn:uddi-org:custody_v3"
> xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"
> xmlns="urn:uddi-org:api_v3">
> <listDescription>
> <includeCount>1</includeCount>
> <actualCount>1</actualCount>
> <listHead>1</listHead>
> </listDescription>
> <businessInfos>
> <businessInfo
> businessKey="uddi:juddi.apache.org:c0d12d2f-9f8b-4444-acae-675f8f53383f">
> <name>My Business2</name>
> <serviceInfos>
> <serviceInfo
> businessKey="uddi:juddi.apache.org:c0d12d2f-9f8b-4444-acae-675f8f53383f"
> serviceKey="uddi:juddi.apache.org:beed92d4-57b5-4974-9e56-17d846f2cca2">
> <name>My Service2</name>
> </serviceInfo>
> </serviceInfos>
> </businessInfo>
> </businessInfos>
> </businessList>
> </soap:Body>
> </soap:Envelope>
>
But finds nothing with "%" (or "*" or other 100 symbols and combinations
I've tried (including xpath and other expressions):
Request:
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:uddi-org:api_v3">
> <soapenv:Header/>
> <soapenv:Body>
> <urn:find_business>
> <!--Zero or more repetitions:-->
> <urn:name>%</urn:name>
> </urn:find_business>
> </soapenv:Body>
> </soapenv:Envelope>
>
Respond:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <businessList xmlns:ns10="urn:uddi-org:policy_v3_instanceParms"
> xmlns:ns9="urn:uddi-org:vs_v3" xmlns:ns8="urn:uddi-org:repl_v3"
> xmlns:ns7="urn:uddi-org:policy_v3" xmlns:ns6="urn:uddi-org:subr_v3"
> xmlns:ns5="urn:uddi-org:sub_v3" xmlns:ns4="urn:uddi-org:vscache_v3"
> xmlns:ns3="urn:uddi-org:custody_v3"
> xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"
> xmlns="urn:uddi-org:api_v3">
> <listDescription>
> <includeCount>0</includeCount>
> <actualCount>0</actualCount>
> <listHead>0</listHead>
> </listDescription>
> </businessList>
> </soap:Body>
> </soap:Envelope>
>
I've read about MetaMatrix (found smth:
http://lists.jboss.org/pipermail/federate-commits/2008-November/000002.html
here ) but seems like it's not free. Also tried using some other libraries,
but vainly. However that "%" pattern seems to be very logic and seems like
everybody is using this way of finding all objects, but I cannot figure out
why it does not work. I really would love to get some answers or suggestions
cause I feel stuck :/ . Thanks for reading and taking time.
--
View this message in context: http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30975809p30975809.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
RE: juddiv3 (3.0.4) finding all business/services
Posted by Jeff Faath <jf...@apache.org>.
You should switch over to the new mailing list:
user@juddi.apache.org
I've been telling you to use that solution for the last week. Would have
saved you a week's worth of work anyway.
-JF
-----Original Message-----
From: chainerlt [mailto:chainerlt@gmail.com]
Sent: Friday, February 25, 2011 6:01 AM
To: juddi-user@ws.apache.org
Subject: Re: juddiv3 (3.0.4) finding all business/services
Solution:
So the main trick was to set findqualifier "APPROXIMATE_MATCH" or if you
would look into its class:
> package org.apache.juddi.query.util;
>
> import org.uddi.api_v3.FindQualifiers;
>
> public class FindQualifiers
> {
> ...
> public static final String APPROXIMATE_MATCH = "approximateMatch";
> ...
>
And now only adding this approximate match qualifier + name "%" it works.
> org.uddi.api_v3.Name name = new org.uddi.api_v3.Name();
> name.setValue("%");
> org.uddi.api_v3.FindQualifiers qualifiers = new
> org.uddi.api_v3.FindQualifiers();
>
>
qualifiers.getFindQualifier().add(org.apache.juddi.query.util.FindQualifiers
.APPROXIMATE_MATCH);
>
> // find business
> org.uddi.api_v3.FindBusiness findBusiness = new
> org.uddi.api_v3.FindBusiness();
> findBusiness.getName().add(name);
> findBusiness.setFindQualifiers(qualifiers);
>
> BusinessList lst; = inquiry.findBusiness(findBusiness);
>
Note:
you can find this class in "[b]juddi-core-3.0.4.jar[/b]". Or you can just
write String manualy:
> ...
> qualifiers.getFindQualifier().add("approximateMatch");
> ...
>
Maybe this will help someone, since I had to find out this by myself and it
took few days :/
Good luck!
--
View this message in context:
http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30
975809p31012395.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
Re: juddiv3 (3.0.4) finding all business/services
Posted by chainerlt <ch...@gmail.com>.
Solution:
So the main trick was to set findqualifier "APPROXIMATE_MATCH" or if you
would look into its class:
> package org.apache.juddi.query.util;
>
> import org.uddi.api_v3.FindQualifiers;
>
> public class FindQualifiers
> {
> ...
> public static final String APPROXIMATE_MATCH = "approximateMatch";
> ...
>
And now only adding this approximate match qualifier + name "%" it works.
> org.uddi.api_v3.Name name = new org.uddi.api_v3.Name();
> name.setValue("%");
> org.uddi.api_v3.FindQualifiers qualifiers = new
> org.uddi.api_v3.FindQualifiers();
>
> qualifiers.getFindQualifier().add(org.apache.juddi.query.util.FindQualifiers.APPROXIMATE_MATCH);
>
> // find business
> org.uddi.api_v3.FindBusiness findBusiness = new
> org.uddi.api_v3.FindBusiness();
> findBusiness.getName().add(name);
> findBusiness.setFindQualifiers(qualifiers);
>
> BusinessList lst; = inquiry.findBusiness(findBusiness);
>
Note:
you can find this class in "[b]juddi-core-3.0.4.jar[/b]". Or you can just
write String manualy:
> ...
> qualifiers.getFindQualifier().add("approximateMatch");
> ...
>
Maybe this will help someone, since I had to find out this by myself and it
took few days :/
Good luck!
--
View this message in context: http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30975809p31012395.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
Re: juddiv3 (3.0.4) finding all business/services
Posted by chainerlt <ch...@gmail.com>.
I also noticed, that search pattern "%" works on juddi 0.9rc4. But juddi
0.9rc4 itself works only on java15. So I tried to run juddiv3 (3.0.4) on
java15, but the wildcard "%" still searches zero business/services. Any
ideas?
--
View this message in context: http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30975809p30983970.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
RE: juddiv3 (3.0.4) finding all business/services
Posted by Jeff Faath <jf...@apache.org>.
Did you use the find qualifier as I suggested?
Ex.
FindQualifiers fq = new FindQualifiers();
fq.getFindQualifier().add(org.apache.juddi.query.util.FindQualifiers.APPROXI
MATE_MATCH);
Then add it to your Find* object
fb.setFindQualifiers(fq);
And do the search with '%' as the name search pattern.
-----Original Message-----
From: chainerlt [mailto:chainerlt@gmail.com]
Sent: Tuesday, February 22, 2011 3:11 AM
To: juddi-user@ws.apache.org
Subject: Re: juddiv3 (3.0.4) finding all business/services
I also noticed, that search pattern "%" works on juddi 0.9rc4. But juddi
0.9rc4 itself works only on java15. So I tried to run juddiv3 (3.0.4) on
java15, but the wildcard "%" still searches zero business/services. Any
ideas?
--
View this message in context:
http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30
975809p30983998.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
Re: juddiv3 (3.0.4) finding all business/services
Posted by chainerlt <ch...@gmail.com>.
I also noticed, that search pattern "%" works on juddi 0.9rc4. But juddi
0.9rc4 itself works only on java15. So I tried to run juddiv3 (3.0.4) on
java15, but the wildcard "%" still searches zero business/services. Any
ideas?
--
View this message in context: http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30975809p30983998.html
Sent from the jUDDI - User mailing list archive at Nabble.com.
RE: juddiv3 (3.0.4) finding all business/services
Posted by Jeff Faath <jf...@apache.org>.
Try using the "approximateMatch" find qualifier with you search using '%'.
http://uddi.org/pubs/uddi-v3.0.2-20041019.htm#_Toc85908080
-JF
-----Original Message-----
From: chainerlt [mailto:chainerlt@gmail.com]
Sent: Monday, February 21, 2011 4:01 AM
To: juddi-user@ws.apache.org
Subject: juddiv3 (3.0.4) finding all business/services
Hello,
I've been looking for this answer for like a week now. Seems like I've
googled everything and everywhere. Even posted in this forum:
http://old.nabble.com/Re%3A-jUDDIv3.-Find-all-services.-td28329206.html here
. So here is my story:
I'm using juddi-portal-bundle-3.0.4 at the moment. Juddy behaves happy and
works properly, but here comes some problems (or lack of my knowledge) when
I wanna get a list of all business and/or services.
So I was learning juddi for a while and now I'm able to manage
business/services via soapui (let's say in a manual way) or programmatically
(via java). So I've created some temp business with services and here's how
they look from UDDIBrowser Portlet:
http://old.nabble.com/file/p30975809/uddibrowserportlet.png
I've read that for searching all business you need to use search name "%",
but seems like it is not working for me. I've tried both: programmatically
and via soapui:
> import org.apache.juddi.ClassUtil;
> import org.apache.juddi.api_v3.*;
> import org.apache.juddi.v3.client.config.UDDIClientContainer;
> import org.apache.juddi.v3.client.transport.Transport;
> import org.apache.juddi.v3_service.JUDDIApiPortType;
> import org.uddi.api_v3.*;
> import org.uddi.v3_service.*;
> ...
> private static UDDISecurityPortType security = null;
> private static JUDDIApiPortType juddiApi = null;
> private static UDDIPublicationPortType publish = null;
> private static UDDIInquiryPortType inquiry = null;
>
> public Tools() throws Exception
> {
> String clazz =
> UDDIClientContainer.getUDDIClerkManager(null).getClientConfig()
> .getUDDINode("default").getProxyTransport();
> Class<?> transportClass = ClassUtil.forName(clazz,
Transport.class);
> if (transportClass != null)
> {
> Transport transport = (Transport)
> transportClass.getConstructor(String.class)
> .newInstance("default");
> security = transport.getUDDISecurityService();
> juddiApi = transport.getJUDDIApiService();
> publish = transport.getUDDIPublishService();
> inquiry = transport.getUDDIInquiryService();
> }
> }
> ...
> public BusinessList findBusiness(String searchPattern) throws
> Exception
> {
> FindBusiness fb = new FindBusiness();
> Name findName = new Name();
> findName.setValue(searchPattern);
> fb.getName().add(findName);
> return inquiry.findBusiness(fb);
> }
> ...
> findBusiness("%");
>
It brings me empty BusinessList. Here's how it looks while debugging:
http://old.nabble.com/file/p30975809/debugFindBusinessWildCard.png
However it works when I search for exact business name, for instance "My
Business2":
http://old.nabble.com/file/p30975809/MyBusiness2found.png
Same via soapUI (3.6.1):
Request:
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:uddi-org:api_v3">
> <soapenv:Header/>
> <soapenv:Body>
> <urn:find_business>
> <!--Zero or more repetitions:-->
> <urn:name>My Business2</urn:name>
> </urn:find_business>
> </soapenv:Body>
> </soapenv:Envelope>
>
Respond:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <businessList xmlns:ns10="urn:uddi-org:policy_v3_instanceParms"
> xmlns:ns9="urn:uddi-org:vs_v3" xmlns:ns8="urn:uddi-org:repl_v3"
> xmlns:ns7="urn:uddi-org:policy_v3" xmlns:ns6="urn:uddi-org:subr_v3"
> xmlns:ns5="urn:uddi-org:sub_v3" xmlns:ns4="urn:uddi-org:vscache_v3"
> xmlns:ns3="urn:uddi-org:custody_v3"
> xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"
> xmlns="urn:uddi-org:api_v3">
> <listDescription>
> <includeCount>1</includeCount>
> <actualCount>1</actualCount>
> <listHead>1</listHead>
> </listDescription>
> <businessInfos>
> <businessInfo
> businessKey="uddi:juddi.apache.org:c0d12d2f-9f8b-4444-acae-675f8f53383f">
> <name>My Business2</name>
> <serviceInfos>
> <serviceInfo
> businessKey="uddi:juddi.apache.org:c0d12d2f-9f8b-4444-acae-675f8f53383f"
> serviceKey="uddi:juddi.apache.org:beed92d4-57b5-4974-9e56-17d846f2cca2">
> <name>My Service2</name>
> </serviceInfo>
> </serviceInfos>
> </businessInfo>
> </businessInfos>
> </businessList>
> </soap:Body>
> </soap:Envelope>
>
But finds nothing with "%" (or "*" or other 100 symbols and combinations
I've tried (including xpath and other expressions):
Request:
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:urn="urn:uddi-org:api_v3">
> <soapenv:Header/>
> <soapenv:Body>
> <urn:find_business>
> <!--Zero or more repetitions:-->
> <urn:name>%</urn:name>
> </urn:find_business>
> </soapenv:Body>
> </soapenv:Envelope>
>
Respond:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <businessList xmlns:ns10="urn:uddi-org:policy_v3_instanceParms"
> xmlns:ns9="urn:uddi-org:vs_v3" xmlns:ns8="urn:uddi-org:repl_v3"
> xmlns:ns7="urn:uddi-org:policy_v3" xmlns:ns6="urn:uddi-org:subr_v3"
> xmlns:ns5="urn:uddi-org:sub_v3" xmlns:ns4="urn:uddi-org:vscache_v3"
> xmlns:ns3="urn:uddi-org:custody_v3"
> xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"
> xmlns="urn:uddi-org:api_v3">
> <listDescription>
> <includeCount>0</includeCount>
> <actualCount>0</actualCount>
> <listHead>0</listHead>
> </listDescription>
> </businessList>
> </soap:Body>
> </soap:Envelope>
>
I've read about MetaMatrix (found smth:
http://lists.jboss.org/pipermail/federate-commits/2008-November/000002.html
here ) but seems like it's not free. Also tried using some other libraries,
but vainly. However that "%" pattern seems to be very logic and seems like
everybody is using this way of finding all objects, but I cannot figure out
why it does not work. I really would love to get some answers or suggestions
cause I feel stuck :/ . Thanks for reading and taking time.
--
View this message in context:
http://old.nabble.com/juddiv3-%283.0.4%29-finding-all-business-services-tp30
975809p30975809.html
Sent from the jUDDI - User mailing list archive at Nabble.com.