formating the XML response in webservice

Discussion in 'ASP .Net Web Services' started by Draggi, Dec 27, 2005.

  1. Draggi

    Draggi Guest

    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;
    }
    }
    Draggi, Dec 27, 2005
    #1
    1. Advertising

  2. Draggi

    Draggi Guest

    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;

    > }
    > }
    >
    >
    Draggi, Dec 29, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rodrigo guerra

    automatic code formating...

    rodrigo guerra, Jul 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    356
    rodrigo guerra
    Jul 5, 2003
  2. Dmitri Manushin

    Formating text

    Dmitri Manushin, Aug 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    381
    Dmitri Manushin
    Aug 14, 2003
  3. David

    Write XML with formating

    David, Mar 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    339
    Matt Berther
    Mar 6, 2005
  4. Magnus Lindberg

    Changing xml-encoding for webservice response

    Magnus Lindberg, May 4, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    518
    Dino Chiesa [Microsoft]
    May 5, 2004
  5. Jurjen de Groot

    xml error in webservice SOAP response ?

    Jurjen de Groot, Dec 29, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    258
    Jurjen de Groot
    Jan 4, 2008
Loading...

Share This Page