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