473,396 Members | 1,780 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,396 software developers and data experts.

Webservice Error

I've created webservice using by code:
[WebMethod(Description = "Echo Soap Request")]
public XmlDocument EchoSoapRequest(string input)
{
// Initialize soap request XML
XmlDocument xmlSoapRequest = new XmlDocument();

// Get raw request body
Stream receiveStream = HttpContext.Current.Request.InputStream;

// Move to begining of input stream and read
receiveStream.Position = 0;
System.Text.Encoding encoding = System.Text.Encoding.Unicode;
//BinaryWriter bw = new BinaryWriter(receiveStream, encoding);
using (StreamReader readStream = new StreamReader(receiveStream,Encoding.UTF8))
{
// Load into XML documen
xmlSoapRequest.Load(readStream);

//xmlSoapRequest.Load(ConfigurationManager.AppSettin gs["CatalogXMlRootPath"] + readStream + ".xml");
}

// Return
return xmlSoapRequest;
}
}

But I got following error,if you have any error give me suggestion:

System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitesp ace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent( )
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(TextReader txtReader)
at GettingLists.lsts.EchoSoapRequest(String input) in E:\Practice\Sharepoint\GettingLists\GettingLists\l sts.asmx.cs:line
Nov 17 '13 #1
0 1021

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Peter Schmitz | last post by:
Hi, I just wrote a simple .net webservice (2.0beta2) and a small tool to test some functions. Everything worked just fine. Now, the real program that'll call the webservice is written in 1.1 -...
0
by: | last post by:
Hello NG! I try to call a WebService from a mobile device. The WebService should return a DataSet, so the call looks like mDataSet = mWebSrv.GetDataSet(<Params>) but instead of returning a...
0
by: Saya | last post by:
Hello, The situation is as follows: My server app (ASP.NET WebService) responds to the client request (ASP.NET) by returning a text string appended with 2 int numbers, being the X&Y coordinate...
0
by: Richard | last post by:
I have a webservice which returns a dataset from an SQL database to winforms client. All has been working fine for some time now but since my datasets have increased to over 1800 records an...
3
by: Eric van der Niet | last post by:
I have thuis webservice. Used to get account information out of microsoft crm. But is reply's an error! can someone see whats the error in this code???? Help! using System; using...
2
by: Lumen | last post by:
hi, I've got a webproject that calls a webservice 4 times to check information in an CRM system. These checks are made in an asynchronous process. These processes call an instance of the...
0
by: Sergey Poberezovskiy | last post by:
Hi, My VB.Net (1.1) application connects to ASP.Net (1.1) WebService that resides on ISP Server. My client successfully runs this application from 4 out of 5 PCs. On that one PC I receive the...
1
by: ShilpaM | last post by:
Hai, I am trying to access an java https webservice in c#,i have wrriten coding for everything to handle the security but i am getting error as Response of Type text/html expected text/xml,why am...
0
by: Priyank M Bhat | last post by:
Hi, I am facing strange situation, where i am getting Message Expired error, while trying to using webservice to upload file to the remote webserver. I coded this using WSE2.0 and the code and...
0
by: sani723 | last post by:
i have made a webservice that fecthes some data anf then displays that via XSLT in HTML format. this webservice works fine until i deploy it. after deploying it gives this error. The <html>...
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: 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
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,...
0
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...
0
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...
0
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...
0
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,...

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.