Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 22771 invoked from network); 9 Jan 2005 11:36:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Jan 2005 11:36:34 -0000 Received: (qmail 91043 invoked by uid 500); 9 Jan 2005 11:36:33 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 90868 invoked by uid 500); 9 Jan 2005 11:36:33 -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 90842 invoked by uid 99); 9 Jan 2005 11:36:32 -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; Sun, 09 Jan 2005 03:36:31 -0800 Received: from [192.168.101.20] (25.253.adsl.sltnet.lk [220.247.253.25] (may be forged)) by squid.cmb.ac.lk (8.12.9/8.12.9) with ESMTP id j09BjW8Z025760; Sun, 9 Jan 2005 17:45:36 +0600 (LKT) (envelope-from roshan@opensource.lk) Subject: Re: SoapSerializer was modified to support attachments. From: Roshan Weerasuriya To: Apache AXIS C User List , axis-c-dev@ws.apache.org In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1105270562.1205.28.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 09 Jan 2005 17:36:02 +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 John, >I'm a little confused as to the relationship between a soap attachment, > body and header. How come the IWrapperSoapSerializer has setters for all > three but there are only interfaces for the attachment. how do I create a > body or header - we have methods for creating an attachment but not the > others? What does a body or header look like? can it be anything etc. etc. > Some doc in the code might be good here? > The following is the structure. A soap attachment which we receives (or sends) in a MIME message will have the Mime Headers and the Mime Body. So as a whole (both MIME headers and the body) it represents the SOAP Attachement. So there is a class called SoapAttachment (src/soap/SoapAttachment.hpp/cpp) as a placeholder for a attachment. //-----SoapAttachment class----- class SoapAttachment { private: SoapAttachementHeaders* m_AttachementHeaders; xsd__base64Binary* m_AttachementBody; public: void serialize(SoapSerializer& pSZ); void addBody(xsd__base64Binary* objBody); void addHeader(AxisString name, AxisString value); SoapAttachment(); virtual ~SoapAttachment(); }; //------------------------------- A user of this class will not have to create a seperate Attachment Headders for example, but can just call the addHeader by passing the HeaderName and HeaderValue. The SoapSerializer is having a map to store objects of above SoapAttachment type. The SoapSerializer also has following new methods: - void addAttachmentBody(const AxisChar* achId, xsd__base64Binary* pAttchBody); - void addAttachmentHeader(const AxisChar* achId, const AxisChar* achHeaderName, const AxisChar* achHeaderValue); - void addAttachment(AxisString id, SoapAttachment* objAttach); A user of these methods for example a person who calls the addAttachmentHeader don't need to worry abt creting any of the Attachement objects etc. The SoapSerializer will manage that part (i.e if necessory the SoapSerializer creates a SoapAttachment object and puts it its SoapAttachment map). You will realize this if you look at the code of these 3 methods. But if necessory the API also provieds the "addAttachment()" methods which is the last of the above 3, to any one who needs to directly set a SoapAttachment object. Any how the Wrapper class will not be seing the SoapSerializer, but instead it sees the IWrapperSoapSerializer.hpp. So the following API methods are added to the IWrapperSoapSerializer interface: virtual void addAttachment(const AxisChar* achId, ISoapAttachment* > > objAttach)=0; > > > > virtual void addAttachmentBody(const AxisChar* achId, > > xsd__base64Binary* pAttchBody)=0; > > > > virtual void addAttachmentHeader(const AxisChar* achId, const > > AxisChar* achHeaderName, const AxisChar* achHeaderValue)=0; If the user of this interface needs to create a object of SoapAttachment then the following mehods of this interface could be used. /** > > * creates and returns a SoapAttachment object to the caller of > > this methods. > > * The user can use this object and fill in the attachment details. This > > * method doesn't add the created SoapAttachment object to the > Serializer. > > * The user will have to add this object explictly by calling the > > addAttachment > > * method of the IWrapperSoapSerializer interface > > * > > */ > > virtual ISoapAttachment* createSoapAttachement()=0; Here another interface called "ISoapAttachment" is used to avoid static linkage of Axis engine/library code to the web service. With this explanation if you just go through these methods you will get the idea. > What is the memory management model for an attachment? All the attachments are maintained by the SoapSerializer. It will clean the memory for those attahments in its Destructor. Roshan On Fri, 2005-01-07 at 19:06, John Hawkins wrote: > > Hi, > > I'm a little confused as to the relationship between a soap attachment, > body and header. How come the IWrapperSoapSerializer has setters for all > three but there are only interfaces for the attachment. how do I create a > body or header - we have methods for creating an attachment but not the > others? What does a body or header look like? can it be anything etc. etc. > Some doc in the code might be good here? > > And I don't actually understand what an attachment header is (knowing this > might help me understand the above :-) > > What is the memory management model for an attachment? > > cheers for now, > John. > > > John Hawkins > > > > "Rangika Mendis" wrote on 07/01/2005 10:41:07: > > > Hi All, > > > > We added functionalities to the serializer to serialize soap > > attachments. The following files were added for that purpose. > > > > 1. SoapAttachmentHeaders > > 2. SoapAttachment > > > > New API allows to add Soap Attachment objects to the serializer. > > > > The following methods in IWrapperSoapSerializer.hpp can be used to > > add attachment details to the Serializer. > > > > virtual void addAttachment(const AxisChar* achId, ISoapAttachment* > > objAttach)=0; > > > > virtual void addAttachmentBody(const AxisChar* achId, > > xsd__base64Binary* pAttchBody)=0; > > > > virtual void addAttachmentHeader(const AxisChar* achId, const > > AxisChar* achHeaderName, const AxisChar* achHeaderValue)=0; > > > > /** > > * creates and returns a SoapAttachment object to the caller of > > this methods. > > * The user can use this object and fill in the attachment details. This > > * method doesn't add the created SoapAttachment object to the > Serializer. > > * The user will have to add this object explictly by calling the > > addAttachment > > * method of the IWrapperSoapSerializer interface > > * > > */ > > virtual ISoapAttachment* createSoapAttachement()=0; > > > > These methods will be used by the web service wrapper class. > > > > Any comments on this will be greatly appreciated. > > > > Regards, > > > > Nithya & Rangika > > > > > >