New Posts New Posts RSS Feed: Upgrade to DevForce 6.0.5 and can no longer connect to EntityService
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Upgrade to DevForce 6.0.5 and can no longer connect to EntityService

 Post Reply Post Reply
Author
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Topic: Upgrade to DevForce 6.0.5 and can no longer connect to EntityService
    Posted: 10-Sep-2010 at 11:39am
I recently upgraded from 6.0.4 to 6.0.5 and have had some difficulties in making the silverlight application connect to the EntityService/EntityServer.

Here's the error I'm getting

Message: IdeaBlade.EntityModel.EntityServerConnectionException: There is no endpoint listening on http://localhost/eCustody/EntityService.svc/sl that could accept calls from this application.
If running in Visual Studio, make sure CopyLocal=true is set for all IdeaBlade assembly references in the web project to ensure that these assemblies are copied to the bin folder.
To check if the service is running, open your internet browser and navigate to 'http://localhost/eCustody/EntityService.svc'.
If the service page shows errors, these should help diagnose the problem with the service.
If the service is running, then also make sure that the endpoint bindings match between client and server, and that the server's ClientApplicationType is either 'Silverlight' or 'Both'.  Check the server's debug log file for more information. --->
System.ServiceModel.FaultException: Unable to start EntityServer.svc service: The service '/eCustody/EntityServer.svc' cannot be activated due to an exception during compilation. 
The exception message is: Type 'TradePMR.eCustody.Data.Models.Core.CoreEntities' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types..
   at System.ServiceModel.Channels.Remoting.RealProxy.Invoke(Object[] args)
   at proxy_2.EndGetEntityServerName(IAsyncResult )
   at IdeaBlade.EntityModel.RemoteEntityServiceProxy.GetEntityServerName(String dataSourceExtension, String compositionContextName)
   at IdeaBlade.EntityModel.RemoteEntityServerProxyBase.Connect(ConnectAction action)
   --- End of inner exception stack trace ---


Following the exceptions advice, I've gone to http://localhost/eCustody/EntityService.svc and get the service page, so there are no errors. I've attached the debug log below. It looks like everything is started up correctly.

uploads/780/DebugLog.zip

For the record I've opted to use all the DevForce defaults with the virtual path provider, so there are no endpoints defined in my web.config, nor do I have a ServiceReferences.ClientConfig file in my silverlight project.
This has all worked for me in the past so I don't know what happened.

Just in case I'm doing something stupid (again) here's my web.config file:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="ideablade.configuration" type="IdeaBlade.Core.Configuration.IdeaBladeSection, IdeaBlade.Core"/>
  </configSections>

  <connectionStrings>
    <add name="CoreEntities" connectionString="metadata=res://*/Core.csdl|res://*/Core.ssdl|res://*/Core.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=SQL02;Initial Catalog=Core;Persist Security Info=True;User ID=sa;Password=********;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Forms"/>
  </system.web>

    <system.webServer>
    <modules>
      <add name="RequestDBModule" type="TradePMR.eCustody.Web.RequestDBModule"/>
    </modules>
    <handlers>
      <add name="Calendar" verb="*" path="eCustody.ics" type="TradePMR.eCustody.Web.Handlers.Calendar, eCustody.Web"/>
    </handlers>
  </system.webServer>
 
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
</configuration>


Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 10-Sep-2010 at 5:55pm
From the server's debug log it looks like the EntityServer service isn't starting because type TradePMR.eCustody.Data.Models.Core.CoreEntities cannot be serialized.  The error is occuring at service startup because that's when DevForce feeds it all the known types, and WCF is performing some validation to ensure the types are serializable.
 
If you think the type looks good, and is serializable, then check that you've rebuilt everything and all referenced assemblies are the correct version.  Since we made some EDMX code gen changes in 6.0.5, you should also re-gen the entity model code (by saving the EDMX or running the custom tool on the associated .tt).
 
I'm curious about some of the start up messages in the log - do you have any code in the global.asax?
Back to Top
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Posted: 13-Sep-2010 at 5:41am
I was able to figure this out. CoreEntitities is our entity manager. I added a partial class definition to CoreEntities to add a few helper methods, as well as mark it up with some KnownType attributes for some of our server side calls. In order to get that to work, I marked the partial class with IKnownType. This worked just fine prior to 6.0.5, but now I simply moved the KnownType attributes out to a separate class, and everything is working fine again.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down