// assure a unique id for this attachment
attachment.id = <<whatever>>
// connect attachment to WS context
svc.RequestSoapContext.Attachments(attachment);
// piggy-back file blob on any request to WS
svc.CallAnyMethod(attachment.id);
}
-------------------------------------------------------
Server side is:
Service1.CallAnyMethod(string id)
{
DimeAttachment attachment = HttpSoapContext.RequestContext.Attachments[id];
...
int ch = 0;
while ((ch = attachment.Stream.ReadByte()) != -1)
{
...
}
...
}
--Richard
Vai2000 said:
Thanks Rick, Problem is how do I send attachment to the WS? This is what I
am attempting.....
private void Button1_Click(object sender, System.EventArgs e)
{
// load the file
// send it as dime attachment
SoapContext soapContext = HttpSoapContext.ResponseContext;
DimeAttachment dimeAttachment = new DimeAttachment("plain/text",
(TypeFormatEnum)16, strFullPath);
dimeAttachment.Id = "uri:" + Guid.NewGuid().ToString();
soapContext.Attachments.Add(dimeAttachment);
/// >>>> how should I call WS ????
service1 svc=new service1();
svc.UploadDimAttach();
}
Whats the latest then...?
Enhancements}
and you attach the DIME attachment to the httprequest - I forget the
specifics... range
of