 |
|
 |
hi! are consumers of the web service required to install WSE as well? what if, let's say, consumers of my web service are php and java web applications? what adjustments do they need to make? by the way, thanks for the great article!
|
|
|
|
 |
|
 |
If you have PHP and Java clients talking to your Application Server, they have to have the compliancy with the correct WSDL version.
In case they also use DIME then they need to use a third party DIME parser to pass the attachement. Failing to do so, you have to send it as a regular byte[].
But there are many other feature in WSE, the answer to your question depend on what features you are using at the server base.
The problem become verse as you ungrade from WSE 2.0 to WSE 3.0 where the large binary files send using another technology called MTOM. In that case those who are (third party clients) already using DIME parser are in deep trouble as MTOM is not compliant with DIME parsers.
If this doesn't help, give little more data then I can give you a more specific answer..
Thanks,
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
[quote]
In case they also use DIME then they need to use a third party DIME parser to pass the attachement. Failing to do so, you have to send it as a regular byte[].
[/quote]
there's a big possibility that they're not using DIME. does this mean that they won't *understand* the attachment? if it's not too much to ask, how can i send the file as a regular byte (code snippet will be great) or can you point me to the topic that i should read. thanks man, you're a great help!
|
|
|
|
 |
|
 |
Ok, if you are not going to use DIME and not going to use any other client dependant feature that comes with WSE then your client does not need to have WSE install? Pretty obviously
Public byte[] GetData()
{
//Read the file data and return the file’s byte[]
}
You can read the file from the hard drive to a byte[] very easily (refer to System.IO.File name space). When you send a binary data as a byte[] it is going to create a bulky SOAP message, which will increase the network traffic (I do not recommend sending file bigger that 20 MB this way) so to reduce the file size you should consider compressing it before sending over the network. (Search for SharpZipLib, it is a open source compression library). In case when you send compressed data the client has to decompress it before he/ she use the file.
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
okay! thanks man! my sole requirement is to stream some files to client applications and im looking for elegant solutions to my problem. looks like im back to streaming bytes.
|
|
|
|
 |
|
 |
ur wish
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
Now here is a problem, i am required to send the attachment AND the other
attributes (sender and receiver;s email, message, subject line) all at the
same time. I tried it but it didn't work. DIME can send ONLY attachments,
not the entire message that i could figure out. I can use any other technique
but it needs to be using BINARY SOAP...
Please HELP !!!
Ankit
|
|
|
|
 |
|
 |
What is the real requirement for you do send a e-mail with a attachment via a web method of a web service?
I can generally say that you can send the binary (attachement) as a DIME attachement while sending all other parameters through a return object of the web method
e.g.:
[WebMethod]
public MailObject GetMail(param)
{
// Attache the mail attachement as a dime attachement
// return the MailObject after filling required properties
}
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
Hello!
hey brother, I need to send a soap message with an attached file... this article serves me very well to do this...
but in my pc, in my office I cannot install the WSE 2.0 package...
if you have any idea of the couse of that... please help me!
I work with VS 2003... and this works very well... so a I don´t know why I can´t install this WSE 2.0 packages...
Thanks!...;)
|
|
|
|
 |
|
 |
Hi JRINC,
First time I am hearing a such issue, could you pass me the exact issue you are facing? What happen when you try to install WSE 2.0?
Let me have the followings detail of the system you are facing issues
1. Operating System/ Service Pack Version
2. Visual Studio version
3. .Net Framework Version
4. The exact error you get and when that error occurs
Thanks
L.W.C. Nirosh.
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
this was useful to me - thanks
|
|
|
|
 |
|
 |
OK
L.W.C. Nirosh,
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
Hi. I have a WinForms application and a web service. I'm trying to send to the web service a file with 4,5MB but I'm not having success. I've put the following configuration in the App.config and in the Web.config and still it doesn't work: <microsoft.web.services2> <messaging> <maxRequestLength>-1</maxRequestLength> </messaging> <security> <timeToleranceInSeconds>86400</timeToleranceInSeconds> </security> </microsoft.web.services2> Does anyone know what I'm doing wrong? I'm receiving a 'Maximum request length exceeded.' message. Thanks in advance. Ricardo
|
|
|
|
 |
|
 |
Seems you are ignoring the first setting..
httpRuntime maxRequestLength="8000"
useFullyQualifiedRedirectUrl="true"
executionTimeout="300"
Don't you??
Add this as well.. and it should solve the issue..
G
|
|
|
|
 |
|
 |
Thanks. But now I have another problem. I can upload the file but I cannot download it. I've put the tag you said in the App.config but it didn't work.
Any ideas?
Ricardo
|
|
|
|
 |
|
 |
There can have several reasons to this issue.. get me a more specific error then I will be able to answer you..
L.W.C. Nirosh,
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
I followed this artcile and it worked for me very well..
Samual
|
|
|
|
 |
|
 |
