Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 28557 invoked from network); 6 Jun 2008 16:04:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2008 16:04:50 -0000 Received: (qmail 53087 invoked by uid 500); 6 Jun 2008 16:04:53 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 52870 invoked by uid 500); 6 Jun 2008 16:04:52 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 52861 invoked by uid 500); 6 Jun 2008 16:04:52 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 52858 invoked by uid 99); 6 Jun 2008 16:04:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2008 09:04:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2008 16:04:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 275B423889C1; Fri, 6 Jun 2008 09:04:29 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r664002 - /webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/receivers/CorbaUtil.java Date: Fri, 06 Jun 2008 16:04:28 -0000 To: axis2-cvs@ws.apache.org From: eranga@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080606160429.275B423889C1@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eranga Date: Fri Jun 6 09:04:28 2008 New Revision: 664002 URL: http://svn.apache.org/viewvc?rev=664002&view=rev Log: trimimg the parameters form service config Modified: webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/receivers/CorbaUtil.java Modified: webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/receivers/CorbaUtil.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/receivers/CorbaUtil.java?rev=664002&r1=664001&r2=664002&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/receivers/CorbaUtil.java (original) +++ webservices/axis2/trunk/java/modules/corba/src/org/apache/axis2/corba/receivers/CorbaUtil.java Fri Jun 6 09:04:28 2008 @@ -74,7 +74,7 @@ import javax.xml.namespace.QName; import java.io.File; -import java.io.FileInputStream; +//import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; @@ -86,8 +86,8 @@ import java.util.List; import java.util.Map; import java.util.Properties; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; +//import java.util.zip.ZipEntry; +//import java.util.zip.ZipInputStream; public class CorbaUtil implements CorbaConstants { private static Map IDL_CACHE = new HashMap(); @@ -99,12 +99,12 @@ Properties props = System.getProperties(); if (orbClass!=null) - props.put(ORG_OMG_CORBA_ORBCLASS, orbClass.getValue()); + props.put(ORG_OMG_CORBA_ORBCLASS, ((String) orbClass.getValue()).trim()); else props.put(ORG_OMG_CORBA_ORBCLASS, DEFAULR_ORB_CLASS); if (orbSingletonClass!=null) - props.put(ORG_OMG_CORBA_ORBSINGLETON_CLASS, orbSingletonClass.getValue()); + props.put(ORG_OMG_CORBA_ORBSINGLETON_CLASS, ((String) orbSingletonClass.getValue()).trim()); else props.put(ORG_OMG_CORBA_ORBSINGLETON_CLASS, DEFAULT_ORBSINGLETON_CLASS); @@ -120,16 +120,16 @@ Parameter iorString = service.getParameter(IOR_STRING); if (namingServiceUrl!=null && objectName!=null) { - obj = orb.string_to_object((String) namingServiceUrl.getValue()); + obj = orb.string_to_object(((String) namingServiceUrl.getValue()).trim()); NamingContextExt nc = NamingContextExtHelper.narrow(obj); - obj = nc.resolve(nc.to_name((String) objectName.getValue())); + obj = nc.resolve(nc.to_name(((String) objectName.getValue()).trim())); } else if (iorFilePath!=null) { - FileReader fileReader = new FileReader((String) iorFilePath.getValue()); + FileReader fileReader = new FileReader(((String) iorFilePath.getValue()).trim()); char[] buf = new char[1000]; fileReader.read(buf); obj = orb.string_to_object((new String(buf)).trim()); } else if (iorString!=null) { - obj = orb.string_to_object((String) iorString.getValue()); + obj = orb.string_to_object(((String) iorString.getValue()).trim()); } else { throw new CorbaInvocationException("cannot resolve object"); } @@ -148,7 +148,12 @@ public static IDL getIDL(AxisService service, ORB orb, String dirName) throws CorbaException { Parameter idlFile = service.getParameter(IDL_FILE); - String idlFileName = (String) idlFile.getValue(); + + if (idlFile == null) { + throw new CorbaInvocationException("Please specify the IDL file"); + } + + String idlFileName = ((String) idlFile.getValue()).trim(); String cacheKey = dirName + File.separator + idlFileName; IDL idl = (IDL) IDL_CACHE.get(cacheKey); if (idl==null) { @@ -203,7 +208,7 @@ Parameter interfaceName = service.getParameter(INTERFACE_NAME); if (interfaceName==null) throw new CorbaInvocationException("interfaceName cannot be null"); - return invokerFactory.newInvoker((String) interfaceName.getValue(), methodName, obj); + return invokerFactory.newInvoker(((String) interfaceName.getValue()).trim(), methodName, obj); } public static Object[] extractParameters(OMElement methodElement, Member[] parameterMembers) throws CorbaInvocationException {