New Posts New Posts RSS Feed: DevForce 2010 deployment
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DevForce 2010 deployment

 Post Reply Post Reply
Author
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Topic: DevForce 2010 deployment
    Posted: 21-Apr-2010 at 12:41pm
I'm now attempting to deploy my DevForce 2010 Silverlight application to our server and I'm getting the following error when I run the application:
 
"Unhandled Error in Silverlight Application.  There is no endpoint listening on http://udssrv1/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 projectto 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://udssrv1/EntityService.svc'..."
 
Looking at the release notes it says that the *.svc file is no longer necessary and none were created in my web project.  I verified my global.asax file has the following line:
 
System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());
 
I also verified that CopyLocal=true for all the IdeaBlade assemblies and I made sure all were moved to the bin directory on the server.
 
Am I still missing something?
 
 
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 22-Apr-2010 at 5:19pm
Let's first check to see if the service endpoint started properly.  To do this, view http://udssrv1/EntityService.svc in a web browser.  It should show the service description page if it is working.  If not, it should provide error information about what went wrong.
 
Let us know what you find.
 
Back to Top
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Posted: 23-Apr-2010 at 4:13am
When I attempt to navigate to http://udssrv1/EntityService.svc I get the standard "Server Error in '/' Application: The resource cannot be found" page.
 
I'm confused as to where the EntityService.svc file comes from now in DevForce 2010.  Before when I deployed my project with DevForce 2009 I would copy the following files from my local web project folder to the C:\inetpub\wwwroot\cmis\ folder on the server:
 
Default.aspx
EntityServer.svc
EntityService.svc
Global.asax
Silverlight.js
Web.config
 
Now with DevForce 2010 I only have the following files to copy to the server:
 
Default.aspx
Global.asax
Silverlight.js
Web.config
 
Where is the EntityService.svc file come from now and where should it be located on the server for deployment?
 
Just for the heck of it I tried to navigate to http://udssrv1/cmis/EntityService.svc and I got a page telling me "Metadata publishing for this service is currently disabled"
 
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: 23-Apr-2010 at 8:39am
Is the BOS at http://udssrv1/cmis the one in question for DF2010, or from a DF2009 deployment?  If it is your DF2010 deployment then the service is running and the endpoint defined on the client is incorrect. 
 
In DF2010 the .svc files can be served dynamically, via a VirtualPathProvider, or with a physical .svc file.  (There's also a third option to define a serviceActivations element in the web.config, but I can discuss that separately.)  When using the first option of a VirtualPathProvider, the provider must be registered, which it will be in the global.asax.
 
If your BOS is at the cmis location, is "cmis" defined as an ASP.NET application?   The Silverlight client application, in the absence of an app.config or ServiceReferences.ClientConfig, will assume the URL of the BOS is the same as the URL from which the XAP was loaded.  So in this case your XAP probably loaded from http://udssrv1, or the client isn't correctly parsing the URL (which would be a bug).  You can try adding an app.config to your SL application project (which was required in DF2009) to see if that resolves the issue. 
 
 
Back to Top
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Posted: 23-Apr-2010 at 9:31am

The BOS in question is for DF2010.  In my previous post I was just attempting to show the difference between my application when I was using DF2009 and now.

When I was building my application using DF2009 the EntityService.svc and EntityServer.svc files were automatically placed in my web project on my development PC.  When I deployed my application I just copied those two files up to the server and everything worked fine.
 
Now with DF2010 the EntityService.svc and EntityServer.svc files are not present in my web project on my development PC so I never actually copy them to the server.  According to the release notes these files are no longer needed provided the global.asax file has the line specified in the Application_Start method.  I have added the following line in the Application_Start method of my Global.asax

System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());

On my server I have placed my DF2010 silverlight application at the following location c:\inetpub\wwwroot\cmis.  In IIS the "site" located at "CMIS" is an ASP.NET application the contents of which are as follows:
 
Bin folder
ClientBin folder (contains xap file)
Log folder
Default.aspx
Global.asax
Silverlight.js
Web.Config
 
The URL I use to get to my application is http://udssrv1/cmis/default.aspx
 
