axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@tmax.co.kr>
Subject RE: Question on fromJava.Emitter
Date Tue, 27 Apr 2004 03:19:51 GMT
More specifically,

            // Add the fault to the binding
            BindingFault bFault = def.createBindingFault();

            bFault.setName(faultDesc.getName());

            SOAPFault soapFault = writeSOAPFault(faultDesc);

            bFault.addExtensibilityElement(soapFault);
            bindingOper.addBindingFault(bFault);

[line 1082~1090] in writeMessages and

                // Get a soap:fault
                ExtensibilityElement soapFault = writeSOAPFault(faultDesc);

                // Get a wsdl:fault to put the soap:fault in
                BindingFault bindingFault = new BindingFaultImpl();

                bindingFault.setName(faultDesc.getName());
                bindingFault.addExtensibilityElement(soapFault);
                bindingOper.addBindingFault(bindingFault);

[line 1209~1217] in writeBindingOperation are duplicated. Those parts do
the same job, adding a SOAP fault to bindingOperation. I suggest removing 

        ArrayList faultList = desc.getFaults();

        if (faultList != null) {
            for (Iterator it = faultList.iterator(); it.hasNext();) {
                FaultDesc faultDesc = (FaultDesc) it.next();

                // Get a soap:fault
                ExtensibilityElement soapFault = writeSOAPFault(faultDesc);

                // Get a wsdl:fault to put the soap:fault in
                BindingFault bindingFault = new BindingFaultImpl();

                bindingFault.setName(faultDesc.getName());
                bindingFault.addExtensibilityElement(soapFault);
                bindingOper.addBindingFault(bindingFault);
            }
        }

[line 1202~1219] in writeBindingOperation because writeMessages has
efficient iteration with more works at a time.

Thanks,

Ias

=========================================================
Lee, Changshin (Korean name)
Ias (International name)
               Company Web Site: http://www.tmax.co.kr
               Personal Web Site: http://www.iasandcb.pe.kr
---------------------------------------------------------
JSR 201, 204, 222 and 224 Expert Group Member
Apache Web Services Project Member
R&D Center
Tmax Soft, Inc.
========================================================= 

> -----Original Message-----
> From: Ias [mailto:iasandcb@tmax.co.kr] 
> Sent: Monday, April 26, 2004 12:14 PM
> To: axis-dev@ws.apache.org
> Subject: Question on fromJava.Emitter
> 
> In writeMessages method,
> 
>         ArrayList exceptions = desc.getFaults();
> 
>         for (int i = 0; (exceptions != null) && (i < 
> exceptions.size());
> i++) {
>             FaultDesc faultDesc = (FaultDesc) exceptions.get(i);
> 
>             msg = writeFaultMessage(def, faultDesc);
> 
>             // Add the fault to the portType
>             Fault fault = def.createFault();
> 
>             fault.setMessage(msg);
>             fault.setName(faultDesc.getName());
>             oper.addFault(fault);
> 
>             // Add the fault to the binding
>             BindingFault bFault = def.createBindingFault();
> 
>             bFault.setName(faultDesc.getName());
> 
>             SOAPFault soapFault = writeSOAPFault(faultDesc);
> 
>             bFault.addExtensibilityElement(soapFault);
>             bindingOper.addBindingFault(bFault);
> 
>             // Add the fault message
>             if (def.getMessage(msg.getQName()) == null) {
>                 def.addMessage(msg);
>             }
>         }
> 
> exists. At the same time, writeBindingOperation has
> 
>         // Faults clause
>         ArrayList faultList = desc.getFaults();
> 
>         if (faultList != null) {
>             for (Iterator it = faultList.iterator(); it.hasNext();) {
>                 FaultDesc faultDesc = (FaultDesc) it.next();
> 
>                 // Get a soap:fault
>                 ExtensibilityElement soapFault = 
> writeSOAPFault(faultDesc);
> 
>                 // Get a wsdl:fault to put the soap:fault in
>                 BindingFault bindingFault = new BindingFaultImpl();
> 
>                 bindingFault.setName(faultDesc.getName());
>                 bindingFault.addExtensibilityElement(soapFault);
>                 bindingOper.addBindingFault(bindingFault);
>             }
>         }
> 
> . The two clauses above are essentially equivalent and seem 
> to be duplicated. I tested Emitter with 
> writeBindingOperation's duplicate part commented out and it 
> worked fine and passed all-tests. Could anyone explain this? 
> Otherwise, I'd like to clean it up. :-)
> 
> Ias
> 
> =========================================================
> Lee, Changshin (Korean name)
> Ias (International name)
>                Company Web Site: http://www.tmax.co.kr
>                Personal Web Site: http://www.iasandcb.pe.kr
> ---------------------------------------------------------
> JSR 201, 204, 222 and 224 Expert Group Member Apache Web 
> Services Project Member R&D Center Tmax Soft, Inc.
> =========================================================
> 


Mime
View raw message