Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > formating the XML response in webservice

Reply
Thread Tools

formating the XML response in webservice

 
 
Draggi
Guest
Posts: n/a
 
      12-27-2005
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;
}
}


 
Reply With Quote
 
 
 
 
Draggi
Guest
Posts: n/a
 
      12-29-2005
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;

> }
> }
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xml error in webservice SOAP response ? Jurjen de Groot ASP .Net Web Services 1 01-04-2008 09:03 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Write XML with formating David ASP .Net 2 03-06-2005 04:58 PM
Changing xml-encoding for webservice response Magnus Lindberg ASP .Net Web Services 1 05-05-2004 09:42 PM
WebService returns XML in a String - how can I 'convert' this to an XML document? Ben Turner ASP .Net 2 01-02-2004 05:20 AM



Advertisments