I guess my confusion is according to the release notes for DF2010 (page 22) it doesn't sound like I need to do anything more than I've done.  I've modified the Global.asax file and so *.svc files are no longer necessary.  I'm doing nothing special in regards to needing probing of assemblies so my understanding is app.config files are not necessary either.  I've made no changes besides adding my database connect sting to the default web.config file that was generated from the Devforce silverlight application VS2010 template.  I apologize but I'm not fully understanding what you're telling me in your last post.  If I need to add an app.config file that is fine but what goes in the app.config file?  Looking in my project within VS2010 there is no app.config in my silverlight project in the first place.  Should there be?
 
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: 23-Apr-2010 at 10:59am
I think your server configuration is fine - you have all the files needed.  The problem is on the client, in the URL it's using to try to talk to the BOS, hence the error message about no endpoint listening on http://udssrv1/EntityService.svc.  This is not the correct address (and I'll open a bug report to fix this problem), so for now you'll need to override DevForce's default address logic with an app.config providing the correct URL. 
 
Here's a sample of what you need in the app.config.   Add the app.config to your SL application project, and set its build action to either Content or Embedded Resource --
 
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">

      <objectServer remoteBaseURL="http://udssrv1" serverPort="80" serviceName="cmis/EntityService.svc/sl" />

   </ideablade.configuration>
</configuration>
 
Back to Top
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Posted: 23-Apr-2010 at 12:01pm
OK I added the app.config to my silverlight project and compiled (build action set to Content)
 
I'm still receiving the same error as in my original posting.  Here is my app.config file:

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">

<objectServer remoteBaseURL="http://UDSSRV1" serverPort="80" serviceName="cmis/EntityService.svc/sl" />

</ideablade.configuration>

</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: 23-Apr-2010 at 12:22pm
Chad, please post the contents of your debuglog, or send the file to me - kimj@
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: 23-Apr-2010 at 6:30pm
OK, sorry for the confusion.  You can disregard my post about your debuglog for now; there is a DevForce bug in the logic setting up the endpoint address on the client, which is why it's trying to point to the wrong URL.  You can work around this by adding a ServiceReferences.ClientConfig file to your SL application project (and you can remove the app.config).  The contents of the file should look like the following -
 
<configuration>
  <system.serviceModel>
    <client>
      <endpoint name="EntityService"
                address="http://udssrv1/cmis/EntityService.svc/sl"
                binding="customBinding" bindingConfiguration="customBinaryBinding"
                contract="IdeaBlade.EntityModel.IEntityServiceContractAsync"
                />
      <endpoint name="EntityServer"
                address="http://udssrv1/cmis/EntityServer.svc/sl"
                binding="customBinding" bindingConfiguration="customBinaryBinding"
                contract="IdeaBlade.EntityModel.IEntityServerContractAsync"
                />
    </client>
    <bindings>
      <customBinding>
        <!-- Custom binding using http, binary encoding, no security -->
        <binding name="customBinaryBinding">
          <binaryMessageEncoding/>
          <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
      </customBinding>
    </bindings>
  </system.serviceModel>
</configuration>
 
We'll have this problem fixed in the next release.  Based on the information you've provided, and the fact that you can open the service description page via the browser, your web setup should be OK, so once the client is using the correct URL it should connect :).
 
Back to Top
cjohnson84 View Drop Down
Groupie
Groupie


Joined: 24-Sep-2009
Location: Akron, Ohio
Posts: 44
Post Options Post Options   Quote cjohnson84 Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2010 at 4:42am
I added the ServiceReferences.ClientConfig file as you suggested and I am now able to successfully deploy my application.  Thank you for all your help on this issue!  I'll make a note to myself to check to see that this bug is fixed in your next release.  Thank you once again!  You've been extremely helpful!
Back to Top
stephenmcd1 View Drop Down
DevForce MVP
DevForce MVP


Joined: 27-Oct-2009
Location: Los Angeles, CA
Posts: 166
Post Options Post Options   Quote stephenmcd1 Quote  Post ReplyReply Direct Link To This Post Posted: 03-May-2010 at 10:28am
Originally posted by kimj

