Right I get it now!

This a bug in the generation of the objects. It's not wrong per se, but it is very tedious to use this way and we should fix it.

For example: In our own code we iterate over the 'content' like shown below, but
we should simply manually fix the OverviewDoc object and replace

List<JAXBElement<?>> content

with

List<Description>description
OverviewURL overviewURL

and add the JAXB annotations on them.

Like you mentioned there are other places we need to fix this too. It should be pretty straightforward.
Thank you for your question. It'd be great if you can add a jira.
If you want to give it shot fixing it, we'd greatly appreciate a patch :)!

Cheers,

--Kurt

public static boolean compareOverviewDocs(OverviewDoc doc1, OverviewDoc doc2) { boolean descMatch=false;
       boolean urlMatch =false;
       List<JAXBElement<?>> odElem1List = doc1.getContent();
       Iterator<JAXBElement<?>> odElem1 = odElem1List.iterator();
       while (odElem1.hasNext()) {
           JAXBElement<?> odElement1 = odElem1.next();
if (odElement1.getValue() instanceof org.uddi.api_v3.Description) {
               Description descr1 = (Description) odElement1.getValue();
               List<JAXBElement<?>> odElem2List = doc2.getContent();
               Iterator<JAXBElement<?>> odElem2 = odElem2List.iterator();
               while (odElem2.hasNext()) {
                   JAXBElement<?> odElement2 = odElem2.next();
if (odElement2.getValue() instanceof org.uddi.api_v3.Description) { Description descr2 = (Description) odElement2.getValue(); if (descr1.getLang().equals(descr2.getLang()) && descr1.getValue().equals(descr2.getValue())) {
                           descMatch=true;
                           break;
                       }
                   }
               }
} else if (odElement1.getValue() instanceof org.uddi.api_v3.OverviewURL) {
               OverviewURL url1 = (OverviewURL) odElement1.getValue();
               List<JAXBElement<?>> odElem2List = doc2.getContent();
               Iterator<JAXBElement<?>> odElem2 = odElem2List.iterator();
               while (odElem2.hasNext()) {
                   JAXBElement<?> odElement2 = odElem2.next();
if (odElement2.getValue() instanceof org.uddi.api_v3.OverviewURL) { OverviewURL url2 = (OverviewURL) odElement2.getValue(); if (url1.getUseType().equals(url2.getUseType()) && url1.getValue().equals(url2.getValue())) {
                           urlMatch=true;
                           break;
                       }
                   }
               }
           }
if (urlMatch && descMatch || ( odElem1List.size()==1 && (urlMatch || descMatch)) ) {
               return true;
           }
       }
       return false;
   }



建平 王 wrote:
Thanks for your reply, also for your praise of my nickname.
I could not express clearly the problem I met. I have noticed that TModel have "getOverviewDoc.add(yourOverviewDoc)" method. My problem is how to initialize OverviewDoc with a OverviewURL object.
In previous juddi version, I do it as follows:
        OverviewDoc od = new OverviewDoc();
        OverviewURL ou = new OverviewURL();
ou.setValue("http://localhost:8080/axis2/services/HelloWorld?wsdl";);
then  od.setOverviewURL(ou);  I have not found this method.

Same things like CategoryBag object. I know TModel object directly have the setCategoryBag method. But CategoryBag seems have no method to initialize itself. Such as CategoryBag.setKeyedReference() method.

Waiting for your help and sincerely appreciate!

Sunshine Wang


------------------------------------------------------------------------
好玩贺卡等你发,邮箱贺卡全新上线! <http://cn.rd.yahoo.com/mail_cn/tagline/card/*http://card.mail.cn.yahoo.com/>


Reply via email to