473,785 Members | 2,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3607
Thanks Rick, Problem is how do I send attachment to the WS? This is what I
am attempting.....
private void Button1_Click(o bject sender, System.EventArg s e)
{
// load the file
// send it as dime attachment
SoapContext soapContext = HttpSoapContext .ResponseContex t;
DimeAttachment dimeAttachment = new DimeAttachment( "plain/text",
(TypeFormatEnum )16, strFullPath);
dimeAttachment. Id = "uri:" + Guid.NewGuid(). ToString();
soapContext.Att achments.Add(di meAttachment);

/// >>>> how should I call WS ????
service1 svc=new service1();
svc.UploadDimAt tach();
}

Whats the latest then...?

"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:DC******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:2E******** *************** ***********@mic rosoft.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( "applicatio n/octet-stream", TypeFormatEnum. MediaType, strFullPath)
// assure a unique id for this attachment
attachment.id = <<whatever>>

// connect attachment to WS context
svc.RequestSoap Context.Attachm ents(attachment );

// piggy-back file blob on any request to WS
svc.CallAnyMeth od(attachment.i d);
}

-------------------------------------------------------

Server side is:

Service1.CallAn yMethod(string id)
{
DimeAttachment attachment = HttpSoapContext .RequestContext .Attachments[id]; ...
int ch = 0;
while ((ch = attachment.Stre am.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(o bject sender, System.EventArg s e)
{
// load the file
// send it as dime attachment
SoapContext soapContext = HttpSoapContext .ResponseContex t;
DimeAttachment dimeAttachment = new DimeAttachment( "plain/text",
(TypeFormatEnum )16, strFullPath);
dimeAttachment. Id = "uri:" + Guid.NewGuid(). ToString();
soapContext.Att achments.Add(di meAttachment);

/// >>>> how should I call WS ????
service1 svc=new service1();
svc.UploadDimAt tach();
}

Whats the latest then...?

"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:DC******** *************** ***********@mic rosoft.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("htt p://abc.com/2004/07/GetFile")]
public long GetFile(string path)
{
try
{
SoapContext rescx = ResponseSoapCon text.Current;
DimeAttachment dimeAttach = new DimeAttachment(
"applicatio n/file", TypeFormat.Medi aType, path);
rescx.Attachmen ts.Add(dimeAtta ch);
return dimeAttach.Stre am.Length;
}
catch
{
return -1;
}
}

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

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

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

--
William Stacey, MVP

"Vai2000" <no****@microso ft.com> wrote in message
news:ed******** ******@TK2MSFTN GP10.phx.gbl...
Thanks Rick, Problem is how do I send attachment to the WS? This is what I am attempting.....
private void Button1_Click(o bject sender, System.EventArg s e)
{
// load the file
// send it as dime attachment
SoapContext soapContext = HttpSoapContext .ResponseContex t;
DimeAttachment dimeAttachment = new DimeAttachment( "plain/text",
(TypeFormatEnum )16, strFullPath);
dimeAttachment. Id = "uri:" + Guid.NewGuid(). ToString();
soapContext.Att achments.Add(di meAttachment);

/// >>>> how should I call WS ????
service1 svc=new service1();
svc.UploadDimAt tach();
}

Whats the latest then...?

"Richard" <Ri*****@discus sions.microsoft .com> wrote in message
news:DC******** *************** ***********@mic rosoft.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
1813
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 = 'http://mssoapinterop.org/stkV3/dime/dime-rpc.wsdl'; $webservice = new SoapClient($wsdl); ?>
0
1499
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 for input. The dime messages contain xml data and sometimes jpeg images. My problem is to generate the DIME messages. I can generate xml using my asp page, the only problem is to transform this into a DIME message. Are there any (custom)...
1
1988
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 DimeAttachment("application/DIME", TypeFormatEnum.MediaType, @"c:\temp\" + filename); sc.Attachments.Add(dimeFile);
0
1658
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 would mean that for each web method call the file would have to be loaded into memory for encoding and returning. This will easily turn out to be a performance bottleneck if multiple calls are being made to the web method.
1
1436
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 find another route if possible. I have started to read bits and pieces about DIME and WSE but what i need to know is can i utilise this technology cross platform?? For instance someone who will consume this web service is coding in some form of...
0
1463
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 message: "Error: one or more required WSDL extension elements were ignored. Errors were encountered. Review generated source comments for more details." More specifically, for each of the binding places (inside wsdl:output/wsdl:input) where I use:
1
2195
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, which allows for DIME to be used and everything is set up correctly as far as I know. My code is:
3
4005
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 well. I'll probably getting VS.NET 2005 soon, which uses Extension pack 3.0. I know this extension pack includes MTOM - supposed to be DIME's successor - but does it also include DIME? Anyone know?
5
3260
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 implementation had problems consuming too large files that way. They encountered a memory leak in the parser that made the whole mainframe environment to crash! So the decided they should go for DIME attachments instead. I use VB.Net in VS2005.
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.