OK, sorry for the confusion.  You can disregard my post about your debuglog for now; there is a DevForce bug in the logic setting up the endpoint address on the client, which is why it's trying to point to the wrong URL.  You can work around this by adding a ServiceReferences.ClientConfig file to your SL application project (and you can remove the app.config).  The contents of the file should look like the following -
 
 
Is there a way to workaround this bug programmatically.  In our application, the endpoint addresses aren't known at compile time so we can't hardcode, for example, that our application will always be hosted on a specific named server or under a particular hardcoded folder name.  Previously, we had been setting properties on the IdeaBladeConfig.Instance.ObjectServer object (ServerPort, RemoteBaseUrl, ServiceName, etc.) but that seems to be affected by this bug.
 
Also, we have a "multi-tenant" application so we don't even know what the endpoint names themselves will be at compile time.  We might have EntityServer.svc, EntityServer_DB1, EntityServer_DB2, etc.
Back to Top
stephenmcd1 View Drop Down
DevForce MVP
DevForce MVP


Joined: 27-Oct-2009
Location: Los Angeles, CA
Posts: 166
Post Options Post Options   Quote stephenmcd1 Quote  Post ReplyReply Direct Link To This Post Posted: 03-May-2010 at 3:08pm
Originally posted by stephenmcd1

Is there a way to workaround this bug programmatically. 
 
So just as I was giving up on finding a solution myself, I stumbled upon the ServiceProxyEvents class.  By subclassing from that and overriding OnEndpointCreated(ServiceEndpoint) method, I'm able to adjust the ServiceEndpoint.Address property to "fixup" the URL to work with a server/folder that isn't known until runtime.  I'll post the code below in case anybody in interested or in case anybody at IdeaBlade sees something glarringly wrong with my solution.  It's a bit of a hack but at least its a self-contained hack and when a new version of DevForce comes out that fixes the problem, I should be able to just remove this class and forget this bug ever existed.
 

    /// <summary>
    /// Provides a means of customizing a WCF proxy used to communicate with the BOS.
    /// </summary>
    /// <remarks>
    /// HACK: This class is only necessary to get around a known issue in DevForce whereby
    /// the service endpoint address is incorrectly set. 
    /// See: http://www.ideablade.com/forum/forum_posts.asp?TID=1738
    /// </remarks>
    [Export]
    public class AlliantServiceProxyEvents : ServiceProxyEvents
    {
        /// <summary>
        /// Called when a ServiceEndpoint has been created.
        /// </summary>
        /// <param name="endpoint">The ServiceEndpoint that was created.</param>
        public override void OnEndpointCreated(ServiceEndpoint endpoint)
        {
            //Get the BOS configuration information that will be used to (re)build the endpoint's address
            var bosConfig = IdeaBladeConfig.Instance.ObjectServer;
            //Get the current Uri of this ServiceEndpoint
            var uri = endpoint.Address.Uri.ToString();
            //Create a new "RemoteBaseUrl" that includes the server and the folder portion of the path
            var newRemoteBaseUrl = bosConfig.RemoteBaseUrl +  //Start with the configured BaseUrl
                //And add the configured ServiceName (but removing the EntityService part - just leaving the folder)
                                   bosConfig.ServiceName.Replace("/EntityService.svc/sl", "");
            //Make sure we only update the Uri when it doesn't already contain the new path part
            if (!uri.Contains(newRemoteBaseUrl))
                //replace the old RemoteBaseUrl portion with the new RemoteBaseUrl portion
                uri = uri.Replace(bosConfig.RemoteBaseUrl, newRemoteBaseUrl);
            //Overwrite the endpoint's address with a new Address based on the newly-built Uri
            endpoint.Address = new EndpointAddress(new Uri(uri), endpoint.Address.Headers.ToArray());
           
            //Perform the base's processing (if any)
            base.OnEndpointCreated(endpoint);
        }
    }
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: 03-May-2010 at 5:42pm
Hi Stephen, sorry I didn't see this sooner.  As you've found, sub-typing ServiceProxyEvents is the way to programmatically set/modify the address, as well as other proxy/endpoint information.
 
One thing to be careful of if you do end up keeping this code after the next DF release is that we have an "unusual" way of specifying the full address information.  For an address like "http://host/mysite/EntityService.svc/sl, the RemoteBaseURL would be http://host while the serviceName would be "mysite/EntityService.svc/sl". 
 
Also, an endpoint will be created for the EntityService, but also for any EntityServers you're using (and re-reading your first post I see you know this, but fyi for anyone reading who doesn't). 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down