axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nithyakala Thangaraja" <nit...@opensource.lk>
Subject Re: Attachment sample [was Re: Design Architecture]
Date Tue, 25 Jan 2005 09:12:25 GMT
Hi Samisa, 
 
>     Is there a sample on WS Attachments implementation? 
    
        yes .. we do have one and we shall commit it shortly. 
 
  
>     Withrout the C++ client side, how can I test this implementation? 
        
        There is a client stimulator in cvs at the following location 
 
       cd $AXISCPP_HOME/tests/utils/simple-server-client 
 
       You can just invoke the client by running ./cli  
 
 
Regards, 
Nithya. 
 
On Tue, 25 Jan 2005 08:41:22 +0000, Samisa Abeysinghe wrote 
> Hi Rangika/Nithya, 
>     Is there a sample on WS Attachments implementation? 
>  
>     Withrout the C++ client side, how can I test this implementation? 
>  
> Thanks, 
> Samisa... 
>  
> On Tue, 25 Jan 2005 14:17:50 +0600, Rangika Mendis 
> <rangika@opensource.lk> wrote: 
> >   
> >   
> >   
> > ws-attachments - Server Side 
> > ==================  
> >    
> > Purpose -  
> > To handle Attachments at server side. 
> > A sample has been currently written to echo attachments  to the client.  
> >    
> > The overall architecture is as follows:  
> >    
> > When Axis C++ server side receives a SOAP message with attachment(s)  it 
has 
> > to extract and store it. This is done inside the  
> >    
> > Apache module. It extracts the attachments and stores  inside a map. Then at 
> > any time if a webservice requests for a particular  
> >    
> > attachment, the transport (in this case the Apache2 module) will be able to 
> > provide it by taking it from its map. Also if a webservice  
> >    
> > needs to send an attachment back, it needs  support to add them to the 
> > Serializer. This functionality is also provided.  
> >    
> > The details given below explain the functionalities that are needed to deal 
> > with attachments (Currently we have focused on echoing  
> >    
> > attachments to the client.)  
> >    
> > 1. Apache2Transport -  
> > The following methods will be called by getBytes() once it receives the 
> > incoming message with base64 encoded attachments.  
> >    
> > extract_Attachment(pBuffer) -  
> > Extracts the attachments from the pBuffer which has the incoming 
> > message.This will extract the attachments one by one and will  
> >    
> > store them in a map.The mime headers will also be extracted one by one & 
> > will be stored in a vector. 
> >   
> > extract_SOAPMimeHeaders(pBuffer) -  
> > Extracts the SOAPMimeHeaders from the pBuffer and will store them in a char 
> > pointer.This method is required to send the  
> > response to the client.  
> >    
> > extract_Soap(pBuffer) -  
> > Extracts the soap Message from the pBuffer.The soap part is extracted 
> > because the deserializer fails when it receives data in  
> >    
> > MIME format. It can only handle data in XML format.  
> >    
> > The above 3 methods are implemented in the AttachmentHelper class.  
> >    
> > 2. The wrapper of the webservice calls the:- 
> > getElementAsString() in the deserializer to get the ID of the required web 
> > service. Then it will get the Attachment through the  
> >    
> > DeSerializer and will send the attachment/s to the webservice to process it. 
> >    
> > Currently we are expecting the attachment id to be as an element value, but 
> > we noticed in Axis Java that it is sent as an Attribute.  
> >    
> > Axis Java TCP monitor request -  
> >    
> >  <soapenv:Body> 
> >   <ns1:echo 
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
> > xmlns:ns1="urn:EchoAttachmentsService"> 
> >    <source href="cid:CB74148662CBBC03C85CAC8C456F9548" 
> > xsi:type="ns1:DataHandler"/> 
> >   </ns1:echo> 
> >  </soapenv:Body>  
> >    
> > Client TCP monitor request (which we used)-  
> >    
> >  <soapenv:Body>   
> >  <ns1:EchoAttachment 
> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"  
> > xmlns:ns1="urn:EchoAttachmentsService">     
> >  <id xsi:type="xsd:string">000001233</id>   
> >    </ns1:EchoAttachment>  
> > </soapenv:Body>  
> >  
> > 3. After receiving the processed attachment/s the wrapper will pass the Id 
> > and the attachment/s to the addAttachment() of  the  
> >    
> > SoapSerializer. We added the following main methods to the SoapSerializer.  
> >    
> > addAttachment(const AxisChar* achId, ISoapAttachment* pAttach) -  
> > This will add the attachment(s) to the attachment map in the Serializer.  
> >    
> > addAttachmentHeader(const AxisChar* achId, const AxisChar* 
achHeaderName, 
> > const AxisChar* achHeaderValue) -  
> > This will add the name & the value of the mime headers to the relavent 
> > Attachment.This in turn will store the mime headers in a  
> > vector.  
> >    
> > addAttachmentBody(const AxisChar* achId, xsd__base64Binary *pAttchBody) -  
> > This will set the body of the given attachment id.  
> >    
> > Comments regarding this are welcome.  
> >    
> > Regards,  
> > Nithya & Rangika  
> >  
> >   
> >  
> >   
> >  
> > 
 
 
-- 
Lanka Software Foundation (http://www.opensource.lk) 
 

Mime
View raw message