WCF RIA Services 4004 error - wcf

All works great in IIS Express, but when I debugging into local IIS, I've got error when trying use WCF in app (listed below), which browser shows, but VS don't.
[Window Title]
Visual Studio Just-In-Time Debugger
[Main Instruction]
An unhandled exception ('Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.ServiceModel.DomainServices.Client.DomainOperationException: Invoke operation 'Login' failed. The remote server returned an error: NotFound. ---> 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__DisplayClassa.<EndGetResponse>b__9(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<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 System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndInvokeCore(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainClient.EndInvoke(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteInvoke(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.InvokeOperation.Complete(Exception error)
at System.ServiceModel.DomainServices.Client.DomainContext.CompleteInvoke(IAsyncResult asyncResult)
at System.ServiceModel.DomainServices.Client.DomainContext.<>c__DisplayClass30`1.<InvokeOperation>b__2c(Object )
') occurred in iexplore.exe [856].
The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?
[V] View process details [Yes, debug iexplore.exe] [No, cancel debugging]
[Expanded Information]
Process Name: C:\Program Files (x86)\Internet Explorer\iexplore.exe
User Name: Armanx64PC\Armanx64 [Elevated]

I've got solution. My head, it works so strange...
So, you need go to Control Panel - Programs and features - Turn features on or off, and there you must enable ALL WCF Services tree (check ASP.NET also, if you don't check it early).

Related

[WebException: The request failed with HTTP status 404: Not Found.]

I am working in two environments, staging and production. In stage, my site pulls up correctly, however, when I publish to production, I receive the following error:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The request failed with HTTP status 404: Not Found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
The back end is Visual Basic.
[NullReferenceException: Object reference not set to an instance of an object.]
Navigation.EstablishContext(HttpRequest Request) +492
Navigation..ctor() +79
[Exception: Error creating Navigation object]
Navigation..ctor() +269
UrlRewriteModule.Application_BeginRequest(Object source, EventArgs e) +262
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +128
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +1513
Please add your code for a better answer.
You are attempting to access a resource that is not specified in your path, you want to:
check your url,and identify what is not properly formatted,
verify your web.config
verify the permission on the file you are trying to access on production environment.
99% sure, 404 Not Found = resource not properly accessed.

WCF Service hosted in Azure Cloud Service errors after published

I have a project with several WCF services (mix of REST and SOAP). The project has been running On-Prem for 6 months without an issue. We are moving this to Azure but have run into an issue that will prevent us from going live.
The project uses Autofac for it's IOC. We are gonig to host this in a Cloud Service in Azure. Everything appears to work correctly when running locally in the Azure Emulator however once we deploy using the Cloud Service project, everything builds and deploys correctly, but we receive the following error when trying to access a service.
Server Error in '/' Application.
Value cannot be null. Parameter name: key
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: key]
System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +48
System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +38
System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +20
System.ServiceModel.Dispatcher.WebHttpDispatchOperationSelector..ctor(ServiceEndpoint endpoint) +2459
System.ServiceModel.Description.WebHttpBehavior.GetOperationSelector(ServiceEndpoint endpoint) +125
System.ServiceModel.Description.WebHttpBehavior.ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) +1955
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +4245
System.ServiceModel.ServiceHostBase.InitializeRuntime() +119
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +45
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +553
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +350
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1614
[ServiceActivationException: The service '/Event/Calendar' cannot be activated due to an exception during compilation. The exception message is: Value cannot be null.
Parameter name: key.]
System.Runtime.AsyncResult.End(IAsyncResult result) +925
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +528
System.ServiceModel.Activation.AspNetRouteServiceHttpHandler.EndProcessRequest(IAsyncResult result) +107
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +151
It appears that it's having an issue with the service configuration endpoint. That is registered through Autofac WCF integration using the OOTB RouteTable here:
RouteTable.Routes.Add(new ServiceRoute("Event/Calendar", new AutofacWebServiceHostFactory(), typeof(CalendarSvc)));
All of this works fine in IIS and the local Azure emulator, but once deployed to the cloud service is where we get an issue.
Observed exactly problem. Solved by canceling IntelliTrace on this hosted service.
I did publishing from VS2013 and marked "Enable IntelliTrace" during publishing. Once I canceled this option and re-publish - all works properly....

Cassia Library giving exception when calling any methods

I am trying to run the Cassia library on a remote Windows Server 2008 Terminal Server. Any methods I call I get the response below.
No more data is available
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: No more data is available
Stack Trace:
[Win32Exception (0x80004005): No more data is available]
Cassia.Impl.NativeMethodsHelper.GetSessionInfos(ITerminalServerHandle server) +159
Cassia.Impl.TerminalServer.GetSessions() +103
I was getting this error as well. Turns out that if there are no sessions for the given server it throws this exception.
Try running qwinsta /server <servername> in a WCP shell. It should return "No session exists for *".
I worked around this by checking exception message for "no more data" and don't throw it if so. It's gross but it's an open source dll.

WCF service hosted in IIS throws 'Failed to access IIS metabase' error

Deployed a WCF service in IIS 6.0 gave NETWORK_sERVICE user read/write privileges.
When tries to brows to .SVC file i get below error
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +637
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +174
System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51
System.Web.CachedPathData.GetConfigPathData(String configPath) +341
System.Web.CachedPathData.GetConfigPathData(String configPath) +234
System.Web.CachedPathData.GetApplicationPathData() +38
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +8806383
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +117
Any thoughts?
Was told that we get 'Failed to access IIS metabase' error if we install IIS after intalling .NET Framework, and remedy is to re-install ASP.NET.
To resolve this error I have followed below steps
1. Stopped IIS
2. Ran below command in command prompt to re-install aspnet.
%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i
Result:
Start installing ASP.NET (2.0.50727).
..................................................................
Finished installing ASP.NET (2.0.50727).
3. Re-started IIS and WCF service is responding without any issues.

Silverlight3.0 + WCF Service hosting issues: Communication Exception

I am working with silverlight3 with WCF service for a while.. I have developed and hosted my application into client mechine. It was working good. Then i need to do some modifications in my application, so I have added new functions in to my .svc file(i.e in to the wcf service). I have updated the servicereference successfully. When i re published and access it, it throws the error in a particulare method which i newly added.. But the other functions and data retreival are working good.. The newly added functions of the wcf services throws the communication error.
This is the function which i used to bind the combobox by the data retrieved from the wcf service..
Actual Error:
System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> 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.b_4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c_DisplayClass2.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 System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at System.ServiceModel.ClientBase1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
at foundproject.ServiceReference1.Service1Client.Service1ClientChannel.EndUsergetBasedWorkgroup(IAsyncResult result)
at foundproject.ServiceReference1.Service1Client.ServiceReference1_IService1_EndUsergetBasedWorkgroup(IAsyncResult result)
at foundproject.ServiceReference1.Service1Client.OnEndUsergetBasedWorkgroup(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
--- End of inner exception stack trace ---
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at foundproject.ServiceReference1.UsergetBasedWorkgroupCompletedEventArgs.get_Result()
at foundproject.UserMaster.BindUsers(Object sender, UsergetBasedWorkgroupCompletedEventArgs e)
Please Please help me to solve it out..
It will be a great help for me..
Thanks
Lakshmi.A
All methods in webservice are implemented using Interfaces, if you have added your function in Class file make sure its implemented by its interface-template/interface-method signature.
You have not changed the namespace of the newly added method.
the access modifier is public.
Try running your webservice file "svc" from IIS Management Console using Browse by Right clicking on "svc" file. it must show a default web service UI that we normally expect.
Debug your web service, and see if it hits the break point over your newly added method.
I'm sure by following these simple steps you will solve your problem.