Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>ASP.NET WebServcies use the SOAP protocol. This means that whatever information you return from your WebMethods it will automatically be placed into a SOAP envelope and XML encoded. You cannot modify the way your response is formatted as you will be violating the SOAP protocol. You shouldn't worry about what is displayed in the browser. The important thing is that this is a properly formatted XML that will be received by the client (as a string result) and could be converted to XML.</p> <p>This being said what you are doing (returning string from your WebMethods representing XML) is a very bad practice as there will be a double encoding. I would recommend you defining some custom type that will represent this XML structure and return this custom type. It will make your web service easier to discover and make sense of as right now any consumer looking at the WSDL would see a method returning a string value but wouldn't know that this string represents an XML structure with some special format.</p> <p>Here's what I mean:</p> <pre><code>public class Make { public string MakeID { get; set; } public string MakeName { get; set; } } </code></pre> <p>and then:</p> <pre><code>[WebMethod(Description="Return All Current Makes")] public Make[] ReturnMakes() { // Get All Records with NAME Parameter DataTable dataTable = DataAccessLayer.ExecuteDataTable("ipa_ReturnMakes"); List&lt;Make&gt; makes = new List&lt;Make&gt;(); if (dataTable.Rows.Count &gt; 0) { foreach (DataRow objRow in dataTable.Rows) { Make make = new Make { MakeID = objRow["MakeID"].ToString(), MakeName = objRow["MakeName"].ToString() }; makes.Add (make); } } return makes.ToArray(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload