Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Please help me to pass a file!

Thread Tools

Please help me to pass a file!

Daniel Johansson
Posts: n/a
Hello everyone

Im am trying to pass a binary file from a web service to a
client.(managed c++)
I wanīt to use dataset.
If I put down the files in a dataset I loose information
I got the tip the use DIME
It doesnīt work.
Not with WSE 1.0 SP1 or WSE 2.0
If I choose to enable the WSE on "WSE Settings" under the "Project"
I get the errormessage
"The WSE must be installed to enable this feature"
can this be of importance? Do I need a service pack 2 to .NET?
Have I missed anything during the installation process?
Are there any other possibility to:

"pass a binary file in a dataset from a web service to a client"

This is my problem, and it must have been solved before, again, the
must have been solved before. I canīt be the first person with this

Hence my question is? Is this even possible? Iīm pretty sure that I use
a correct
syntax, I have been in contact with Christian Meyer, MVP and he is also
pretty sure
that my code is accurate.

With the upmost highest regards

// Daniel

*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote
Posts: n/a
Hi Daniel
Not sure if this helps. Is your objective to pass a binary file as a Dime
If yes. Then just attach this bin file directly to dime. e.g.

string filePath = "C:/myBinaryFile.bin";

DimeAttachment attchment = new DimeAttachment("application/octet-stream",
TypeFormatEnum.MediaType, filePath);
HttpSoapContext.ResponseContext.Attachments.Clear( );
HttpSoapContext.ResponseContext.Attachments.Add(at tachment);

Reply With Quote
Frank Drebin
Posts: n/a
I am pretty sure the form that submits the file needs to post a content-type
"form/multi-part"... crap, or whatever it's called.. it needs to tell your
page, that it's a multi-part MIME page, and not just some form elements..

Least helpful post. Ever. Sorry!! hth

"Daniel Johansson" <(E-Mail Removed)> wrote in message
news:eyoFa%(E-Mail Removed)...
> Hi hs!
> Let me show what I already have tried!
> Iīm using WSE 1.0 SP1 on Microsoft.NET framework 1.0
> Here goes.
> //Create a new DimeAttachment class
> CString m_sFilepath = Server->MapPath("/.../.../");
> CString m_sFilename(inFileName) ; // an incomming string
> FileStream *fs;
> try
> {
> fs = new FileStream(m_sFilepath +
> m_sFilename,FileMode::Open,FileAccess::Read);
> //copy stream to stream
> unsigned char sbuf __gc[];
> sbuf = new unsigned char __gc[fs->Length];
> fs->Read(sbuf, 0, sbuf.Length);
> MemoryStream *ms;
> ms = new MemoryStream();
> //close file
> fs->Close();
> //attach body
> DimeAttachment* da;
> da = new DimeAttachment("application/octet-stream",
> TypeFormatEnum::MediaType, ms);
> HttpSoapContext *hsc;
> hsc->get_ResponseContext()->get_Attachments()->Clear();
> hsc->get_ResponseContext()->get_Attachments()->Add(da);
> }
> I can compile it but not run it, due to "Object not set to an instance"
> HttpSoapContext->ResponseContext->Attachments->Clear();
> HttpSoapContext->ResponseContext->Attachments->Add(attachment);
> The above doesnīt work either. "Left of -> must point on a
> class/struct/union/"
> I have had the thread in ExpertsExchange
> t/Q_20714751.html#9208316
> and CodeProject
> =3785&mode=all&userid=534084#xx589636xx
> With the highest regards
> // Daniel
> *** Sent via Developersdex ***
> Don't just participate in USENET...get rewarded for it!

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please please please help this guy with his open source java app Java 4 05-05-2005 08:24 AM
Console profile for Windows app in VC++ - PLEASE PLEASE PLEASE HELP! MuZZy C++ 7 01-07-2005 08:40 PM
Computer problems please please please help Nick Computer Support 0 06-04-2004 08:49 PM
HELP! HELP! PLEASE, PLEASE, PLEASE tpg comcntr Computer Support 11 02-15-2004 06:22 PM
please help... learn C++ please please please :) KK C++ 2 10-14-2003 02:08 PM