Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 37084 invoked from network); 11 Jan 2005 12:37:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Jan 2005 12:37:23 -0000 Received: (qmail 53933 invoked by uid 500); 11 Jan 2005 12:37:23 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 53907 invoked by uid 500); 11 Jan 2005 12:37:23 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 53892 invoked by uid 99); 11 Jan 2005 12:37:23 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.opensource.lk (HELO squid.cmb.ac.lk) (202.51.147.3) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 11 Jan 2005 04:37:21 -0800 Received: from [192.168.101.20] ([220.247.221.164]) by squid.cmb.ac.lk (8.12.9/8.12.9) with ESMTP id j0BCkZ8Z054378 for ; Tue, 11 Jan 2005 18:46:37 +0600 (LKT) (envelope-from roshan@opensource.lk) Subject: Re: setUri() API - Usage From: Roshan Weerasuriya To: Apache AXIS C Developers List In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1105447019.3157.35.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 11 Jan 2005 18:36:59 +0600 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi James, Well I think we might need. For example when a user want to declare couple of Attributes in his/her own namespace, user will need to set his/her namespace for a attribute, so that the engine can put the correct prefix for all such attributes. Or for example if a user is defining a attribute in his/her own namespace, we should let the user set the namespce_uri when he declare this attribute. So when the relavent Attribute object is serialized to the wire we could automaicaly add the namespace declaration if it is a new namespce. We might also add the following to the IHeaderBlock class so that the user can create a Attribute object and later use these setters to fill it: virtual IAttribute* createAttribute(); Roshan On Tue, 2005-01-11 at 18:22, James Jose wrote: > Roshan, > setUri() for an attribute does not change the SOAP Message. So if > we going for separate class for namespace, then do we need this > setUri() API in IAttribute class. > > Regards > James > -------------------------------------------------- > James Jose > Messaging Clients Team, WMQDDC > IBM Software Labs, India > Direct: 91-80- 25094331 Ext :2331 > E-mail: jamejose@in.ibm.com > > > > > Roshan Weerasuriya > > > 11/01/2005 16:08 > Please respond to > "Apache AXIS C Developers List" > To > Apache AXIS C > Developers List > > cc > > Subject > Re: setUri() API > - Usage > > > > > hi Addrian, > > >I agree with the INamespace and Namespace structure. When it comes > to > > implementation, I believe the best aproach is for Namespace to > encapsulate > > an Attribute, such that Attribute::setValue is exposed as setURI > while > > Attribute::setURI is made unavailable. > > Your idea is cool, but will this lead to extra/unnecessory memeory > usage, because Attribute class has : > AxisString m_localname; > AxisString m_prefix; > AxisString m_uri; > AxisString m_value; > > but a Namespace only requires the prefix and namespaceuri to be used. > > Also there will be two object being created when a user declares a > namespace, ie. Namespace object and a Attribute object internaly. > > May be also it improves the readability of the Attribute > implemenatation > if we have a seperate implemenation of Namespace without binding it > with > the Attribute class at all. > > Roshan > > On Tue, 2005-01-11 at 16:21, Adrian Dick wrote: > > > > > > Roshan Weerasuriya wrote on 11/01/2005 > 09:47:59: > > > > > > > > So what I propose is to introduce a new class as a palce holder > for > > > namespaces (i.e actualy for namespace declarations). eg: > > > class Namespace > > > { > > > public: > > > void setURI(AxisString asURI); > > > void setPrefix(AxisString asPrefix); > > > Namespace(AxisString asPrefix, AxisString asURI); > > > Namespace(); > > > virtual ~Namespace(); > > > > > > > > private: > > > AxisString m_asPrefix; > > > AxisString m_asURI; > > > > > > > > }; > > > > > > > > And it will have its corrosponding INamespce interface as well. > > > > > > > > so the code would look like: > > > IHeaderBlock > > > *phb=ws.createSOAPHeaderBlock("TestHeader","http://axis.com"); > > > INamespace > *namesp=phb->createNamespaceDecl("np","http://apache.com"); > > > namesp->setUri("new_uri"); > > > > > > > > Please provide any of your ideas. > > > > > > > > Roshan > > > > > > > I agree with the INamespace and Namespace structure. When it comes > to > > implementation, I believe the best aproach is for Namespace to > encapsulate > > an Attribute, such that Attribute::setValue is exposed as setURI > while > > Attribute::setURI is made unavailable. Rather than duplicating the > > implementation of the Attribute methods. > > > > So Namespace would look more like: > > class Namespace > > { > > public: > > void setURI(AxisString asURI) > > -> { m_Attribute.setValue(asURI) }; > > void setPrefix(AxisString asPrefix) > > -> { m_Attribute.setPrefix(asPrefix) }; > > Namespace(AxisString asPrefix, AxisString asURI); > > Namespace(); > > virtual ~Namespace(); > > > > private: > > -> Attribute m_Attribute(); > > > > }; > > > > > > Regards, > > Adrian > > > > > >