Hi,
I'm having some trouble getting this code to work. Here's some background:
Initially, I set up both the client and service on my local machine. After installing MS's Web Service Enhancements, things ran fine.
However, when I moved the Service to a different machine, I get the following error:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll
Additional information: Server was unable to process request. --> Object reference not set to an instance of an object.
This error is occurring here ( in the Rerence.cs file) ...
public void CreateDimedImage() {
this.Invoke("CreateDimedImage", new object[0]);
}
Steps taken so far:
1) Installed WSE on the computer
2) set permissions on the folder to "Everyone" having all rights.
3) Created a different web reference in the client for the version of the service on the 2nd computer, and changed the code in Form1_Load() method accordingly.
4) Ensured that the file is there (I get a different error message when the file isn't there)
5) I even attempted to run the entire thing (client and service) on this second machine, but get the same message...
Any help or suggestions are greatly appreciated.
Ken Schwartz
|
|
|
|
 |
|
 |
Hi,
A frustrating question Ah...?
If the things working fine when they are on the same server and not when they are seperated only possible thing would be a proxy configuration issue..
This is what could happen with you.
As you add a new web reference to the new server the client automatically remove the DIME enable state of the client. So what you could do is right click the project as indicated and make your client dime enable again..
This should indeed solve your problem.
L.W.C. Nirosh,
Software Engineer,
TextCENTRIC Technology,
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
Just a another thing..
if you think that it is not flexible, you may make your web service a dynamic ..
steps to do it
1. Right click on your (web reference) proxy
2. Go to Properties
3. Change the URL behavior from Static to Dynamic
You will see it add a app.config file, Go to app.config file and see that your proxy url is in the configuration file. This way you can publish your web service in any server and configure it just by changing the app.config or web.config of the client application (Note: As long as web service is not differ from one server to another).
If you are not depending upon DIME strictly the latest technology is called MTOM which has introduced with WSE 3.0. If you are still not ready with VS 2005 you may not consider moving to MTOM as yet.
L.W.C. Nirosh,
Software Engineer,
TextCENTRIC Technology,
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
Please advice how I use the code ?
My problem is if I send the file name to attach as Dime my web service is running on the server and cannot find the file.
I am told to send the file as dime atachment and let the web service read as dime attachment as the user do not want to share a folder and get the file droped there ?
Prakash
Prakash
|
|
|
|
 |
|
 |
You got to give enough permission for your web service to access and read the file from the local folder..
These are the steps
1. Create a folder out side of the web server root directory (C:\Test)
2. Place the file you want to send out in side teh folder
3. Right click on the folder
4. Share the folder and give full access to ASP_NET user, this permission should be enough to read a file from the location.
5. Attached the file as a dime attachement before responding to the request.
Hope this is not a late reply
L.W.C. Nirosh,
Software Engineer,
TextCENTRIC Technology,
Colombo,
Sri Lanka.
|
|
|
|
 |
|
 |
Hi,
I was trying to implement sending image attachment through DIME in .NET and I came across your example, I did exactly the samething that you had mentioned in the example.
First I installed the WSE 2.0 and WSE 3.0 on my machine, and after creating the web service when i right clicked on the project for configuring the WSE 2.0 settings I found only the WSE 3.0 settings in the menu and I did the changes that you had mentioned to that in the web service project and as well as in the client project, then I compiled the web service project it was successfull and then I deployed the web service in the IIS, and in the client project I added this web service as web reference and tried to compile the client project then it threw the error which states as below.
Error 1 The type or namespace name 'DimeServiceWse' does not exist in the namespace 'DimeClient.pxy' (are you missing an assembly reference?) E:\Dot Net 2005 Projs (MOM)\DimeClient\DimeClient\Form1.cs 20 17 DimeClient
My question is why it is not showing the WSE 2.0 settings in the menu eventhough the WSE 2.0 is installed on the system ?
Can I send the attachments by using WSE 3.0 ?, if so what changes do i need to make in the code ?
kindly help me in this regard.
Thanking you in Advance,
Venkat.
|
|
|
|
 |
|
 |
Hi Nirosh,
After carrying out a little bit of research work I came to know the reason why the WSE 2.0 settings is not getting displayed ? the thing is that the WSE 2.0 is made for the .NET 1.1 framework i.e. for the visual studio .NET 2003.
In the previous post I forgot to mention that I am using visual studio .NET 2005, so I need to use only WSE 3.0
Is there any classes are there in WSE 3.0 like DIME as in WSE 2.0 for sending the attachments through SOAP.
Kindly help me to solve the above problem.
Thanking you in advance,
Venkat.
|
|
|
|
 |
|
 |
Hi,
WSE 3.0 is using a new method called MTOM to send attachment, or rather binary data.
Pros
Once you are configured with MTOM you may just return the byte arrary of the file just like any other return type..
e.g.
[WebMethod]
byte[] GetMyFile()
{
return the byte array of the file
}
Once you have installed WSE 3.0 and your application is configured with MTOM the system will recognize the data type and treat it in a special way and allow you to transfer the file afficiently.
Cons
If your client if only capable of reading a DIME attachement (Third parties who are having dime parsers) will not be able to read the message return type since it is compressed and optimized for binary trafsfering
L.W.C. Nirosh,
Software Engineer,
TextCENTRIC Technology,
Colombo,
Sri Lanka.
|
|
|
|
 |