Author |
Share Topic Topic Search Topic Options
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Topic: deployment to DiscountASP Posted: 29-May-2010 at 12:36am |
Ok, I didn't figure out what the exact problem was but I started looking at my SQL connection and noticed that it had some metadata stuff that was pointing at nothwind and I then remembered when I was creating the project I used the nothwind by accident and then hit back and created a new connection with my discountasp.net database.
I can't see why that would have been the problem but I then thought I would start from scratch and try the tutorial again. I called it SimpleSteps2 and coded it and uploaded it to the web and voila, it worked.
Thanks for all your help especially on a late friday night!
Now that this is working I find it hard to believe how easy it really was. I also think the deployment of the silverlight project is a heck of a lot easier than asp.net!
I also thought getting it hosted on DiscountAsp.net would have been harder but it wasn't. All of their directories and mimetypes etc are all setup properly. There's not much to do except put the files in the right place and make a simple change to the web.config to enable the multisomethingorother.
Considering it was a few hours to build the simplest project and get it running on a web page without having any knowledge of Silverlight, WCF and a only a basic knowledge of ASP.net I'm feeling pretty good about the rest of the project!
Thanks
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 10:56pm |
Sounds as if your web.config is pointing at the wrong address. I would suggest using a tool such as Fiddler to see where it is really connecting to.
http://www.fiddler2.com/fiddler2/
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 10:50pm |
Ok, I looked at your post when I heard the e-mail come in. I shouldn't have but I did :-)
The error is a simple "Not Found"
System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState) at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState) --- End of inner exception stack trace --- at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result) --- End of inner exception stack trace --- at IdeaBlade.EntityModel.EntityServerProxy.Fetch(SessionBundle bundle, IEntityQuerySurrogate query) at IdeaBlade.EntityModel.EntityManager.AsyncFetchWorker(AsyncEventArgs state)
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 10:00pm |
Replace:
query.ExecuteAsync(op => op.Results.ForEach(DD_Tables.Add));
With:
query.ExecuteAsync(GotEntities);
private void GotEntities(EntityQueryOperation<DD_Table> args) { if (args.Error != null) { _textBlockError.Text = args.Error.Message; } else { args.Results.ForEach(DD_Tables.Add); } }
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:56pm |
Funny, you are overestimating my knowledge in SL :-) The textblock part and logging the error is the easy part. Figuring out how to get the args from the ExecuteAsync call is the hard part for me :-)
I'll figure it out at somepoint, this is the stuff I have to learn. I've been working on Devforce Classic for so long that Linq and all this new stuff just passed me by and I'm feeling old.
Now that I know that at least it's working and that I can start debugging and returning stuff from the backend I can usually muscle my way through.
Thanks
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:50pm |
A quick and easy way would be to simply throw a TextBlock on your view, and on the return of the execute, simply set the text property from there. Obviously there are many more elegant solutions, but this is a quick and dirty way :)
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:45pm |
As I figured, the system just had to let go of the file after a bit.
Message |
------------ Log Created ------------ |
Initializing configuration ... |
The configured SupportedClientApplicationType is Both |
Probed for non-default 'ITraceLoggerProvider' and found no matching exports. |
Probed for default 'ITraceLoggerProvider' and found 'IdeaBlade.Core.DefaultLoggerProvider'. |
IdeaBladeConfig resolution: File: xxx\htdocs\web.config - found |
IdeaBladeConfig resolution: Logging file: E:\web\xxx\htdocs\log\DebugLog.xml |
Bound to .NET runtime version 4.0.30319.1 |
DevForce version 6.0.2.0 |
Using DC serializer for EntityService |
Probed for any 'ServiceHostEvents' and found 'IdeaBlade.EntityModel.Server.ServiceHostEvents'. |
EntityService listening on http://xxx.net/EntityService.svc |
EntityService listening on http://xxx.net/EntityService.svc/sl |
Probed for any 'EntityServiceApplication' and found 'IdeaBlade.EntityModel.EntityServiceApplication'. |
EntityService created |
EntityServer created for DataSourceExtension: [None] |
Anonymous access: enabled |
Probed for non-default 'IEntityLoginManager' and found no matching exports. |
No Login Manager found. User will always be logged in as Guest, regardless of credentials. |
Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.EdmQueryExecutor'. |
Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.PassthruEsqlQueryExecutor'. |
Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.StoredProcQueryExecutor'. |
Probed for any 'IEntityQueryExecutor' and found 'IdeaBlade.EntityModel.Edm.UdtQueryExecutor'. |
Probed for non-default 'IKnownTypeProvider' and found no matching exports. |
Using DC serializer for EntityServer |
EntityServer listening on http://xxx.net/EntityServer.svc |
EntityServer listening on http://xxx.net/EntityServer.svc/sl |
Probed for any 'EntityServerQueryInterceptor' and found 'IdeaBlade.EntityModel.Server.EntityServerQueryInterceptor'. |
Fetch ... value(IdeaBlade.EntityModel.EntityQueryProxy`1[SimpleSteps.DD_Table]) |
Probed for default 'IDataSourceKeyResolver' and found 'IdeaBlade.EntityModel.DefaultDataSourceKeyResolver'. |
Probed for non-default 'IDataSourceKeyResolver' and found no matching exports. |
Probed for any 'IIdGenerator' and found 'IdeaBlade.EntityModel.StoreGeneratedIdGenerator'. |
Probed for non-default 'IConcurrencyStrategy' and found no matching exports. |
Probed for default 'IConcurrencyStrategy' and found 'IdeaBlade.EntityModel.DefaultConcurrencyValueSetter'. |
DataSourceKey:xxxEntities found in assembly: SimpleSteps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null |
Fetch ... value(IdeaBlade.EntityModel.EntityQueryProxy`1[SimpleSteps.DD_Table])
So it seems to be working, no errors that I can see are found.
I see what you mean about the execute and the args, It will take me a while to figure out how to return the error codes from there but that's the fun about learning a new language.
|
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:31pm |
Size 0 sounds a bit odd, but at least that is good news. That means DevForce is at least partially working. In the older versions of DevForce you could just browse to the DebugLog (not good in production, but it should be disabled or locked down anyways in production).
In the callback of your ExecuteQueryAsync the EntityQueryOperation args should have a property called 'Error' you should check if this isn't null, if not, write the message out to the screen.
I have a feeling you have an error in there.
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:28pm |
Thanks for mentioning that!
I finally have a debuglog.xml but it is 0 size and when I try to transfer it from the FTP it says it is in use. I'm thinking I can take down the website but then it might not write to the debuglog.
I'm really new to SL so I will research how to add logging into the async connect callback to the entitymanager.
Thanks
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:20pm |
You aren't seeing anything in the DebugLog.xml file either? Is your SL app reporting any exceptions?
When you're seeing that metadata publishing message, it sounds like you're connecting ok.
Can you put some logging into the ExecuteQueryAsync callback on your EntityManager and see if it is returning an error?
Edited by smi-mark - 28-May-2010 at 9:23pm
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:17pm |
Nada, Still no record showing.
I even looked at the other post about deployment and put in
<client> <endpoint name="Entity Service" address=" http://mywebsite/EntityService.svc/sl" binding="customBinding" bindingConfiguration="customBinaryBinding" contract="IdeaBlade.EntityModel.IEntity ServiceContractAsync" />
<endpoint name="EntityServer" address=" http://mywebsite/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>
into my web config file, changing the address and it didn't seem to make a difference.
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:08pm |
Have you tried connecting again with SL? The metadata message, though cryptic, isn't actually an error.
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 9:05pm |
ok, added multipleSiteBindingsEnabled ="true" to the web.config file as per a help file on discountasp.net
Now I'm Getting
Metadata publishing for this service is currently disabled.
If you have access to the service, you can enable metadata publishing by completing the following steps to modify your web or application configuration file: 1. Create the following service behavior configuration, or add the <serviceMetadata> element to an existing service behavior configuration: <behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors> Now to try to figure out more on why it's not working
|
|
DataMan
Groupie
Joined: 26-Jul-2007
Location: Canada
Posts: 52
|
Post Options
Quote Reply
Posted: 28-May-2010 at 8:35pm |
Ok, atleast that's an error...
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item
[ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item] System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +12089046 System.Collections.Generic.SynchronizedCollection`1.Add(T item) +78 System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) +72 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +141 IdeaBlade.EntityModel.Server.EntityServiceHostFactory.CreateHostCore(Type serviceType, Uri[] baseAddresses) +30 IdeaBlade.EntityModel.Server.EntityServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +40 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +420 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1440 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +615
[ServiceActivationException: The service '/EntityService.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item.] System.Runtime.AsyncResult.End(IAsyncResult result) +679246 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190 System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar) +300622 System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +8837348
So just to go through what I've done:
1) Created silverlight project using the same connection string that would be used on the discountasp.net server
1a) added Loaded += delegate { DataContext = new MainPageViewModel(); }; to the MainPage.xaml.cs
1b) put the following in the mainviewmodel.cs file:
Log = new ObservableCollection<string>(); WriteToLog("Initializing View Model"); DD_Tables = new ObservableCollection<DD_Table>(); var mgr = new SQL2008_673586_timeentryEntities(); var query = mgr.DD_Table; query.ExecuteAsync(op => op.Results.ForEach(DD_Tables.Add)); WriteToLog("End of event");
1c) put a bunch of other code required in different places following the SimpleSteps demo.
2) Created a bin, clientbin and log directories in the root of the website.
3) copied everything from the BIN directory in the project to the bin directory of the website
4) Copied the xap file from the project clientbin to the clientbin web folder
5) Copied the default.aspx, global.aspx, silverlight.js, web.config to the root of the website.
That's all I did. I didn't change the web.config in anyway nor did I change permissions on files on the webserver anywhere. The anonymous user on discountasp.net has write access to the files and folders.
What did I miss?
|
|
ting
IdeaBlade
Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
|
Post Options
Quote Reply
Posted: 28-May-2010 at 6:39pm |
For basic deployments (as I believe is your case) you no longer need an app.config in the client or the .svc files on the server.
The details:
- Instead of getting the server URL from the app.config file, DevForce will infer this from the location where the XAP was downloaded.
- Instead of using the .svc files, DevForce registers a virtual path provider in the global.asax on the server which will dynamically create the services.
The first step in checking your deployment is to open http://[hostdomain]/[path]/EntityService.svc in a web browser. This will tell you if the service successfully started and what the error was if it failed. After that, you can check the server-side debuglog for additional information.
|
|
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
Posted: 28-May-2010 at 8:19am |
The grid columns come from the generated classes, not from the database, so it is possible you aren't connecting/querying. The DebugLog.xml should be in the same folder as the web.config, under a default configuration.
|
|