473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Sending XML to a Web Service

I'm using a web service proxy with a method that accepts a byte[] as a parameter. The intent is to send an XML document via this byte[]. I'm trying to do it with the following code

MemoryStream byteStream = new MemoryStream()
XmlTextWriter xml = new XmlTextWriter(byteStream, System.Text.UTF8Encoding.UTF8)

.....write the doc....

xml.Flush()
xml.Close()
byte[] data = byteStream.getBuffer()
webServiceClass.webServiceMethod(data)

the call to webServiceMethod reports a deserialization exception, array index out of bounds

Any help?
Nov 16 '05 #1
1 2028
Why not just send the XML as a string and allow the underlying archtitecture
to serialize for you?

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Brent Goodwin" <brent.goodwin(no-spam!!)@sparta.com> wrote in message
news:C8**********************************@microsof t.com...
I'm using a web service proxy with a method that accepts a byte[] as a parameter. The intent is to send an XML document via this byte[]. I'm
trying to do it with the following code:
MemoryStream byteStream = new MemoryStream();
XmlTextWriter xml = new XmlTextWriter(byteStream, System.Text.UTF8Encoding.UTF8);
....write the doc.....

xml.Flush();
xml.Close();
byte[] data = byteStream.getBuffer();
webServiceClass.webServiceMethod(data);

the call to webServiceMethod reports a deserialization exception, array index out of bounds.
Any help?

Nov 16 '05 #2

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

Similar topics

5
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...
2
by: Mark | last post by:
I have a service that I've built that runs on our web server. The web service has a reference to the System.Web namespace so it can use the classes titled: MailMessage SmtpMail My web...
5
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...
2
by: Jonathan Woods | last post by:
Hi there, I have encountered problem of losing data sending over internet using web service. I consume web service that connected Oracle Database. I submit 687 SOAP Messages to 1 Web Method...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.