dotnet xml:
I am calling an Axis web service from a Net 2.0 client. To be helpful, the
developers on the Axis side sent a test client that they created, with
snippets below. What I am trying to do is add a document to a workplan
object, and return the object. I can return the object okay, but do not see
how I can do this with .NET.
I was expecting something like an attachfile method that returns an array of
bytes.
I have the WSE 3.0 installed.
Thanks,
David
private WorkPlanDocumentTO addWorkPlanDocument(Long workPlanId) {
(Axis call.registerTypeMappings )
call.setOperationName("addWorkPlanDocument");
WorkPlanDocumentTO workPlanDocumentTO = createWorkPlanDocument(workPlanId);
call.setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT,
Call.ATTACHMENT_ENCAPSULATION_FORMAT_MTOM);
call.addParameter("param", workPlanDocumentTOQN, WorkPlanDocumentTO.class,
ParameterMode.IN);
call.setReturnType(workPlanDocumentTOQN);
attachFiles(workPlanDocumentTO, call);
****
}
And then later on....
private void attachFiles(WorkPlanDocumentTO workPlanDocumentTO, Call call) {
DocumentDescriptor[] docDesc = workPlanDocumentTO.getDocuments();
for(int i = 0; i < docDesc.length; i++)
{
String filePath = "C:\\temp\\" + i + ".doc";
DataHandler dh = new DataHandler(new FileDataSource(filePath));
AttachmentPart attachmentPart = new
org.apache.axis.attachments.AttachmentPart();
attachmentPart.addMimeHeader(DocumentDescriptor.FILE_NAME,
docDesc[i].getDocumentName());
attachmentPart.setDataHandler(dh);
call.addAttachmentPart(attachmentPart);
}
My question is this. All the