Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2005

Tip: Looking for answers? Try searching our database.

formating the XML response in webservice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Draggi - 27 Dec 2005 13:56 GMT
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 - 29 Dec 2005 12:20 GMT
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)]
[quoted text clipped - 15 lines]
>         DataSet ds = new DataSet();
>         myCommand1.Fill(ds);

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

>     }
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.