WCF REST Starter Kit (RETIRED)http://forums.asp.net/1180.aspx/1?WCF+REST+Starter+Kit+RETIRED+Discuss the WCF REST Starter Kit and other WCF REST topics. Note: This forum was retired on Friday February 17, 2012, and is now read-only. Please use ASP.NET Web API.Thu, 16 Feb 2012 08:24:15 -0500urn:uuid:00000000-0000-0000-0000-000000001180urn:uuid:00000000-0000-0000-0000-000004825707http://forums.asp.net/p/1768027/4825707.aspx/1?How+does+REST+client+knows+about+the+DataContracts+used+in+the+serverHow does REST client knows about the DataContracts used in the server <p>I have a fundamental question on the REST implementation on the client side. Since we don't create proxy for the REST WCF services, how does the client know about the concrete types used in the server?</p> <p>Example method is</p> <p>[WebGet(UriTemplate=&quot;Customers&quot;)]</p> <p>Customer GetCustomer();</p> <p>how does the client knows about the Customer Type?. Do we need to explicity include the dll(Which contains the Customer Type definition)&nbsp;for the client side?</p> <p>Tutumon</p> 2012-02-10T06:34:56-05:002012-02-10T06:34:56.803-05:00urn:uuid:00000000-0000-0000-0000-000004803850http://forums.asp.net/p/1763269/4803850.aspx/1?Checking+user+credential+in+REST+web+serviceChecking user credential in REST web service &lt;div class=&quot;container&quot;&gt; &lt;div class=&quot;body&quot;&gt; &lt;div&gt;I have a RESTful web service&nbsp;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;While consuminig the web service, when using POST method I am passing the user credential as given below.&lt;/div&gt; &lt;div&gt;&nbsp; httpRequest.Credentials = new NetworkCredential(&quot;username&quot;, &quot;password&quot;); &nbsp;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;How can I retrieve this username and password in the CRUD operations of the RESTful web service( httphandler class)&lt;/div&gt; &lt;div&gt;to compare them with the database. I have the following function for READ operation.&nbsp;&lt;/div&gt; &lt;div&gt;&lt;/div&gt; &lt;div&gt;&nbsp;private void READ(HttpContext context)&lt;/div&gt; &lt;div&gt;&nbsp;{&lt;/div&gt; &lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;/div&gt; &lt;div&gt;&nbsp;}&lt;/div&gt; &lt;/div&gt; &lt;input type=&quot;hidden&quot; id=&quot;284ff607-c076-42af-a06b-faff519ac46c_attachments&quot; /&gt;&lt;/div&gt; &lt;div class=&quot;abusive&quot;&gt;&lt;/div&gt; 2012-01-27T16:26:39-05:002012-01-27T16:26:39.38-05:00urn:uuid:00000000-0000-0000-0000-000004778547http://forums.asp.net/p/1758384/4778547.aspx/1?Help+required+to+learn+WCF+4+0+REST+Starter+KitHelp required to learn WCF 4.0 REST Starter Kit Hi, I want to learn WCF Rest in Visual Studio 2010. For this, I have googled and I got the information like: now in VS 2010 it came up with the new name called WCF Web API. But, I couldn't get proper resource to learn. Whatever the resources I got in google most of them are presenting videos for VS2008, but not for VS2010. Can anybody please show some links to video tutorials, and the links to tutorials...! Can I get a pdf book with any link...! 2012-01-12T06:37:21-05:002012-01-12T06:37:21.727-05:00urn:uuid:00000000-0000-0000-0000-000004769583http://forums.asp.net/p/1756785/4769583.aspx/1?RouteTable+vs+WebServiceHost2Factory+which+one+to+use+why+RouteTable vs WebServiceHost2Factory...which one to use & why? <p>I don’t know why after every release Microsoft is making things so confusing. I trying to develop WCF RESTful service. I’m using VS 2010 Premium with .Net 4. I have downloaded WCF REST Starter Kit and also downloaded WCF REST templates for VS 2010 from visual studio gallery. (<a href="http://visualstudiogallery.msdn.microsoft.com/fbc7e5c1-a0d2-41bd-9d7b-e54c845394cd"><b>WCF REST Service Template 40(CS) </b></a>)</p> <p>On all the learning videos &amp; MSDN it says use WebServiceHost2 &amp; WebServiceHost2Factory class for RESTful services, because these classes are specifically designed for REST services and they are included in Microsoft.ServiceModel.Web.dll. Also the examples I have seen so far uses .svc file to host the service.</p> <p>So I created a project using the WCF REST Template which I have downloaded from Visual Studio gallery. But it created a service class without using .svc file and also there is no reference to Microsoft.ServiceModel.Web.dll. After little bit of digging and goggling I found its using <b>RouteTable</b> to add the service. Below is the code in global.ascx</p> <pre class="prettyprint">RouteTable.Routes.Add(new ServiceRoute(&quot;Service1&quot;, new WebServiceHostFactory(), typeof(Service1)));</pre> <p>If you note, its not using WebServiceHost2Factory instead its using WebServiceHostFactory.</p> <p>So now I’m completely confused which is the best way to develop &amp; start WCF RESTful service and what’s the advantage of one over other. I know both approaches will work but which one is preferred approach</p> <p>Again, im using VS 2010, .Net 4, IIS 7.5</p> <p>&nbsp;</p> 2012-01-06T21:03:30-05:002012-01-06T21:03:30.56-05:00urn:uuid:00000000-0000-0000-0000-000004769490http://forums.asp.net/p/1756769/4769490.aspx/1?Project+Templates+did+not+get+install+with+WCF+REST+Starter+Kit+Project Templates did not get install with WCF REST Starter Kit? <p>I just installed msi from <a href="http://aspnet.codeplex.com/releases/view/24644"> http://aspnet.codeplex.com/releases/view/24644</a>&nbsp;but the project template did not get install</p> <p>any idea why?</p> 2012-01-06T19:21:04-05:002012-01-06T19:21:04.127-05:00urn:uuid:00000000-0000-0000-0000-000004769218http://forums.asp.net/p/1756708/4769218.aspx/1?How+to+use+AdapterStream+for+downloading+large+file+in+WCF+REST+service+How to use AdapterStream for downloading large file in WCF REST service? <p><span style="text-align:left; line-height:15px; color:#333333; font-size:13px">The WCF REST Starter kit introduced a new mechanism for addressing this scenario, an “AdapterStream” utility class, which basically pushes small pieces of content (and thus, only small memory buffers are used) to the client application as it becomes necessary.</span></p> <p><span style="text-align:left; line-height:15px; color:#333333; font-size:13px">Using this class i have implemented the Download service. It works fine. But i have to read the whole file in memory to use it with the AdapterStream. Questions</span></p> <p><span style="text-align:left; line-height:15px; color:#333333; font-size:13px">1&gt;How does adapter stream pushes chunk to consumer?</span></p> <p><span style="text-align:left; line-height:15px; color:#333333; font-size:13px">2&gt;Can someone suggest more efficient way of reading file in chunk and push to consumer? Using adapter stream or some other way if possible</span></p> <p>my current code</p> <pre class="prettyprint">[WebHelp(Comment = &quot;Returns a pdf file&quot;)] [WebGet(UriTemplate = &quot;DownloadDocument?returnid={returnid}&quot;)] [OperationContract] Stream DownloadDocument(long returnid) { string filepath = System.Web.HttpContext.Current.Server.MapPath(&quot;Sample.pdf&quot;); byte[] buffer = null; using (FileStream st = new FileStream(filepath, FileMode.Open, FileAccess.Read)) { int length = (int)st.Length; buffer = new byte[length]; st.Read(buffer, 0, length); } WebOperationContext.Current.OutgoingResponse.ContentType = &quot;application/pdf&quot;; return new AdapterStream((writer) =&gt; writer.Write(buffer, 0, buffer.Length)); }</pre> 2012-01-06T15:56:49-05:002012-01-06T15:56:49.343-05:00urn:uuid:00000000-0000-0000-0000-000004767904http://forums.asp.net/p/1756441/4767904.aspx/1?Hoe+to+send+multiple+wave+file+in+xaml+Hoe to send multiple wave file in xaml?? <p>Hi All</p> <p>I am using REST Protocol to send file through HTTP.</p> <p>I am sending single file using REST it is possible.</p> <p>But i am trying to select multiple wav file &nbsp;and send this is not happening.</p> <p>I am storing all wav file path into string array.</p> <pre class="prettyprint">private void cmdSelectFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); string[] filename = dlg.FileNames; int nCount = filename.Count(); for (int i = 0; i &lt; nCount; i&#43;&#43;) { FilePath=fileName[i]; }</pre> <pre class="prettyprint">Hoe to send it pls give me some code sample to send one by one all wav file</pre> <pre class="prettyprint">Thanks in advance</pre> <pre class="prettyprint">Ambrish</pre> 2012-01-06T04:49:12-05:002012-01-06T04:49:12.96-05:00urn:uuid:00000000-0000-0000-0000-000004757788http://forums.asp.net/p/1754562/4757788.aspx/1?Return+multiple+rows+of+data+from+SQL+DB+Return multiple rows of data from SQL DB? <p>I am working on a basic WCF REST project, using the REST template in VS2010. On the call I am making I am expecting multiple rows of results to be returned from the SQL database. I am using a dataobject and currently it is only returning the first row. Can someone point out how i can return multiple, structured, rows? Here is my code;</p> <p>IService1.cs</p> <pre class="prettyprint">using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.ServiceModel; using System.Runtime.Serialization; namespace WcfRestService { [DataContract] public class clsVehicles { [DataMember] public string invNo { get; set;} [DataMember] public string carNo { get; set;} [DataMember] public string saleDate { get; set;} [DataMember] public string sold { get; set;} [DataMember] public string year { get; set;} [DataMember] public string make { get; set;} [DataMember] public string model { get; set;} [DataMember] public string mileage { get; set;} [DataMember] public string style { get; set;} } [ServiceContract] public interface IService1 { [OperationContract] clsVehicles getVehicles(); } }</pre> <p>service1.cs</p> <pre class="prettyprint">using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using System.ServiceModel.Activation; using System.ServiceModel.Web; using System.Text; using System.Data.SqlClient; using System.Data; namespace WcfRestService { // Start the service and browse to http://&lt;machine_name&gt;:&lt;port&gt;/Service1/help to view the service's generated help page // NOTE: By default, a new instance of the service is created for each call; change the InstanceContextMode to Single if you want // a single instance of the service to process all calls. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] // NOTE: If the service is renamed, remember to update the global.asax.cs file public class Service1 : IService1 { private const string sConn = "MYDATABSECONNECTION"; // TODO: Implement the collection resource that will contain the SampleItem instances [WebGet(UriTemplate = "getVehicles")] public clsVehicles getVehicles() { List&lt;string&gt; list = new List&lt;string&gt;(); clsVehicles objCustomer = new clsVehicles(); try { SqlConnection objConnection = new SqlConnection(); objConnection.ConnectionString = sConn; DataSet ObjDataset = new DataSet(); SqlDataAdapter objAdapater = new SqlDataAdapter(); SqlCommand objCommand = new SqlCommand ("mydatabase.[dbo].[SelectVehicles]"); objConnection.Open(); objCommand.Connection = objConnection; objAdapater.SelectCommand = objCommand; objAdapater.Fill(ObjDataset); objCustomer.invNo = ObjDataset.Tables[0].Rows[0][0].ToString(); objCustomer.carNo = ObjDataset.Tables[0].Rows[0][1].ToString(); objCustomer.saleDate = ObjDataset.Tables[0].Rows[0][2].ToString(); objCustomer.sold = ObjDataset.Tables[0].Rows[0][3].ToString(); objCustomer.year = ObjDataset.Tables[0].Rows[0][4].ToString(); objCustomer.make = ObjDataset.Tables[0].Rows[0][5].ToString(); objCustomer.model = ObjDataset.Tables[0].Rows[0][6].ToString(); objCustomer.mileage = ObjDataset.Tables[0].Rows[0][7].ToString(); objCustomer.style = ObjDataset.Tables[0].Rows[0][8].ToString(); objConnection.Close(); } catch (SqlException ex) { objCustomer.invNo = "DB ERROR " + ex; } catch (Exception e) { objCustomer.invNo = "DB ERROR " + e; } finally { } return objCustomer; } } } </pre> <p>When I run the URI call getVehicles I recieve this;</p> <pre class="prettyprint">- &lt;clsVehicles xmlns="http://schemas.datacontract.org/2004/07/WcfRestService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;carNo&gt;A1&lt;/carNo&gt; &lt;invNo&gt;262702&lt;/invNo&gt; &lt;make&gt;TOYOTA&lt;/make&gt; &lt;mileage&gt;193780&lt;/mileage&gt; &lt;model&gt;TACOMA PRERUNNER&lt;/model&gt; &lt;saleDate&gt;12/23/2011 12:00:00 AM&lt;/saleDate&gt; &lt;sold&gt;False&lt;/sold&gt; &lt;style /&gt; &lt;year&gt;1999&lt;/year&gt; &lt;/clsVehicles&gt;</pre> <p>While I am wanting to return the clsVehicles node for each vehicle returned from the stored proc call I am making.<br> <br> Any help/guidance is greatly appreciated. Regards, Shawn</p> 2011-12-31T05:45:01-05:002011-12-31T05:45:01.247-05:00urn:uuid:00000000-0000-0000-0000-000004752428http://forums.asp.net/p/1753582/4752428.aspx/1?Simple+question+I+think+but+I+don+t+know+the+answerSimple question I think but I don't know the answer <p>I was playing around with the WCF rest kit but alway get wrong XML&nbsp;output of my class I try to expose so I striped it down to a small sample and see some behavior I don't understand</p> <p>When i return this clas in a API I made :</p> <pre class="prettyprint">using System; namespace WH.Web.Models { public class Sample { public Sample() { this.id = 1; this.titel = &quot;Testing&quot;; this.auteur = &quot;Filip Beunens&quot;; } public int id { get; set; } public String titel { get; set; } public String auteur { get; set; } } }</pre> <p>I get</p> <p style="padding-left: 30px;">&lt;?xml version="1.0" encoding="utf-8" ?&gt; <br />- &lt;Sample xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <br />&lt;id&gt;1&lt;/id&gt; <br />&lt;titel&gt;Testing&lt;/titel&gt; <br />&lt;auteur&gt;Filip Beunens&lt;/auteur&gt; <br />&lt;/Sample&gt;</p> <p style="padding-left: 30px;">But with this one it go's wrong</p> <pre class="prettyprint">using System; namespace WH.Web.Models { public class Sample { private int _id; private string _titel; private string _auteur; public Sample() { _id = 1; _titel = "Testing"; _auteur = "Filip Beunens"; } public int id { get{return _id;} } public String titel { get{return _titel;} } public String auteur { get { return _auteur; }} } }</pre> <p>output is empty.. but why ?</p> <p>THANKS for helping out</p> 2011-12-27T21:19:48-05:002011-12-27T21:19:48.183-05:00urn:uuid:00000000-0000-0000-0000-000003944052http://forums.asp.net/p/1572364/3944052.aspx/1?WCF+Restful+Streaming+Large+filesWCF Restful: Streaming Large files <p>Hi<br> <br> I created a Restful WCF Service to upload large file stream(4 Gb and more). We used webHttpBinding and enabled streaming. <br> I could upload the files which are less than 2 Gb in size but I cannot upload files more than 2 Gb. <br> When I investigated into the problem, the upload stream size is limited by httpRuntime's maxRequestLength value (whose max value is 1.999995Gb). <br> I could see many people uploading more than 2 Gb files using WCF. </p> <p>Q1. Is it possible to upload files from client to Server using Restful WCF service without chunking.</p> <p>Q2. Can any one please provide solution how to overcome this issue to upload more than 2gb files.&nbsp; <br> &nbsp;Any comments/suggestions and resource are really appreciated. </p> <p>Below is my configuration file's System.ServiceModel and System.Web section. (Please let me know if I miss to give any details or if this question is incomplete)</p> <p>-----------------------------------------------------------------------------------------------------------------------------------------------------------</p> <p><br> &nbsp;&nbsp;&nbsp; &lt;system.serviceModel&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;services&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<b> &lt;service name=&quot;WcfService1.Service1&quot; behaviorConfiguration=&quot;WcfService1.Service1Behavior&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!-- Service Endpoints --&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;endpoint address=&quot;&quot; behaviorConfiguration=&quot;web&quot; binding=&quot;webHttpBinding&quot; bindingConfiguration=&quot;webBinding&quot; contract=&quot;WcfService1.IService1&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</b> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;identity&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;dns value=&quot;localhost&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/identity&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/endpoint&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;endpoint address=&quot;mex&quot; binding=&quot;mexHttpBinding&quot; contract=&quot;IMetadataExchange&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/service&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/services&gt;<br> &nbsp;&nbsp;&nbsp; &lt;bindings&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;webHttpBinding&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>&lt;binding transferMode=&quot;Streamed&quot; maxBufferSize=&quot;2147483647&quot;&nbsp; maxReceivedMessageSize=&quot;2147483647&quot; openTimeout=&quot;00:25:00&quot; closeTimeout=&quot;00:25:00&quot; sendTimeout=&quot;00:25:00&quot; receiveTimeout=&quot;00:25:00&quot;&nbsp; name=&quot;webBinding&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--&lt;security mode=&quot;Transport&quot;&gt;&lt;/security&gt;--&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/binding&gt;<br> </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/webHttpBinding&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/bindings&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;behaviors&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;serviceBehaviors&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;behavior name=&quot;WcfService1.Service1Behavior&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;serviceMetadata httpGetEnabled=&quot;true&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;serviceDebug includeExceptionDetailInFaults=&quot;false&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/behavior&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/serviceBehaviors&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;endpointBehaviors&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;behavior name=&quot;web&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;webHttp /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/behavior&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;behavior name=&quot;web2&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;webHttp /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/behavior&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/endpointBehaviors&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/behaviors&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/system.serviceModel&gt;</p> <p>&lt;system.web&gt;<br> <br> <b>&nbsp;&nbsp;&nbsp; &lt;httpRuntime maxRequestLength=&quot;2048000&quot; executionTimeout= &quot;3600&quot;&nbsp; /&gt;<br> </b>&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;compilation debug=&quot;true&quot;&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;assemblies&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add assembly=&quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/assemblies&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/compilation&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!--<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The &lt;authentication&gt; section enables configuration <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; of the security authentication mode used by <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASP.NET to identify an incoming user. <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;authentication mode=&quot;Windows&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!--<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The &lt;customErrors&gt; section enables configuration <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; of what to do if/when an unhandled error occurs <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; during the execution of a request. Specifically, <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; it enables developers to configure html error pages <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to be displayed in place of a error stack trace.<br> <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;GenericErrorPage.htm&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error statusCode=&quot;403&quot; redirect=&quot;NoAccess.htm&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error statusCode=&quot;404&quot; redirect=&quot;FileNotFound.htm&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/customErrors&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;pages&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;controls&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add tagPrefix=&quot;asp&quot; namespace=&quot;System.Web.UI&quot; assembly=&quot;System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/controls&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/pages&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;httpHandlers&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;remove verb=&quot;*&quot; path=&quot;*.asmx&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add verb=&quot;*&quot; path=&quot;*.asmx&quot; validate=&quot;false&quot; type=&quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add verb=&quot;*&quot; path=&quot;*_AppService.axd&quot; validate=&quot;false&quot; type=&quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add verb=&quot;GET,HEAD&quot; path=&quot;ScriptResource.axd&quot; type=&quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot; validate=&quot;false&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/httpHandlers&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;httpModules&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;add name=&quot;ScriptModule&quot; type=&quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&quot;/&gt;<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/httpModules&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/system.web&gt;</p> 2010-06-25T05:18:43-04:002010-06-25T05:18:43.363-04:00urn:uuid:00000000-0000-0000-0000-000004745225http://forums.asp.net/p/1752340/4745225.aspx/1?WCF+Service+passing+Stored+procedure+WCF Service passing Stored procedure. <p><em><span style="text-decoration:underline">Split off from <a href="../../t/1551657.aspx/1?WCF&#43;Service&#43;passing&#43;Stored&#43;procedure"> http://forums.asp.net/t/1551657.aspx/1?WCF&#43;Service&#43;passing&#43;Stored&#43;procedure</a>&#43;#</span></em></p> <p>Hi</p> <p>Did you got the answer? i am gettin error in</p> <pre class="prettyprint">@params[i].ParameterName =spParameter[i].Paraname ;</pre> <p>line. please help me. this is what i am looking for.</p> <p></p> <p></p> 2011-12-22T13:13:03-05:002011-12-22T13:13:03.417-05:00urn:uuid:00000000-0000-0000-0000-000004729214http://forums.asp.net/p/1749166/4729214.aspx/1?Unable+to+load+metadata+for+return+type+Service+Classname+of+method+Service+Classname+MethodUnable to load metadata for return type '[Service.Classname]' of method '[Service.Classname]' Method <p>Hi I am getting below error after adding a class BO.ContentList in the data aservice which retrns content details with a list of tag's <br> if i comment the method which is using this class, the data service works fine . please help me .... <br> &nbsp;<br> The server encountered an error processing the request.<br> &nbsp;The exception message is <br> 'Unable to load metadata for return type 'WhatsNewAtDataService.BO.ContentList' <br> of method 'WhatsNewAtDataService.BO.ContentList GetContentWithTags(Int32)'.'. <br> See server logs for more details. The exception stack trace is:</p> <p>at System.Data.Services.Providers.BaseServiceProvider.AddServiceOperation(MethodInfo method, String protocolMethod) at System.Data.Services.Providers.BaseServiceProvider.AddOperationsFromType(Type type) at System.Data.Services.DataService`1.CreateProvider() at System.Data.Services.DataService`1.HandleRequest() at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet</p> 2011-12-13T12:19:16-05:002011-12-13T12:19:16.91-05:00urn:uuid:00000000-0000-0000-0000-000004720018http://forums.asp.net/p/1747284/4720018.aspx/1?While+Rest+client+Call+I+am+getting+Bad+Request+Error+400+While Rest client Call, I am getting "Bad Request Error (400)"? <p>Hi,</p> <p><strong>What I have to do is:</strong></p> <p>1. I have .pem file using this i need to send SSL/TLS Client Call[<strong>REST Client Call</strong>] over https..........</p> <p><strong>Issue is : </strong>I am not getting response, getting some error such as <strong>&quot;Bad Request Error 400&quot;</strong> and <strong>&quot;Cound not establish trust relationship for SSL/TSL secure channel&quot;.</strong></p> <p><strong>My code look like as below :-</strong></p> <p><strong>Note: </strong><strong><strong>PEMServerCertFileLocation - </strong></strong>File Name(.pem)- Key file validate againt the server</p> <p>ServicePointManager.CertificatePolicy = new DECECertificatePolicy();<br> &nbsp;&nbsp;ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate(<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; object sender2,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X509Certificate certificate,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X509Chain chain,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SslPolicyErrors sslPolicyErrors)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br> ServicePointManager.CheckCertificateRevocationList = true;<br> ServicePointManager.Expect100Continue = false;<br> ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;<br> HttpWebRequest request = WebRequest.Create(<strong>url</strong>) as HttpWebRequest;<br> request.AllowAutoRedirect = true;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (isSecureAccess)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;X509Certificate x509Certificate = LoadCertificateFile(<strong>PEMServerCertFileLocation</strong>);<br> &nbsp;&nbsp;&nbsp;<strong>//&nbsp; Adding x509 certificates into x509 certificate store -&nbsp;&nbsp;userdefined method</strong><br> &nbsp;&nbsp;&nbsp;Add(x509Certificate);<br> &nbsp;&nbsp;&nbsp;request.ClientCertificates.Add(x509Certificate);<br> &nbsp;&nbsp;&nbsp;XmlDocument xmlDoc = new XmlDocument();<br> &nbsp;&nbsp;&nbsp;xmlDoc.Load(&quot;accountcreate.xml&quot;);<br> &nbsp;&nbsp;&nbsp;string str = xmlDoc.InnerXml; <strong>//xml data coverted into string ,sending along with https call</strong><br> &nbsp;&nbsp;&nbsp;request.Credentials = CredentialCache.DefaultCredentials;<br> &nbsp;&nbsp;&nbsp;request.ContentType = &quot;application/xml&quot;;<br> &nbsp;&nbsp;&nbsp;request.Method = &quot;POST&quot;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;request.ProtocolVersion = HttpVersion.Version11;<br> &nbsp;&nbsp;&nbsp;byte[] postBytes = Encoding.ASCII.GetBytes(str);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using (Stream requestStream = request.GetRequestStream()) <strong> //Request</strong><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; requestStream.Write(postBytes, 0, postBytes.Length);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; requestStream.Close();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;}<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (request.HaveResponse)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HttpWebResponse response = (HttpWebResponse)request.GetResponse(); <strong>//Response</strong><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Convert response into string<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;strResult = ConvertResponseToString(response);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;}<br> &nbsp;&nbsp; }</p> <p>&nbsp;</p> <p>I am struggle lot , Please provide good solution for this.</p> <p>What i coded is correct?</p> <p>Thanks,</p> <p>Ramesh.</p> <p>&nbsp;</p> 2011-12-07T11:32:01-05:002011-12-07T11:32:01.287-05:00urn:uuid:00000000-0000-0000-0000-000004637995http://forums.asp.net/p/1730106/4637995.aspx/1?WCF+REST+service+returns+XML+for+FireFox+s+b+JSONWCF REST service returns XML for FireFox s/b JSON <p>I have a WCF REST application designed to return JSON.</p> <p>From IE and CHROME, my request returns JSON (as it should).</p> <p>From FireFox, the same request retuns XML, which is the problem.</p> <p>I need to get it to return JSON for all browsers.</p> <p>The POST header varies from CHROME and FireFox.</p> <p>FireFox POST header:</p> <pre>POST http://devserver/fc/server/fcrestsvr/svcacct/ValidateUser HTTP/1.1<br>Host: devserver<br>User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2<br>Accept: text/html,application/xhtml&#43;xml,application/xml;q=0.9,*/*;q=0.8<br>Accept-Language: en-us,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<br>Connection: keep-alive<br>Content-Type: application/json; charset=UTF-8<br>X-Requested-With: XMLHttpRequest<br>Referer: http://devserver/fc/client/index.html<br>Content-Length: 63<br>Pragma: no-cache<br>Cache-Control: no-cache<br><br>{&quot;AccountID&quot;:0,&quot;AccountName&quot;:&quot;&quot;,&quot;LoginName&quot;:&quot;a&quot;,&quot;Password&quot;:&quot;a&quot;}</pre> <pre></pre> <pre>CHROME header:</pre> <pre></pre> <pre>POST http://devserver/fc/server/fcrestsvr/svcacct/ValidateUser HTTP/1.1<br>Host: devserver<br>Connection: keep-alive<br>Content-Length: 63<br>Origin: http://devserver<br>X-Requested-With: XMLHttpRequest<br>User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1<br>Content-Type: application/json<br>Accept: */*<br>Referer: http://devserver/fc/client/fcdev.html<br>Accept-Encoding: gzip,deflate,sdch<br>Accept-Language: en-US,en;q=0.8<br>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3<br><br>{&quot;AccountID&quot;:0,&quot;AccountName&quot;:&quot;&quot;,&quot;LoginName&quot;:&quot;a&quot;,&quot;Password&quot;:&quot;a&quot;}</pre> <pre></pre> <pre>I don't control the headers on the GET, as I am using JavaScript framework Ext-JS v4.0.6 and the POST is issued by the data store.</pre> <pre>Here is the WCF REST service code, where I did some experimentation with &quot;WebOperationContext....ContentType&quot; but without success:</pre> <pre> [ServiceContract]</pre> <pre> [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]</pre> <pre> [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]<br> public class svcacct {<br> [WebInvoke(Method = &quot;POST&quot;, UriTemplate = &quot;ValidateUser&quot;,<br> RequestFormat = WebMessageFormat.Json,<br> ResponseFormat = WebMessageFormat.Json,<br> BodyStyle = WebMessageBodyStyle.Bare)]<br> public fcdataDTO.AccountItem ValidateUser(fcdataDTO.AccountDTO accountDTO) {<br> fcdataDTO.AccountItem ret = fcdata.AccountData.ValidateUser(accountDTO);<br> // Trying to resolve problem whereby server returns XML when GET issued from FireFox<br> // WebOperationContext.Current.OutgoingResponse.ContentType = &quot;text/html&quot;;<br> // WebOperationContext.Current.OutgoingResponse.ContentType = &quot;application/json&quot;;<br> if (ret.success == false) {<br> WebOperationContext.Current.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.BadRequest;<br> WebOperationContext.Current.OutgoingResponse.StatusDescription = ret.message;<br> }<br> return ret;<br> }<br><br></pre> <pre>Thank you in advance for your help!</pre> <pre></pre> 2011-10-13T17:51:13-04:002011-10-13T17:51:13.713-04:00urn:uuid:00000000-0000-0000-0000-000004718219http://forums.asp.net/p/1746888/4718219.aspx/1?REST+service+workspace+summary+xmlREST service workspace summary xml <p>I have a WCF based REST service and it exposes various Entities. I would like to create&nbsp; an Atom Summary XML for all my service entities. How can I do that?</p> <p>If you use the following link you can get the atom summary for this odata service</p> <p><a href="http://services.odata.org/OData/OData.svc/">http://services.odata.org/OData/OData.svc/</a></p> <p>&nbsp;</p> &lt;div style=&quot;color: blue; font-weight: normal; margin-left: -4em;&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;true&quot;?&gt;&lt;/div&gt; <p>&nbsp;&nbsp;&nbsp; <a class="collapse" href="#" style="color:blue; margin-left:-2em; position:relative"> &lt;<span style="color:#990000">service</span> <span style="color:red">xmlns</span>=&quot;<span style="color:red; font-weight:bold">http://www.w3.org/2007/app</span>&quot; <span style="color:red">xmlns:app</span>=&quot;<span style="color:red; font-weight:bold">http://www.w3.org/2007/app</span>&quot; <span style="color:red">xmlns:atom</span>=&quot;<span style="color:red; font-weight:bold">http://www.w3.org/2005/Atom</span>&quot; <span style="color:red">xml:base</span>=&quot;<span style="color:red; font-weight:bold">http://services.odata.org/OData/OData.svc&nbsp;&nbsp;&nbsp; /&nbsp;&nbsp;</span></a></p> <p><span style="color:red; font-weight:bold">&nbsp;&lt;workspace&gt; <br> &nbsp; &lt;atom:title&gt;Default&lt;/atom:title&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;collection href=&quot;Products&quot;&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atom:title&gt;Products<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/atom:title&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp; &lt;/collection&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp; &lt;collection href=&quot;Categories&quot;&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atom:title&gt;Categories&lt;/atom:title&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp; &lt;/collection&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp; &lt;collection href=&quot;Suppliers&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atom:title&gt;Suppliers&lt;/atom:title&gt; <br> &nbsp;&nbsp;&nbsp;&nbsp; &lt;/collection&gt;<br> &nbsp; &lt;/workspace&gt;<br> &nbsp;&lt;/service&gt;</span></p> <p>&nbsp;</p> 2011-12-06T15:38:59-05:002011-12-06T15:38:59.307-05:00urn:uuid:00000000-0000-0000-0000-000004715972http://forums.asp.net/p/1746444/4715972.aspx/1?DEVELOPING+WCF+REST+WITH+SQL+SERVER+VALIDATING+XML+OUTPUT+WITH+XSD+DEVELOPING WCF REST WITH SQL SERVER/VALIDATING XML OUTPUT WITH XSD. <p>I'M A NEWBIE IN WCF REST</p> <p>HOW DO I PUBLISH A HTTP/XML RESTED INTERFACE THAT WILL PUBLISH THE CONTENT OF THE XML GIVEN BELOW FROM A SQL SERVER DATABASE.</p> <pre class="prettyprint">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;nlt:entertainment xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:nlt='http://nokia.com/nlt/entertainment' xsi:schemaLocation='http://nokia.com/nlt/entertainment entertainment.xsd'&gt; &lt;!-- The jist service's content should be enclosed with the jist tag--&gt; &lt;nlt:jist createdate=&quot;2010-01-02&quot;&gt; &lt;nlt:content-group lang=&quot;en&quot; regions=&quot;&quot;&gt; &lt;nlt:content id=&quot;1&quot; sourceId=&quot;bbc&quot; valid=&quot;2010-06-01&quot;&gt; &lt;nlt:title&gt;Sample title&lt;/nlt:title&gt; &lt;nlt:body&gt;Example gossip contents&lt;/nlt:body&gt; &lt;/nlt:content&gt; &lt;nlt:content id=&quot;2&quot; sourceId=&quot;bbc&quot; valid=&quot;2010-06-01&quot;&gt; &lt;nlt:title&gt;Sample title&lt;/nlt:title&gt; &lt;nlt:body&gt;Example gossip contents&lt;/nlt:body&gt; &lt;/nlt:content&gt; &lt;/nlt:content-group&gt; &lt;nlt:content-group lang=&quot;en&quot; regions=&quot;&quot;&gt; &lt;nlt:content id=&quot;3&quot; sourceId=&quot;bbc&quot; valid=&quot;2010-06-01&quot;&gt; &lt;nlt:title&gt;Sample title&lt;/nlt:title&gt; &lt;nlt:body&gt;Example gossip contents&lt;/nlt:body&gt; &lt;/nlt:content&gt; &lt;nlt:content id=&quot;4&quot; sourceId=&quot;bbc&quot; valid=&quot;2010-06-01&quot;&gt; &lt;nlt:title&gt;Sample title&lt;/nlt:title&gt; &lt;nlt:body&gt;Example gossip contents&lt;/nlt:body&gt; &lt;/nlt:content&gt; &lt;/nlt:content-group&gt; &lt;/nlt:jist&gt; &lt;/nlt:entertainment&gt;</pre> <pre class="prettyprint">&nbsp;</pre> <pre class="prettyprint">PART OF THE REQUIREMENT ALSO IS THAT THE OUTPUT SHOULD BE DISPLAYED BASED ON THE FOLLOWING XML SCHEMA DOCUMENT.</pre> <pre class="prettyprint">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://nokia.com/nlt/entertainment" xmlns:tns="http://nokia.com/nlt/entertainment" elementFormDefault="qualified" xmlns:ns="http://nokia.com/nlt/regionalisation"&gt; &lt;xsd:import namespace="http://nokia.com/nlt/regionalisation" schemaLocation="nigeria-regionalisation.xsd"/&gt; &lt;xsd:import namespace="http://nokia.com/nlt/internationalisation" schemaLocation="nigeria-languages.xsd"/&gt; &lt;xsd:complexType name="serviceTagType"&gt; &lt;xsd:sequence/&gt; &lt;xsd:attribute name="createdate" type="xsd:date" use="required"/&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="contentUnitType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A single piece of content. It must consist of header (title) and body. The title may contain advice category. The body should contain the advice itself. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="title"&gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base="xsd:string"/&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;xsd:element name="body"&gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base="xsd:string"/&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name="sourceId" type="xsd:string" use="required"/&gt; &lt;xsd:attribute name="id" type="xsd:string" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;An unique id of the single piece of content (that's delivered to a subscriber as a single message). It must be unique.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;xsd:attribute name="valid" type="xsd:date" use="required"/&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="contentGroupType"&gt; &lt;xsd:sequence/&gt; &lt;xsd:attribute name="lang" type="xsd:language" use="required"/&gt; &lt;xsd:attribute name="regions" type="ns:listOfRegions" use="required"/&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="errorType"&gt; &lt;xsd:sequence/&gt; &lt;xsd:attribute name="type" type="xsd:string" use="required"/&gt; &lt;/xsd:complexType&gt; &lt;xsd:element name="entertainment"&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence&gt; &lt;xsd:choice minOccurs="0"&gt; &lt;xsd:sequence&gt; &lt;xsd:choice&gt; &lt;!--A root element for the Entertainment Jist service content--&gt; &lt;xsd:element name="jist" minOccurs="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;This tag encloses the content elements of the Entertainment Jist service&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:serviceTagType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content-group" maxOccurs="unbounded" xmlns:entertainment="http://nokia.com/nlt/entertainment"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A single piece of Entertainment Jist content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentGroupType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content" maxOccurs="unbounded"&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentUnitType"&gt; &lt;xsd:sequence/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;!--A root element for the Football service content--&gt; &lt;xsd:element name="football" minOccurs="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;This tag encloses the content elements of the Football service&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:serviceTagType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content-group" maxOccurs="unbounded"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A single piece of Entertainment Jist content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentGroupType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content" maxOccurs="unbounded"&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentUnitType"&gt; &lt;xsd:sequence/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name="team" type="xsd:string"/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;!--A root element for the News service content--&gt; &lt;xsd:element name="news" minOccurs="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;This tag encloses the content elements of the News service&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:serviceTagType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content-group" maxOccurs="unbounded"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A single piece of Entertainment Jist content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentGroupType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content" maxOccurs="unbounded"&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentUnitType"&gt; &lt;xsd:sequence/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name="category" type="xsd:string" use="required"/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;!--A root element for the Music service content--&gt; &lt;!--A root element for the Horoscope service content--&gt; &lt;xsd:element name="horoscope"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;This tag encloses the content elements of the Horoscope service&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:serviceTagType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content-group" maxOccurs="unbounded"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A single piece of Entertainment Jist content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentGroupType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content" maxOccurs="unbounded"&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentUnitType"&gt; &lt;xsd:sequence/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name="zodiac" type="xsd:string" use="required"/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;!--A root element for the Jokes service content--&gt; &lt;xsd:element name="jokes"&gt; &lt;xsd:complexType&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;This tag encloses the content elements of the Jokes service&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:serviceTagType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content-group" maxOccurs="unbounded"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A single piece of Entertainment Jist content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentGroupType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="content" maxOccurs="unbounded"&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="tns:contentUnitType"&gt; &lt;xsd:sequence/&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:choice&gt; &lt;xsd:element name="error" maxOccurs="unbounded" minOccurs="0" type="tns:errorType"&gt;&lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:choice&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:key name="jistContentKey"&gt; &lt;xsd:selector xpath="tns:jist/tns:content-group/tns:content"/&gt; &lt;xsd:field xpath="@id"/&gt; &lt;/xsd:key&gt; &lt;xsd:key name="jokesContentKey"&gt; &lt;xsd:selector xpath="tns:jokes/tns:content-group/tns:content"/&gt; &lt;xsd:field xpath="@id"/&gt; &lt;/xsd:key&gt; &lt;xsd:key name="newsContentKey"&gt; &lt;xsd:selector xpath="tns:news/tns:content-group/tns:content"/&gt; &lt;xsd:field xpath="@id"/&gt; &lt;/xsd:key&gt; &lt;xsd:key name="footballContentKey"&gt; &lt;xsd:selector xpath="tns:football/tns:content-group/tns:content"/&gt; &lt;xsd:field xpath="@id"/&gt; &lt;/xsd:key&gt; &lt;xsd:key name="horoscopeContentKey"&gt; &lt;xsd:selector xpath="tns:horoscope/tns:content-group/tns:content"/&gt; &lt;xsd:field xpath="@id"/&gt; &lt;/xsd:key&gt; &lt;/xsd:element&gt; &lt;xsd:complexType name="contentType" mixed="true"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Base type for the content elements. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:sequence&gt; &lt;!--The title of the content--&gt; &lt;!--The body of the content--&gt; &lt;/xsd:sequence&gt; &lt;!--Unique identifier of the content--&gt; &lt;xsd:attribute name="id" type="xsd:int" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Unique identifier of the content. If the same identifier exist in the NLT database it will be overwritten, otherwise a new content element will be created. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;!--Identifier of the source that the content is provided by--&gt; &lt;xsd:attribute name="sourceId" type="xsd:int" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Identifier of the source of the content. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;!-- Language of the content E.g.: hi-IN en pl --&gt; &lt;xsd:attribute name="lang" type="xsd:language" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Language of the source of the content. Language will be defined as an IETF language tag, which comprises of two-letter ISO 639-1 language code accompanied with an optional country variant information according to ISO 3166-1. For example, &ldquo;en&rdquo; or &ldquo;hi-IN&rdquo;. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;!--Date that the content is valid for.--&gt; &lt;xsd:attribute name="date" type="xsd:date" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; The date that the content is valid for. For instance for the Horoscope service it should contain the date of horoscope. If the content is not date specific it should contain the date of when the content has been created. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="profileType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Base type for profile to content mapping elements. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:choice&gt; &lt;xsd:element name="content" maxOccurs="unbounded"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Content element that is valid for the profile. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:sequence/&gt; &lt;xsd:attribute name="id" type="xsd:int" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; An ID of the content element. It must refer to an existing content element. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;xsd:attribute name="priority" type="xsd:int" default="0"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Priority of the content element. The lower priority the more important the content. This parameter is service/channel-specific. For some services it will be ignored. For some services it will determine the order of delivery. If there are multiple content elements of the same priority mapped to the same profile the order of delivery will be random. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;xsd:element name="error"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; Error in the profile-content mapping. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:attribute name="id" type="xsd:int"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt; An ID of the error. I must refer to the existing error defined outside of the map tag. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; &lt;/xsd:choice&gt; &lt;xsd:attribute name="id" type="xsd:string"/&gt; &lt;/xsd:complexType&gt; &lt;xsd:simpleType name="sourceIdType"&gt; &lt;xsd:restriction base="xsd:int"/&gt; &lt;/xsd:simpleType&gt; &lt;xsd:simpleType name="footballTeamType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A dictionary of Football teams.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:restriction base="xsd:int"&gt; &lt;xsd:enumeration value="0"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Manchester United&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Arsenal&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="2"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Chelsea&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="3"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Liverpool&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="4"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;AC Milan&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="5"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Barcelona FC&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="6"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Real Madrid&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="7"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Inter Milan&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;xsd:simpleType name="newsCategoryType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A list of available News categories&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:restriction base="xsd:int"&gt; &lt;xsd:enumeration value="0"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Politics&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Business&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="2"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Sports&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="3"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Entertainment&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="4"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;International&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;xsd:simpleType name="musicGenreType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A list of available Music genres/categories.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:restriction base="xsd:int"&gt; &lt;xsd:enumeration value="0"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Naija Top 10&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;World Top 10&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="2"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Hip/Hop Dancehall&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="3"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;RNB Smooth&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="4"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Oldies&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="5"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Rock and Alternative&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="6"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Gospel&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;xsd:simpleType name="zodiacSignType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A list of available Zodiac signs.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:restriction base="xsd:string"&gt; &lt;xsd:enumeration value="0"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Acquarius&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="1"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Pisces&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="2"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Aries&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="3"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Taurus&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="4"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Gemini&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="5"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Cancer&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="6"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Leo&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="7"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Virgo&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="8"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Libra&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="9"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Scorpio&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="10"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Sagittarius&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="11"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Capricorn&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;xsd:complexType name="simpleContentType" mixed="true"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A content tag type derived from contentTyp XSD type.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension xmlns:entertainment="http://nokia.com/nlt/entertainment" base="tns:contentType"&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="title"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A title of a piece of content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base="xsd:string"/&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;xsd:element name="body"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A body of a piece of content&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base="xsd:string"/&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="ringtoneContentType" mixed="true"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A content tag type derived from contentType XSD type that is suitable for a ringtone element.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension xmlns:entertainment="http://nokia.com/nlt/entertainment" base="tns:contentType"&gt; &lt;xsd:attribute name="genreId" type="tns:musicGenreType" use="required"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Genre/Category ID as defined in the musicGenreType enumeration&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="ringtoneType" mixed="true"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Base type for the ringtone element&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="name" type="xsd:string"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Name/title of the song&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;xsd:element name="mime-type" type="xsd:string"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Mime type of the file. May not be used in most of the case. Fill this field with "text/plain" if not applicable.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;xsd:element name="uri" type="xsd:anyURI"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;An URI that the NLT should use to trigged delivery of the ringtone. The URI must contain the &#36;MSISDN&#36; parameter that will be replaced by the NLT with a real MSISDN when a subscriber request the ringtone. See example XMLs. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name="id" type="xsd:int"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Unique identifier of the ringtone. If the NLT receives the ringtone with an ID that already exists in the database it will replace it. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;xsd:attribute name="type" type="tns:ringtoneVariantType"/&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="ringbackType" mixed="true"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Base type for the ringback element&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="name" type="xsd:string"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Name/title of the song&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;xsd:element name="mime-type" type="xsd:string"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Mime type of the file. May not be used in most of the case. Fill this field with "text/plain" if not applicable.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;xsd:element name="uri" type="xsd:anyURI"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;An URI that the NLT should use to trigged delivery of the ringback tone. The URI must contain the &#36;MSISDN&#36; parameter that will be replaced by the NLT with a real MSISDN when a subscriber request the ringback tone. See example XMLs. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;xsd:attribute name="id" type="xsd:int"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Unique identifier of the ringback tone. If the NLT receives the ringtone with an ID that already exists in the database it will replace it. &lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:attribute&gt; &lt;/xsd:complexType&gt; &lt;xsd:simpleType name="ringtoneVariantType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;A list of available ringtone types.&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;xsd:restriction base="xsd:string"&gt; &lt;xsd:enumeration value="mono"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Monophonic&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="poly"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Polyphonic&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;xsd:enumeration value="real"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;Polyphonic&lt;/xsd:documentation&gt; &lt;/xsd:annotation&gt; &lt;/xsd:enumeration&gt; &lt;/xsd:restriction&gt; &lt;/xsd:simpleType&gt; &lt;/xsd:schema&gt; </pre> <pre class="prettyprint">THANKS. </pre> <p>&nbsp;</p> 2011-12-05T13:41:38-05:002011-12-05T13:41:38.983-05:00urn:uuid:00000000-0000-0000-0000-000004714098http://forums.asp.net/p/1746082/4714098.aspx/1?Rest+File+Upload+Only+recording+first+10+000+packetsRest File Upload... Only recording first 10,000 packets <p><span color="#0000ff" face="Consolas" size="2" style="color:#0000ff; font-family:Consolas; font-size:x-small"><span color="#0000ff" face="Consolas" size="2" style="color:#0000ff; font-family:Consolas; font-size:x-small"><span color="#0000ff" face="Consolas" size="2" style="color:#0000ff; font-family:Consolas; font-size:x-small"><span color="#0000ff" face="Consolas" size="2" style="color:#0000ff; font-family:Consolas; font-size:x-small"><span color="#000000" face="Verdana" style="color:#000000; font-family:Verdana">Any thoughts?&nbsp; Code is below.&nbsp; I've been testing with Curl.&nbsp; </span></span></span></span></span></p> <pre class="prettyprint">public void FileUpload(Stream fileStream</pre> <pre class="prettyprint">{</pre> <pre class="prettyprint"> String filename = ("C:\\Data\\DotNetNuke\\Website\\DesktopModules\\DNNCentric-AndroidDNNLogin\\video\\VivoSocial.zip"); </pre> <pre class="prettyprint">FileStream fileToupload = new FileStream(filename, FileMode.Create); </pre> <pre class="prettyprint"> const int bufferLen = 4096;</pre> <pre class="prettyprint"> byte[] buffer = new byte[bufferLen]; </pre> <pre class="prettyprint"> byte[] bytearray = new byte[10000];</pre> <pre class="prettyprint">nt bytesRead, totalBytesRead = 0;</pre> <pre class="prettyprint">do</pre> <pre class="prettyprint">{</pre> <pre class="prettyprint">bytesRead = fileStream.Read(bytearray, 0, bytearray.Length); </pre> <pre class="prettyprint"> totalBytesRead += bytesRead;</pre> <pre class="prettyprint">}</pre> <pre class="prettyprint">while (bytesRead &gt; 0);</pre> <pre class="prettyprint">fileToupload.Write(bytearray, 0, bytearray.Length);</pre> <pre class="prettyprint">fileToupload.Close();</pre> <pre class="prettyprint">fileToupload.Dispose();</pre> <pre class="prettyprint">}</pre> <p></p> 2011-12-04T02:21:24-05:002011-12-04T02:21:24.483-05:00urn:uuid:00000000-0000-0000-0000-000004712575http://forums.asp.net/p/1745748/4712575.aspx/1?What+relation+does+endpoint+address+have+with+client+request+addressWhat relation does endpoint address have with client request address <p>Really new to WCF here. I have a working&nbsp;WCF service and a client (MVC web app) who can talk to each other. The confusion I have is with the &lt;endpoint&gt; element in the service config. How does the address part in endpoint relate to the address I use with the client? Can I change the /AccountService to /anythingiwant and the client can call the service using that address? If not, whats the point of configuring it? Additionally, the client can only access the service using /AccountService.svc address - with the .svc extention. /AccountService returns 404. Whats the point of configuring (and having no effect)?</p> <pre class="prettyprint">&lt;system.serviceModel&gt; &lt;bindings&gt; &lt;webHttpBinding&gt; &lt;binding name=&quot;webHttpBindingWithJsonP&quot; crossDomainScriptAccessEnabled=&quot;true&quot; /&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; &lt;services&gt; &lt;service name=&quot;IAccountService.AccountService&quot;&gt; &lt;endpoint address=&quot;<strong>http://api.dom.tld/sub/AccountService</strong>&quot; bindingConfiguration=&quot;webHttpBindingWithJsonP&quot; binding=&quot;webHttpBinding&quot; contract=&quot;IAccountService&quot; behaviorConfiguration=&quot;webHttpBehavior&quot; listenUri=&quot;<strong>http://api.dom.tld/sub/something</strong>&quot; &gt;&lt;/endpoint&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name=&quot;webHttpBehavior&quot;&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name=&quot;&quot;&gt; &lt;serviceMetadata httpGetEnabled=&quot;true&quot; /&gt; &lt;serviceDebug includeExceptionDetailInFaults=&quot;true&quot; /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot; multipleSiteBindingsEnabled=&quot;true&quot;&gt; &lt;/serviceHostingEnvironment&gt; &lt;/system.serviceModel&gt;</pre> 2011-12-02T15:52:26-05:002011-12-02T15:52:26.253-05:00urn:uuid:00000000-0000-0000-0000-000004699443http://forums.asp.net/p/1743192/4699443.aspx/1?Issue+with+JSON+response+format+with+WCF+c+3+5Issue with JSON response format with WCF c# 3.5 hello expert, i have build a WCF rest api with c# 3.5, here is my sample code public string Login(Login objLogin) { string strResult = &quot;&quot;; if (objLogin.UserName == &quot;username&quot; &amp;&amp; objLogin.Password == &quot;password&quot;) { StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); using (JsonWriter jsonWriter = new JsonTextWriter(sw)) { jsonWriter.WriteStartObject(); jsonWriter.WritePropertyName(&quot;Status&quot;); jsonWriter.WriteValue(&quot;Success&quot;); jsonWriter.WritePropertyName(&quot;Message&quot;); jsonWriter.WriteValue(&quot;Login Successfully&quot;); jsonWriter.WriteEndObject(); } return sb.ToString(); } } after execute this code i am getting the json response in Fiddler with this format: {&quot;LoginResult&quot;:&quot;{\&quot;Status\&quot;:\&quot;Success\&quot;,\&quot;Message\&quot;:\&quot;Login Successfully\&quot;}&quot;} cant i get the response with given below format {&quot;LoginResult&quot;:&quot;{&quot;Status&quot;:&quot;Success&quot;,&quot;Message&quot;:&quot;Login Successfully&quot;}&quot;} i tried much but the json is by default taking &quot;\&quot; , I want the json response with &quot;:&quot; only without &quot;\&quot;. Thanks in advance 2011-11-24T13:15:11-05:002011-11-24T13:15:11.463-05:00urn:uuid:00000000-0000-0000-0000-000004496692http://forums.asp.net/p/1697717/4496692.aspx/1?server+certificate+is+not+configured+properly+with+HTTP+SYS+in+the+HTTPS+caseserver certificate is not configured properly with HTTP.SYS in the HTTPS case <p>Hi,</p> <p>I'm getting an error in WCF REST service hosted in windows server 2003. I could do GET's but when i try to do PUT's it doesn't work. Funny thing is I could enter invalid xml and validation inside PUT method fires but when i put a valid XML i get following error</p> <p></p> <p><strong>An error occurred while making the HTTP request to https://www.MYURL.Service.svc. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.</strong></p> <p></p> <p>I have multiple WCF services (NON REST) hosted in same website folder which works fine but this WCF REST service gives problems in PUT's. Also I'm using Fiddler for Testing the service.</p> <p></p> <p>Please Help!</p> <p></p> <p>Thanks</p> server certificate is not configured properly with HTTP.SYS in the HTTPS case 2011-07-07T16:36:09-04:002011-07-07T16:36:09.343-04:00