[ 
https://issues.apache.org/jira/browse/JUDDI-633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13742197#comment-13742197
 ] 

Avinash Ganpat Mahajan commented on JUDDI-633:
----------------------------------------------

This is the XML file for Find service:

{<?xml version="1.0" encoding="utf-8"?>
<find_service xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; maxRows="1000" 
xmlns="urn:uddi-org:api_v3">
  <findQualifiers>
    <findQualifier>approximateMatch</findQualifier>
    <findQualifier>orAllKeys</findQualifier>
  </findQualifiers>
  <name>registration%</name>
  <find_tModel maxRows="1000">
    <categoryBag>
      <keyedReference tModelKey="UDDI-WSMInfo-QoS-cost_of_service" 
keyName="cost_of_service" keyValue="30" />
      <keyedReference tModelKey="UDDI-WSMInfo-QoS-service_provider" 
keyName="service_provider" keyValue="google" />
      <keyedReference tModelKey="UDDI-WSMInfo-QoS-service_location" 
keyName="service_location" keyValue="IND" />
    </categoryBag>
  </find_tModel>
</find_service>}        

This is the xml file when i am directlly passing QoS Keyedreferences in find 
service.

and by another way i am 1st finding services and then getting details about 
that service, I am going through its TMODelInstanceInfo to find tModel.

Actually i am not able to use that XMLserializable class thats why posting here 
the code.
Sorry for that..


Code:


//Declaring object of FindService and adding name of service to it.
            FindService find_service = new FindService();
            find_service.Names.Add(service_name);

    
            //adding qualifier ApproximateMatch
            find_service.FindQualifiers.Add(FindQualifier.ApproximateMatch);
           find_service.FindQualifiers.Add(FindQualifier.OrAllKeys);
           
          
            //Sending find service request over uddi connection.
            ServiceList list = new ServiceList();
            list = find_service.Send(myconn);

            int service_found = list.ServiceInfos.Count;
         
            if (service_found != 0)
            {
                //Writing results into file from list of service infos.
                foreach (ServiceInfo service_Info in list.ServiceInfos)
                {
                    
                   file.WriteLine("Service: {0} ({1})", 
service_Info.Names[0].Text, service_Info.ServiceKey + "\r\n");


                   GetServiceDetail dtl = new 
GetServiceDetail(service_Info.ServiceKey);


                   ServiceDetail dt = dtl.Send(myconn);
                   foreach (BusinessService bis in dt.BusinessServices)
                   {
                       foreach (BindingTemplate bt in bis.BindingTemplates)
                       {


                           foreach (TModelInstanceInfo tinf in 
bt.TModelInstanceInfos)
                           {
                               file.WriteLine("TModel Key for service :" + 
tinf.TModelKey);
                               

                               FindTModel tmd = new FindTModel(tinf.TModelKey);

                              // Adding keyedreferences which are QoS 
attributes specified in UDDI to search.
                               
tmd.CategoryBag.KeyedReferences.Add("UDDI-WSMInfo-QoS-cost_of_service", 
service_cost, "cost_of_service");
                               
tmd.CategoryBag.KeyedReferences.Add("UDDI-WSMInfo-QoS-service_provider", 
service_provider, "service_provider");
                               
tmd.CategoryBag.KeyedReferences.Add("UDDI-WSMInfo-QoS-service_location", 
service_location, "service_location");

                               tmd.FindQualifiers.Add(FindQualifier.OrAllKeys);
                                
tmd.FindQualifiers.Add(FindQualifier.ApproximateMatch);
                               

                               TModelList ls = tmd.Send(myconn);

                               file.WriteLine("tmodels got:" + 
ls.TModelInfos.Count);

                               foreach (TModelInfo inf in ls.TModelInfos)
                               {
                                   file.WriteLine("tmodel:" + inf.TModelKey);
                               }

                           }
                       }

                   }

                }

                   
            }

                
> Building a Find Qualifiers for comparison operator such as "greater then" and 
> "less than".
> ------------------------------------------------------------------------------------------
>
>                 Key: JUDDI-633
>                 URL: https://issues.apache.org/jira/browse/JUDDI-633
>             Project: jUDDI
>          Issue Type: New Feature
>          Components: juddi-tomcat
>    Affects Versions: 3.1.5
>         Environment: Windows 8 Pro.
> Tomcat 7.0
> MySQL 5.6
>            Reporter: Avinash Ganpat Mahajan
>            Assignee: Kurt T Stam
>              Labels: features
>             Fix For: 3.1.5
>
>   Original Estimate: 1,224h
>  Remaining Estimate: 1,224h
>
> I am trying to implement QoS aware UDDI searching mechanism.
> As QoS attributes are stored in KeyedReferences so needs to have some 
> qualifiers to give flexibility for searching such as for cost.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to