473,769 Members | 5,205 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I pass a variant byte array to a .NET web service?

I'm very confused with this. I have a .NET web service that I am trying
to pass a variant byte array to from the client side. If the signature
of the web service is set to accept an Object it seems to pass it in
but I can't access the array that should be in there. If I set the
signature as a byte array I get an error in webservice.htc. It seems to
be trying to encode the variable to base 64 and it fails when trying to
do a .length on it.

Am I supposed to convert this to Base64 or what? I would appreciate any
help with this as I am really in a jam.

Thanks

Alex

Mar 18 '06 #1
3 3301
Hi,
I've had a similar problem with passing byte arrays as parameters in my
web services.
The solution i used was to manually convert the array of bytes as a
base64 encoded string and pass the string. Decoding on the receive.
My investigations into the nullified byte array led me to make this
post:
http://groups.google.com/group/micro...363e45fbf92e3d
hope my 'fix' helps.

Mar 20 '06 #2
I found some vbscript code which converts my array to base64. When I
pass it as a string and use the .NET Convert.FromBas e64String to decode
this string I get an array with different values in it. Is there more
than one standard when it comes to converting into base64? Maybe I need
to modify the script code to comply with the .NET function?

Any ideas?

Thanks

Mar 20 '06 #3
ab*******@gmail .com wrote:
I found some vbscript code which converts my array to base64. When I
pass it as a string and use the .NET Convert.FromBas e64String to decode
this string I get an array with different values in it. Is there more
than one standard when it comes to converting into base64? Maybe I need
to modify the script code to comply with the .NET function?

Any ideas?


<URL:http://en.wikipedia.or g/wiki/Base64>
F'up2 microsoft.publi c.dotnet.framew ork.aspnet (where I don't read)

PointedEars
Mar 20 '06 #4

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

Similar topics

1
4805
by: Demian | last post by:
Hi, I developed an OCX in VC++, wich takes a VARIANT as parameter and return a Long as the result of the operation. This VARIANT cames from a client VB6.0 wich send an array of Byte as a VARIANT, so acomplish Autonmation std. I need to access the array inside the variant to load an user-defined struct with it. To do this I used the myvariant->parray.pvData but it didn't work. It seems that the data wasn't there... I tried with...
1
2428
by: wbaccay | last post by:
I have a byte of binary data received from a NetworkStream (C# code) that I need to pass to the IWMWriter object in a DLL written in Managed extensions for C++ (since the Windows Media SDK is not usable in C#) whose WriteSample function takes a byte* parameter Do I need to marshal data? I thought I did, so I ran into alot of issues with converting the byte to a string and then, in the MC++ DLL, marshalling that to an IntPtr via...
16
14138
by: Ekim | last post by:
hello, I'm allocating a byte-Array in C# with byte byteArray = new byte; Now I want to pass this byte-Array to a managed C++-function by reference, so that I'm able to change the content of the byteArray and afterwards see the changes in C#. (if you wanna know more details: the goal is to write the content of an existing char-array in c++ precisely into the passed byteArray, so that after the function has proceded the content of the...
0
1016
by: Jozsef Bekes | last post by:
Hi All, I would like to build up a stream from datatypes of the COM variant, like int, double, date, etc. in the form: <type><data><type><data> All is esay, except for that I'd need to be able to cast all of these types to a byte array. Can anyone please help me how to do it? Thank you and regards, Jozsi
0
2332
by: sebascomeau | last post by:
Hi everyone, Hello my name is Sebastien and I need some help. He have one week past and I search to do one thing but I can't. If someone help me, I'll be so happy :). My problem is I want to upload a file(image), convert this image in an array of byte. Take this array and pass it to a web service. The web service take this array of byte and resize the image and return a new array of byte. This new array can be save on the harddrive. I...
0
1326
by: rolandheller | last post by:
Hello! We're currently looking at migrating some of our code to .NET. Our old application written in VB6 has a DLL function that passes an Array of Variants to another function. We're planning to put a Web Service as a bridge to unglue the 3-tier architecture ... so old: VB6 -> Array(variants) -> VB6
3
3801
by: abarberis | last post by:
I'm very confused with this. I have a .NET web service that I am trying to pass a variant byte array to from the client side. If the signature of the web service is set to accept an Object it seems to pass it in but I can't access the array that should be in there. If I set the signature as a byte array I get an error in webservice.htc. It seems to be trying to encode the variable to base 64 and it fails when trying to do a .length on it....
1
8647
by: kmercer46 | last post by:
I have the byte array generated and I also have the web service generated what i need to know is how to pass a byte array to the web service itself any help would be appreciated.
4
2118
RedSon
by: RedSon | last post by:
I'm doing a bit of bluetooth programming and I am writing some middleware to make developing applications easier. The BT driver is implemented as a simple serial driver so its like OpenFile and WriteFile and ReadFile. So I get a notification from the module that there is a phone that wishes to make a hands free profile connection to my device. It also give me a big byte array with some information about the phone that is requesting to connect....
0
9589
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
10050
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...
0
9866
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
8876
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
7413
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
6675
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
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
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
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.