hi everybody,
I checked the attachments/samples and I could not see the code for the service side....
I am trying to send a file to my web service and save it over there.... In my client,
Service service = new Service(); //A new axis Service.
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(sServiceAddress));
call.setOperationName("saveToDir");
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage message = mf.createMessage();
FileDataSource n = new FileDataSource(new File(sSrcDir));
DataHandler dh = new DataHandler(n);
//message.addAttachmentPart(message.createAttachmentPart(dh));
Object ret = call.invoke(new Object[] {dh, sDestDir});
In my service code:
public String saveToDir(javax.activation.DataHandler dh, String sPath)
{
try
{
dh.writeTo(new FileOutputStream(sPath));
}
catch().....
}
can anybody please help me? If I use Attachments or Message class(org.apache.axis.Message), I can not generate wsdl file, it complaints that "there is no default constructor in class Attachments or Message"...If I use, AttachmentPart, then I am getting the same complaint "there is no default constructor...."...
Can anybody please help me the way how to send and receive attachment via Axis?
I really appreciated any help...
thanks,
teo
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!