Hello,
I tried to emulate the following example in VB.NET 2.0:
Get Attachment Example:
MantisItemAttachmentFullDetail mifd = new MantisItemAttachmentFullDetail();
System.Web.UI.HtmlControls.HtmlInputFile fileUpload; //assuming this control is on the ASP.NET page
mifd.AttStream = fileUpload.PostedFile.InputStream; //required System.IO.InputStream
mifd.ContentType = fileUpload.PostedFile.ContentType; //required string
mifd.FileCRC = 0; //this can just be zero
mifd.FileLength = fileUpload.PostedFile.ContentLength; //Required long
mifd.Description = strDescription; //optional string
mifd.FileName = strFilename; //required string - filename only, not the full path
mItem.Attachments = new MantisItemAttachmentFullDetail[] {mifd};
The line mifd.AttStream = fileUpload.PostedFile.InputStream; //required does not work - I cannot seem to pass any System.IO.Streams to the property AttStream.
Has anyone at sourcegear actually tried this code out?
Example does not work - Uploading Attachments via the WS
Moderator: SourceGear
I tried in both VS.NET 2003 and 2005
The line fails:
mifd.AttStream = fileUpload.PostedFile.InputStream; //required System.IO.InputStream
mifd.AttStream does not take a System.IO.InputStream parameter - rather ... it takes a DragNetClient(WS namespace).DragNet.Stream...
It seems VS.NET generates the wrong type for this parameter?
How does SourceGear create their web service stub so that the proper parameter can be passed in (what data type does it expect? A .NET IO.Stream)?
The line fails:
mifd.AttStream = fileUpload.PostedFile.InputStream; //required System.IO.InputStream
mifd.AttStream does not take a System.IO.InputStream parameter - rather ... it takes a DragNetClient(WS namespace).DragNet.Stream...
It seems VS.NET generates the wrong type for this parameter?
How does SourceGear create their web service stub so that the proper parameter can be passed in (what data type does it expect? A .NET IO.Stream)?
- Attachments
-
- Reference.vb.txt
- (202.59 KiB) Downloaded 2351 times