472,791 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

Dime doubt

Thanks for all responses
Please advice!

Hi All, Clients are uploading large files to my Web Portal. I need to
validate these files using a WS. Problem is file sizes are in the range of
5-20MB!!!!

Q1. How do I send DIME attachments to the WebSvc from my Portal?
TIA

Nov 16 '05 #1
3 3536
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...?

"Richard" <Ri*****@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...

I did this about a year ago... You need WSE {Web Service Enhancements} and you attach the DIME attachment to the httprequest - I forget the
specifics...
BUT - be advised that DIME is dead; Microsoft is not pushing it any longer...
--Richard

"Vai2000" wrote:
Thanks for all responses
Please advice!

Hi All, Clients are uploading large files to my Web Portal. I need to
validate these files using a WS. Problem is file sizes are in the range of 5-20MB!!!!

Q1. How do I send DIME attachments to the WebSvc from my Portal?
TIA

Nov 16 '05 #2
Thank you my friend!!

"Richard" <Ri*****@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Told you it was a year ago --> I meant SOAPContext...

Anyway file size is not an issue. Max DIME record size is either 64K or 4gig {I forget which} and I do not believe there is a limit on num records
per DIME attachment. I also do not believe there is a limit on the number
of DIME attachments per message {I was doing 0-n attachments of 2-10 meg per
attachment with no troubles over a high bandwidth connection}. The only
issue with 5-20meg files is how long users want to wait while upload is in
progress... Other caveats:
1) You have to call a method on the service after you have attached everything to the context because the method call is when files are loaded
and bytes move across the wire. As far as actually moving bytes, if I
recall DIME will load the file content into 1 or more records as needed...
2) You have to send the ids of your attachments along with the request so that you can retrieve the attachment by id on the server side; anything can
be an id - string GUIDS or filenames are fine - so long as it is unique per
request.
Anyway, when you wish to send you must attach the file blob to the context of your instantiated service as that context is what is packaged up and
shipped along with any requests to your service. Also you

SendBLOBToWS()
{
// instantiate WS
service1 svc=new service1();

// create attachment
DimeAttachment attachment = new DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, strFullPath)
// 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" wrote:
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...?

"Richard" <Ri*****@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...

I did this about a year ago... You need WSE {Web Service Enhancements}
and you attach the DIME attachment to the httprequest - I forget the
specifics...

BUT - be advised that DIME is dead; Microsoft is not pushing it any

longer...

--Richard

"Vai2000" wrote:

> Thanks for all responses
> Please advice!
>
> Hi All, Clients are uploading large files to my Web Portal. I need
to > validate these files using a WS. Problem is file sizes are in the

range of
> 5-20MB!!!!
>
> Q1. How do I send DIME attachments to the WebSvc from my Portal?
>
>
> TIA
>
>
>
>


Nov 16 '05 #3
Here are GetFile and PutFile methods I did for WSE awhile ago. hth.

[SoapMethod("http://abc.com/2004/07/GetFile")]
public long GetFile(string path)
{
try
{
SoapContext rescx = ResponseSoapContext.Current;
DimeAttachment dimeAttach = new DimeAttachment(
"application/file", TypeFormat.MediaType, path);
rescx.Attachments.Add(dimeAttach);
return dimeAttach.Stream.Length;
}
catch
{
return -1;
}
}

[SoapMethod("http://abc.com/2004/07/PutFile")]
public long PutFile(string path)
{
try
{
SoapContext ctx = RequestSoapContext.Current;
if (ctx == null)
return -1;
if ( path == null )
return -1;

// Check for one attachment.
if (ctx.Attachments.Count != 1 )
return -1;

Stream stream = ctx.Attachments[0].Stream;
long len = stream.Length;
WriteFileFromStream(stream, path);
return len;
}
catch
{
return -1;
}
}

--
William Stacey, MVP

"Vai2000" <no****@microsoft.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
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...?

"Richard" <Ri*****@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...

I did this about a year ago... You need WSE {Web Service Enhancements} and you attach the DIME attachment to the httprequest - I forget the
specifics...

BUT - be advised that DIME is dead; Microsoft is not pushing it any

longer...

--Richard

"Vai2000" wrote:
Thanks for all responses
Please advice!

Hi All, Clients are uploading large files to my Web Portal. I need to
validate these files using a WS. Problem is file sizes are in the
range of 5-20MB!!!!

Q1. How do I send DIME attachments to the WebSvc from my Portal?
TIA



Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric Lavitsky | last post by:
Hi, I'm trying to connect using PHP5 to a web service created with the MS SOAP Toolkit3 that supports DIME attachments. PHP fails connecting to the service, for example: <?php $wsdl =...
0
by: Willem | last post by:
Hi, I'm not sure if this is the right place for my question, but I am having some problems with webservices. I am trying to use classic asp to consume a webservice that requires DIME messages...
1
by: Levi Wilson | last post by:
I have a web service that adds a DIME attachment: public void GetFile(string filename) { SoapContext sc = HttpSoapContext.ResponseContext; DimeAttachment dimeFile = new...
0
by: LearninGuru | last post by:
Hi, I have a situation where I need to return bulky PDF files from a web service method. The easiest way to do this is return base64 encoded strings. But as the PDF files are bulky this...
1
by: Modica82 | last post by:
Hi all, I have been trying to find a way to send a PDF from my web service. I have had the idea of sending back a byte array, but to be honest the efficiency issue is there and i would like to...
0
by: AndyO | last post by:
Following what is found out at http://www.gotdotnet.com/team/xml_wsspecs/dime/WSDL-Extension-for-DIME.htm for composing my WSDL, when using the wsdl.exe, I can't seem to get around the error...
1
by: Matt B | last post by:
Hi all, This problem is close to driving me insane. Basically, I'm trying to use DIME to add an attachment to a SOAP message and send it to the web server. The WSE 2.0 toolkit is installed,...
3
by: Matt B | last post by:
Does anyone know if DIME is available for Visual Studio.NET 2005? I have Visual Studio.NET 2003 and I installed the Web Services Extension pack 2.0 in order that I could use DIME. Seems to work...
5
by: =?Utf-8?B?SmFrb2IgTGl0aG5lcg==?= | last post by:
I have never sent attachment with webservices. Yesterday I got the challenge to redesign my solution that sends large XML structures to a Java webservice. The reason was that the Java SOAP...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.