473,769 Members | 6,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending binary file to a web service

Hi there,

How do I send binary files to a web service from VBScript?

I read a file, converted it into a stream and submitted using xmlhttp.send
(post method).

objXmlhttp.send BinaryStream.Re ad(BinaryStream .Size)

Is this the correct approach?

If so, how do I receive the stream in my web service? Receiving it as a
Stream object doesn't work.

Your help will be greatly appreciated. I've been struggling for the past
two days with this.

Regards,
Anand
Mar 1 '06 #1
2 2382
"Andy" <ar******@ivesi a.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi there,

How do I send binary files to a web service from VBScript?

I read a file, converted it into a stream and submitted using xmlhttp.send
(post method).

objXmlhttp.send BinaryStream.Re ad(BinaryStream .Size)

Is this the correct approach?

If so, how do I receive the stream in my web service? Receiving it as a
Stream object doesn't work.


Hi Andy,

How about receiving byte[]? Will that work for you?

Regards,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCT
MCSD.NET Early Achiever
Mar 1 '06 #2
Hi Andy,

You've got a couple of options. Firstly, you could use the WSE model to add
attachments to your XML Doc using WS-Attachment.

Secondly, you could Base64 encode your binary to convert your data into a
string that can be placed safely inside your xml.

I probably wouldn't use binary streams or byte arrays as some systems that
your data passes through may mangle the data.

HTH,

Adam

--
Adam May
Sydney, Australia
MCSD.Net
"Andy" wrote:
Hi there,

How do I send binary files to a web service from VBScript?

I read a file, converted it into a stream and submitted using xmlhttp.send
(post method).

objXmlhttp.send BinaryStream.Re ad(BinaryStream .Size)

Is this the correct approach?

If so, how do I receive the stream in my web service? Receiving it as a
Stream object doesn't work.

Your help will be greatly appreciated. I've been struggling for the past
two days with this.

Regards,
Anand

Mar 2 '06 #3

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

Similar topics

3
4877
by: Ot?vio | last post by:
Hi! I'm havin a problem about sending a binary file with fsockopen. My problem is solved when i do: -------------------->8------CODE----------------------------- <form action="200.120...../file.php" method="POST" enctype="multipart/form-data"> <form name="file" /> <form name="ip_01" />
5
3236
by: PerryG | last post by:
We have a .NET 1.1 client which is sending a gzipped soap request using HttpWebRequest to an Apache server. The Apache server is using a the 'mod_deflate' server to decompress the incoming message, and to also compress the response (GZIP). The mod_deflate filter requires the 'Content-Length' header contained within the incoming request to specify the number of UNCOMPRESSED bytes being sent and not the actual bytes of the body of the...
1
1772
by: Cindy Lee | last post by:
when I try to send a large web service message with a c# client, I get a read time out (it has nothing to do with timing out). It's not a sever problem, cus it works fine with a java client and responds in 0-1 seconds. I'm using apache axis java for my web services server. It's when the web service is around 70k, but it varies depending on which parameters are large. At 50k the webservice c# client works fine.
1
1397
by: Ipsita | last post by:
Hi! I am trying SOAP with DIME attachments in web services. For example say, I have a file resume.pdf stored somewhere on my server. How does the web service send the file to the client, so that the client can store it and also read from it. I am trying out with C# and ASP.NET. Is there any sample code which will help me? Please help me in this matter.
10
2360
by: Fabuloussites | last post by:
I'm considering deploying an application that will us an IP address locaiton database provided by Ip2location.com... http://www.ip2location.net/ip2location-dotnet-component.aspx their .net component reads data from a binary file. I'm guess i'm wondering which of the two options would be best. 1) read data from the binary files (~27 mb or so) 2) or query a sql DB with the same info.
7
2686
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. So, I used a packet sniffer and saw the protocol (TCP), the port, IP address, etc. All is good. I tried 2 different versions of .NET code to duplicate the requests to the remote server. Again, I used the packet sniffer and my packets seemed...
9
4927
by: Miro | last post by:
VB 2003 at the end of the code, this works great. bytCommand = Encoding.ASCII.GetBytes("testing hello send text") udpClient.Send(bytCommand, bytCommand.Length) and this recieves it Dim strReturnData As String = _ System.Text.Encoding.ASCII.GetString(receiveBytes)
20
9448
by: tomPee | last post by:
Hi, I've bumbed into a slight problem now, and I just don't seem to know how to fix it. What I want to do is the following: Send over a socket: 1. Number of files to be send (not as an integer, just as a string) then for each file to be send: 2. Length of Filename (again as a string) 3. Filename 4. File as binary data.
2
9789
by: ksheerasagar17 | last post by:
Hello All, Scenario: Sending an image through webservice as byte array to an Java webservice. The Problem1: The webservice method image property expects (data type) SByte rather than Byte array. Thus i'm converting a byte array to sbyte array and sending through web service. The converted SByte contains negative numbers wihch are resulting in an error "java.lang.ArrayIndexOutOfBoundsException: -106" Byte => SByte...error...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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
9993
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,...
1
7406
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
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.