.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Webservice returns xml.xmlnode - Need help getting response into dataset

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
Forgive me I am new to webservices so there may be something obvious that I am overlooking but any help would be appreciated.  Below is my code.  The reportrequest is perfectly formatted, i've already tested that with SoupUI.  The problem is the line I highlighted.  I am getting an error saying outerXml is not a member of System.Array.  Please provide any insight on how to go about this. Dim o As New sushi.SushiService Dim xn As XmlNode() = o.Getreport(reportrequest) Dim dsXML As DataSet = New DataSet() Dim reader As XmlTextReader = New XmlTextReader(xn.outerXml, XmlNodeType.Element, Nothing) dsXML.ReadXml(reader) gvresults.DataSource = dsXML gvresults.DataBind()Thank You!!!

View Complete Post

More Related Resource Links

incorrect deserialization of webservice response

Hi,   I am trying to consume an axis2 webservice from a .NET CF platform. The development platform is Visual Studio 2008 . I have pasted the wsdl , sample response from webservice , for the getEpcByAttribute method.  On execution I initially got a Invalid Cast exception (details below):  System.InvalidCastException was unhandled   Message="InvalidCastException"   StackTrace:        at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length) On further investigation it seemed like the generated file (Reference.cs) had a two dimensional array, which the xmlserializer was trying to put the response into, and was failing. I tried to modify the generated file by converting the 2 dimensional array to a 1 dimensional array . The SOAP call was going through now, but the de-serialization was incorrect. Only the first row of the response was getting de-serialized. I have pasted relevant section from the Reference.cs below. Is there any workaround/fix for this problem (apart from modifying the webservice). Thanks.   WSDL: ---------- <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="urn:JDVisiblEdgeService" xmlns:axis2="urn:JDVisiblEdgeService" xmlns:ns1="http://vo.proj

Sending Large Dataset to Webservice


Dear all,

I have one problem is that when i send large dataset containing byte array.. then webservice not respond well..

it shows error like underlying connection was closed...

I mark that when dataset size goes some large then only problem occurs otherwise it works well..

Please give me solution of how to send large dataset over web service...



Xmlnode to Dataset/DataTable (GetListItems Sharepoint Webservices)


