Note that there are some explanatory texts on larger screens.

plurals
  1. POEntityClassGenerator : Not generating any output for NorthwindDataService
    primarykey
    data
    text
    <p>I am trying to generate the OData Proxy for the service : <a href="http://services.odata.org/Northwind/Northwind.svc/" rel="nofollow noreferrer">http://services.odata.org/Northwind/Northwind.svc/</a>$metadata</p> <p>I am using System.Data.Services.Design.EntityClassGenerator for generating the OData proxy. </p> <p>When I instantiate the EntityClassGenerator and call GenerateCode the output has no errors. But there is no code in the generated proxy code.</p> <p>The same code works for my own service. But when I point it to any external service the EntityClassGenerator is not working.</p> <p>Here is the code :</p> <pre><code> HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(metadataEndpoint); webRequest.Method = "GET"; webRequest.ContentType = "text/xml;encoding='utf-8"; webRequest.Proxy = (proxy != null) ? proxy : WebRequest.DefaultWebProxy; using (WebResponse response = webRequest.GetResponse()) { string xml = string.Empty; XmlReaderSettings settings = new XmlReaderSettings(); using (TextReader reader = new StreamReader(response.GetResponseStream())) { xml = reader.ReadToEnd(); using (XmlTextReader sourceReader = new XmlTextReader(reader)) { using (StringWriter targetWriter = new StringWriter()) { // Generate the OData End point proxy. EntityClassGenerator entityGenerator = new EntityClassGenerator(LanguageOption.GenerateCSharpCode); entityGenerator.OnPropertyGenerated += new EventHandler&lt;PropertyGeneratedEventArgs&gt;(entityGenerator_OnPropertyGenerated); IList&lt;System.Data.Metadata.Edm.EdmSchemaError&gt; errors = entityGenerator.GenerateCode(sourceReader, targetWriter, namespacename); entityGenerator.OnPropertyGenerated -= new EventHandler&lt;PropertyGeneratedEventArgs&gt;(entityGenerator_OnPropertyGenerated); odataProxyCode = targetWriter.ToString(); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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