formating the XML response in webservice

D

Draggi

Hello,

First, Please excuse me for my bad english.

I developped a small webservice in C# who execute a sored procedure in a
sql server 2005.
Everything was OK, but our client have a problem to integrate it on java
plateform, because the XML was formatting in microsoft standard format.

Could you help me please, or send me a link about , how to format XML
response, or how to include the response in a array var considering my C#
code.

I join my code here:

using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services;
[WebService(Namespace = "toto_CHECK")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Webservicetoto : System.Web.Services.WebService {

public Webservicetoto () {

}

[WebMethod]
public DataSet Get_status_for_pitchs_and_location(int id_camp)
{

SqlConnection myConnection = new
SqlConnection("server=localhost;uid=***;pwd=******;database=****;");
SqlDataAdapter myCommand1 = new SqlDataAdapter("EXECUTE
CHECK_HEB_FOR_toto " + id_camp, myConnection);

DataSet ds = new DataSet();
myCommand1.Fill(ds);
return ds;
}
}
 
D

Draggi

For someone who have the same problem this is the solution :
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services; using System.Xml;
[WebService(Namespace = "toto_CHECK")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Webservicetoto : System.Web.Services.WebService {

public Webservicetoto () {

}

[WebMethod]
public XmlDocument Get_status(int id_camp)
{

SqlConnection myConnection = new
SqlConnection("server=localhost;uid=***;pwd=******;database=****;");
SqlDataAdapter myCommand1 = new SqlDataAdapter("EXECUTE
CHECK_HEB_FOR_toto " + id_camp, myConnection);

DataSet ds = new DataSet();
myCommand1.Fill(ds);

XmlDataDocument dataDoc = new XmlDataDocument(ds);
return dataDoc;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top