You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Philippe GENESTE <ge...@club-internet.fr> on 2003/07/08 00:04:36 UTC

help !!! DIME attachments problems

Hello,

Sorry i'm new on SOAP with attachments !!!


I try to download file from Server (AXIS) on client (Gsoap) via a web 
service. I have a problem to retrieve files on client side (problem 
in GSOAP soap_lookup_type function)

Perhaps someone can tell me what is wrong in my implementation.

Here my server side code (i send in response the received request):

public Element test(Element xmlRequest) 
throws org.apache.axis.AxisFault,java.io.IOException, 
org.xml.sax.SAXException,java.awt.datatransfer.UnsupportedFlavorExcept
ion,javax.xml.parsers.ParserConfigurationException, 
java.lang.ClassNotFoundException,javax.xml.soap.SOAPException {

//force to do a DIME transfer
Message rspmsg = AxisEngine.getCurrentMessageContext
().getResponseMessage();
rspmsg.getAttachmentsImpl().setSendType
(org.apache.axis.attachments.Attachments.SEND_TYPE_DIME);

AttachmentPart replyPart= new 
org.apache.axis.attachments.AttachmentPart(
new DataHandler(new FileDataSource
("c:\\test\\test1.zip")));
replyPart.setContentId("xaoTransfert_toto63");
rspmsg.addAttachmentPart(replyPart);

replyPart= new org.apache.axis.attachments.AttachmentPart(
new DataHandler(new FileDataSource
("c:\\test\\test2.zip")));
replyPart.setContentId("xaoTransfert_toto64");
rspmsg.addAttachmentPart(replyPart);

return xmlRequest;
}


Here's my deployment file for server

<deployment xmlns="http://xml.apache.org/axis/wsdd/" 
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java" 
xmlns:ns1="urn:XAOEnvironmentWService">
<service name="urn:XAOEnvironmentWService" provider="java:RPC" >
<parameter name="className" 
value="com.test.ctd.webservice.XAOEnvironmentServices"/>
<parameter name="allowedMethods" value="test download"/>

<operation name="test" returnQName="getObjectResponseReturn" >
<parameter name="xmlRequest"/>
</operation>
<operation name="download" returnQName="getObjectResponseReturn">
<parameter name="xmlRequest"/>
</operation>
</service>
</deployment>



Here's the request (and response in test)
<Root>
<Test> Here is a test</Test>
</Root>


I supposed i make a mistake somewhere in references or something like 
that because on client side, i don't retrieve anything in iht table.

How to add reference id of DIME attachment in my XML response (or in another place. 

Thanks in advance for your help

Philippe