How to convert XmlNode to Dataset or Datatable and below is my code..

 DataSet dsList = new DataSet();

            Web_Reference.Lists listService = new Web_Reference.Lists();

            listService.PreAuthenticate = true;
            NetworkCredential Cred = new NetworkCredential();
            Cred.Domain = Domain;
            Cred.UserName = Login;
            Cred.Password = password;

            listService.Credentials = Cred;

            string listName = "{0F775034-47EA-486F-97AE-50C5BD9011B0}";
            string viewName = "{8F441557-E75B-4BAC-A3EF-B61FF0351DBE}"; ;
            XmlDocument xmlDoc = new System.Xml.XmlDocument();

            System.Xml.XmlNode ndQuery = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "Query", "");
            System.Xml.XmlNode ndViewFields = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "ViewFields", "");
            System.Xml.XmlNode ndQueryOptions = xmlDoc.CreateNode(System.Xml.XmlNodeType.Element, "QueryOp

jQuery's ajax to call web service that returns ado.net dataset to xml



     I try to use jQuery ajax to call web service that returns ado.net dataset which writes to xml, and after I get result client side, I will append to ol tag.

     It did not make it at the time of get result and try to loop the table tag.

     Thank you,





******* WebServiceCommon.cs    

    [ScriptMethod(ResponseFormat = ResponseFormat.Xml)]
    public string GetAllLabsInXML()
        DataSet m_dsDataSet = new DataSet("pageDataSet");
        string m_szSQLConn = "Data Source=(local);Initial Catalog=abc;Integrated Security=False;uid=sa;pwd=abc;Pooling=false;";
        string _szSQL = @"Select LabID, Description From Lab";
        SqlConnection _objConn = new SqlConnection(m_szSQLConn);
        SqlDataAdapter _objDA = new SqlDataAdapter(_szSQL, _objConn);

        MemoryStream ms = new MemoryStream();
        m_dsDataSet.WriteXml(ms, XmlWriteMode.IgnoreSchema); 
        StreamReader sr = new StreamReader(ms, System.Text.Encoding.UTF8); 
        ms.Position = 0;
        String strXml = sr.ReadToEnd(); 

        return s

Accessing response of HttpWebRequest, even when request returns 500 Internal Server Error



Hoping someone can point me to a solution, haven't been able to find one yet.

I'm using the standard way for send HttpWebRequest

		webRequest = (HttpWebRequest)WebRequest.Create(request.URL);
webRequest.Method = "POST";
webRequest.ContentType = "text/xml";


postStream = webRequest.GetRequestStream();
postStream.Write(requestBuffer, 0, requestBuffer.Length);
webResponse = (HttpWebResponse)webRequest.GetResponse();
responseStream = webResponse.GetResponseStream();
responseReader = new StreamReader(responseStream);
string response = responseReader.ReadToEnd();

This is all fine, working correctly, no poblems.

However the actual webservice that i'm calling returns a 500 Internal Server Error code for standard faults

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=utf-8
Content-Length: 703
Date: Fri, 22 Oct 2010 04:50:48 GMT

<?xml version="1.0" en
coding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.o

convert sharepoint webservices output xmlnode to dataset



Working on moss 2007. I am working on sharepoint usergroup webservices to retreive all usergroups from sharepoint site by using the GetAllUserCollectionFromWeb method which returns the output in xmlnode format. can you please help me how to convert this xmlnode to dataset.

here is the code.

webreferencename.UserGroup usrgrpService = new webreferencename.UserGroup();
           usrgrpService.Credentials =
           XmlNode result = usrgrpService.GetAllUserCollectionFromWeb();

its very urgent please me

Webservice versions.asmx: Getversions-method returns error on an item of a custom list.


I using GetVersions from the webservice http://server/_vti_bin/versions.asmx. This method works Okay in SharePoint 2007, and in SharePoint 2010 it also works Okay on documents from a document library. But when I used on an item from a custom list, it returns an error stating: "Value cannot be null.\r\nParameter name: key". In SharePoint 2007 I could retrieve the histroy on an item with the call GetVersions("Lists/MyCustomList/5_.000"), in SharePoint 2010 this fails.

Do I need to change the parameter, or use another filename for an item instead of "5_.000"? Does any one have the same experience?

Thank you

Can't read ping response from webservice

I am trying to ping a webservice but the response is coming back= nothing
I contacted a person there and he said they were receiving the ping and sending back a
success response as shown after my code.
I am unable to read the rsponse. Any help is appreciated 
Protected Sub btnPing_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPing.Click
        Dim ES As New EchoSignDocumentService()
        Dim serviceurl As String = "https://www.echosign.com/services/EchoSignDocumentService9"
        ES.Url = serviceurl
        Dim s As String
        Dim apikey As String = "XDYYBE6Y336S3F"
        s = ES.testPing(apikey).message
    End Sub

Also tried

  Protected Sub btnPing_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPing.Click
        Dim ES As New EchoSignDocumentService()
        Dim serviceurl As String = "https://www.echosign.com/services/EchoSignDocumentService9"
        ES.Url = serviceurl
        Dim pong As Pong
        Dim apikey As String = "XDYYBE6Y336S3F"
        pong = ES.testPin

Passing parameter to Subreport dataset query returns no results



I'm using the subreport as a workaround to not being able to join two disparate datasets. The "tickler" file  of keys comes from an Access DB defined as a dataset in my main report. The subreport has a dataset query using parameters from the main report. 

When subreport returns no results, I want to display an error message in the main report and continue to the next row key processing. How do I accomplish that?


How filter data from a webservice that returns a table by comparing dates


I have an infopath form that takes in brings in an entire table and I want to filter it on datetime by comparing records from a time span of dates that have already been assigned.  I have tried everything from doing it from the within infopath using equations to filter the datasource and also doing it programmatically.  I am to the point where I think it has to be done programmically (C#).  Here is an example of the XPath code I was trying:

(xdMath:Avg(xdXDocument:GetDOM("ISSOrbits")/dfs:myFields/dfs:dataFields/d:ISSOrbits/@Apogee[(number(translate(xdXDocument:GetDOM("ISSOrbits")/dfs:myFields/dfs:dataFields/d:ISSOrbits/@StartTime, "T-:+", "")) >= number(translate(/my:myFields/my:MissionData/my:LaunchMissionDateTime, "T-:+", "")))]))

It seem that only the first record (node) from ISSOrbits gets compared and not the whole dataset.

Please show me how to do this programmatically in C# or if there is way to do it without code.


Charles Picco

P.S. I forgot to mention that table is brought in through a webservice that cannot filter data.


Introducing ADO.NET and the Typed DataSet

In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

Create and Use a Typed DataSet by Using Visual C# .NET

This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Get Top 1 Record from Dataset

Many of them in need of getting the Top 1 or Top 10 records from a Dataset without going to SQL query. It is possible to do from Code Behind. I have given the code below,
The below code is to get single record from a Dataset. Also I have given for getting 8 records at Green Color.

Returning a DataSet From a Web Services: Step-by-Step

This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.


This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

SqlCommand.ExecuteNonQuery() returns -1 when doing Insert / Update / Delete

Sometimes you end up with a return value of -1 when using the SqlClient.SqlCommand.ExecuteNonQuery method.

Why is that?

Well, the ExecuteNonQuery method is there for statements for changing data, ie. DELETE / UPDATE /INSERT, and the returned value are the number of rows affected by that statement.

When checking the documentation we can see that there are some conditions that return -1.

For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.

When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of

rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.

Response.BinaryWrite help needed


Hi all

Im new to .NET and stuck now, so i hope anyone can help my with my problem.

I have a MS SQL database where i have stored some documents as Binary data. I cant figure out how to retrieve them and show/download them in my browser.

I found some guides online and have try to put something together.


private void Write()
 int id = 0;
 string strID = Request.QueryString["id"];
 int.TryParse(strID, out id);

 var db = new ModelDataContext();
 var doc = db.DocumentDatas.Where(x => x.ID == id).FirstOrDefault();

 byte[] byteArray = File.ReadAllBytes(doc);


How do i fill the byteArray with the data?

Thanks in advance :)


Response.Redirect slow


I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend