You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by Edgar Orduña <ed...@gmail.com> on 2013/02/18 21:45:45 UTC

Find Services

Hi

I have services registered in JUDDI but I'm searching a example to find
Services.
do you have any example?

Thank you so much

Re: Find Services

Posted by Kurt T Stam <ku...@gmail.com>.
Hi Edgar,

The WSDL is not stored in the registry. A service can have multiple 
BindingTemplates each of which contain a link to the either the endpoint 
of the service itself or a link to where to obtain the WSDL (the 
accessUrl in the BindingTemplate).

Hope this helps.

Cheers,

--Kurt



On 3/8/13 10:42 AM, Edgar Orduña wrote:
> Hi
>
> Do you know how can i get the URL of the WSDL from the service?
>
> i have this code but i get the name of the service and i want to get 
> the url from the wsdl
>
>
>
> public class JuddiFind {
>
> public static void main(String[] args) {
> find("%");
> }
>
>
> public static void find(String serviceName) {
>
>         try {
>
>             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");
>
>
>               UDDISecurityPortType security = 
> transport.getUDDISecurityService();
>
>               JUDDIApiPortType juddiApi = transport.getJUDDIApiService();
>
>               UDDIPublicationPortType publish = 
> transport.getUDDIPublishService();
>  UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
>
>
> GetAuthToken getAuthTokenRoot = new GetAuthToken();
>
> getAuthTokenRoot.setUserID("root");
>
> getAuthTokenRoot.setCred("root");
>
> org.uddi.api_v3.AuthToken rootAuthToken = 
> security.getAuthToken(getAuthTokenRoot);
>
> System.out.println ("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
> FindService find=new FindService();
> FindTModel findModel=new FindTModel();
> Name findName=new Name();
> findName.setValue(serviceName);
> findModel.setListHead(0);
> findModel.setMaxRows(5);
> findModel.setAuthInfo(rootAuthToken.getAuthInfo());
> find.getName().add(findName);
> FindQualifiers qualifiers=new FindQualifiers();
> qualifiers.getFindQualifier().add("approximateMatch");
> findModel.setFindQualifiers(qualifiers);
> find.setAuthInfo(rootAuthToken.getAuthInfo());
> find.setMaxRows(5);
> find.setListHead(0);
> find.setFindQualifiers(qualifiers);
> ServiceList foundList = inquiry.findService(find);
> if(foundList.getServiceInfos()!=null)
> {
> if(foundList.getServiceInfos().getServiceInfo()!=null)
> {
> System.out.println(
> "Services "+ foundList.getServiceInfos().getServiceInfo().size()+"\n");
> for(ServiceInfo info:foundList.getServiceInfos().getServiceInfo())
> {
> System.out.println("\nName: "+info.getName().get(0).getValue());
> }
> }
> else
> {
> System.out.println("\n Ooops: 
> foundList.getServiceInfos().getServiceInfo() este null!\n");
> }
> }
> else
> {
> System.out.println("\n Ooops: foundList.getServiceInfos() este null!\n");
> }
>           }
>
>       }
>   }
> }
>
>
>
>
> Thank you so much


Re: Find Services

Posted by Edgar Orduña <ed...@gmail.com>.
Hi

Do you know how can i get the URL of the WSDL from the service?

i have this code but i get the name of the service and i want to get the
url from the wsdl



public class JuddiFind {

 public static void main(String[] args) {
 find("%");
  }


public static void find(String serviceName) {

        try {

            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");


              UDDISecurityPortType security =
transport.getUDDISecurityService();

              JUDDIApiPortType juddiApi = transport.getJUDDIApiService();

              UDDIPublicationPortType publish =
transport.getUDDIPublishService();
  UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();


GetAuthToken getAuthTokenRoot = new GetAuthToken();

getAuthTokenRoot.setUserID("root");

getAuthTokenRoot.setCred("root");


org.uddi.api_v3.AuthToken rootAuthToken =
security.getAuthToken(getAuthTokenRoot);

System.out.println ("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
 FindService find=new FindService();
 FindTModel findModel=new FindTModel();
 Name findName=new Name();
 findName.setValue(serviceName);
 findModel.setListHead(0);
 findModel.setMaxRows(5);
 findModel.setAuthInfo(rootAuthToken.getAuthInfo());
 find.getName().add(findName);
 FindQualifiers qualifiers=new FindQualifiers();
 qualifiers.getFindQualifier().add("approximateMatch");
 findModel.setFindQualifiers(qualifiers);
 find.setAuthInfo(rootAuthToken.getAuthInfo());
 find.setMaxRows(5);
 find.setListHead(0);
 find.setFindQualifiers(qualifiers);
 ServiceList foundList = inquiry.findService(find);
 if(foundList.getServiceInfos()!=null)
{
if(foundList.getServiceInfos().getServiceInfo()!=null)
{
System.out.println(
"Services "+ foundList.getServiceInfos().getServiceInfo().size()+"\n");
 for(ServiceInfo info:foundList.getServiceInfos().getServiceInfo())
{
System.out.println("\nName: "+info.getName().get(0).getValue());
}
 }
 else
{
System.out.println("\n Ooops: foundList.getServiceInfos().getServiceInfo()
este null!\n");
}
}
else
{
System.out.println("\n Ooops: foundList.getServiceInfos() este null!\n");
}
          }

      }
  }
}




Thank you so much

Re: Find Services

Posted by Kurt T Stam <ku...@gmail.com>.
Yes, you can use the juddi-client. For our own testing we created the 
tck module:

for finding a service see:

http://svn.apache.org/repos/asf/juddi/tags/juddi-3.1.3/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_110_FindServicesIntegrationTest.java

Hope this helps,

--Kurt

On 2/18/13 3:49 PM, Alex O'Ree wrote:
> I'm sure juddi has a direct java api for doing so, but I've always
> done my interactions with uddi by starting with the wsdls and xsds
> from oasis.
> The procedure is something like, create a business entity, create a
> service, create a binding, then add the endpoint to the binding.
>
> On Mon, Feb 18, 2013 at 3:45 PM, Edgar Orduña <ed...@gmail.com> wrote:
>> Hi
>>
>> I have services registered in JUDDI but I'm searching a example to find
>> Services.
>> do you have any example?
>>
>> Thank you so much


Re: Find Services

Posted by Alex O'Ree <sp...@gmail.com>.
I'm sure juddi has a direct java api for doing so, but I've always
done my interactions with uddi by starting with the wsdls and xsds
from oasis.
The procedure is something like, create a business entity, create a
service, create a binding, then add the endpoint to the binding.

On Mon, Feb 18, 2013 at 3:45 PM, Edgar Orduña <ed...@gmail.com> wrote:
> Hi
>
> I have services registered in JUDDI but I'm searching a example to find
> Services.
> do you have any example?
>
> Thank you so much