Oh, I misunderstood.  I thought you wanted to search for the tmodels of a 
service by a given name.

 

To retrieve the names of tmodels for a given service, you would drill down as 
you’ve done to the tmodel instance details of the binding template.  But then, 
once you had the tmodel keys, you would then make a call to get_tModelDetail 
which would return the full tmodel details including name.  You can supply an 
array of keys to that call and an array of the desired tmodels will  be 
returned.

 

From: Sofiene Sofiene [mailto:[email protected]] 
Sent: Friday, April 29, 2011 12:36 PM
To: [email protected]
Subject: Re : Get tModel name for a Web Service

 

Thank you for the reply :) 

In my case, there aren't any indication about the tModel name. So, I would 
search them by key, not by name.


I would find a WS by a given name, then print the key (done) of its tModels, 
and their names (done, but two loops).
I want to optimize my code. There is any other way ?

Thanks

  _____  

De : Jeff Faath <[email protected]>
À : [email protected]
Envoyé le : Ven 29 avril 2011, 18h 20min 49s
Objet : RE: Get tModel name for a Web Service




You can embed a “find_tmodel” search within any of the other “find” searches 
like find_service that will allow you to get services that contain tmodels 
within a given name.  Here’s a link to the spec for find_service.

 

http://uddi.org/pubs/uddi-v3.0.2-20041019.htm#_Toc85908088

 

From: Sofiene Sofiene [mailto:[email protected]] 
Sent: Friday, April 29, 2011 10:58 AM
To: [email protected]
Subject: Re : Get tModel name for a Web Service

 

To get all the name, I used another way, but it consumes too much resources, 
there two loops, one on the tModel of the WS, and the other on all the tModels 
in the databse.
It compare the keys.

-
// Get tModels
                    // tModels of the WS
                    TModelInstanceDetails tModelInstanceDetails = 
(TModelInstanceDetails) bindingTemplateFound.getTModelInstanceDetails();
                    // List of All tModels
                    TModelList tModelList = proxy.find_tModel("%", null, null, 
null, 0);
                    Vector tModelInfoVector = 
tModelList.getTModelInfos().getTModelInfoVector();
                    // loop tModels of the WS
                    for (int j = 0; j < tModelInstanceDetails.size(); j++) {
                        TModelInstanceInfo tModelInstanceInfo = 
(TModelInstanceInfo) tModelInstanceDetails.get(j);
                        // loop of all tModels
                        for (int k = 0; k < tModelInfoVector.size(); k++) {
                            TModelInfo tModelInfo = (TModelInfo) 
tModelInfoVector.elementAt(k);
                            // Print name and key for each tModel
                            if 
(tModelInstanceInfo.getTModelKey().equals(tModelInfo.getTModelKey())) {
                                System.out.println("TModel name: " + 
tModelInfo.getNameString());
                                System.out.println("TModel Key: " + 
tModelInfo.getTModelKey());
                            }
                        }
                    }
-

 

 

  _____  

De : Sofiene Sofiene <[email protected]>
À : [email protected]
Envoyé le : Ven 29 avril 2011, 16h 54min 19s
Objet : Get tModel name for a Web Service



Hi,
I want to get all the tModels name for a Web Service.

After finding a Web Service, I get the ServiceInfosVector, and then, the 
Service Info:
-
                ServiceInfo serviceInfo = (ServiceInfo) 
serviceInfoVector.elementAt(0);
-
Then the BindingTemplate for this WebService:
-
                BindingDetail bindingDetailReturned = proxy.find_binding(null, 
serviceInfo.getServiceKey(), null, 5);
                Vector bindingTemplatesFound = 
bindingDetailReturned.getBindingTemplateVector();
                    BindingTemplate bindingTemplateFound = (BindingTemplate) 
(bindingTemplatesFound.elementAt(0));
-

After that, I get the tModelInstanceInfo :
-
                    TModelInstanceDetails tModelInstanceDetails = 
(TModelInstanceDetails) bindingTemplateFound.getTModelInstanceDetails();
                    //loop
                    TModelInstanceInfo tModelInstanceInfo = 
(TModelInstanceInfo) tModelInstanceDetails.get(0);    
-

With this approach, I can only get the tModelKey, not the tModelName :
tModelInstanceInfo.getTModelKey()

I haven't found a way to search tModelName for a Web Service specified.
Can't search tModel by tModelKey ?


Thanks

Reply via email to