Object does not contain a definition - asp.net-web-api

I am trying to add basic authentication using jquery ajax in my web API project .I followed videos from youtube.I alone got the error.How to rectify it?A snap for your Reference!
The error is :
object does not contain a defintion for 'Any' and no accessible extensible method 'Any' accepting a first argument of type 'object' could 'EmployeeService be found

Related

Unable to find playdeveloperreporting scope mentioned in the Method: vitals.crashrate.get reference page

I am tasked to pull the data for Method: vitals.crashrate.get programatically.
Please refer to the reference document here
https://developers.google.com/play/developer/reporting/reference/rest/v1beta1/vitals.crashrate/get
the required scope mentioned in the document is "https://www.googleapis.com/auth/playdeveloperreporting"
when i try to check the scope it says as below:
You are receiving this error either because your input OAuth2 scope name is invalid or it refers to a newer scope that is outside the domain of this legacy API.
This API was built at a time when the scope name format was not yet standardized. This is no longer the case and all valid scope names (both old and new) are catalogued at https://developers.google.com/identity/protocols/oauth2/scopes. Use that webpage to lookup (manually) the scope name associated with the API you are trying to call and use it to craft your OAuth2 request.
when i checked the https://developers.google.com/identity/protocols/oauth2/scopes
i could not find any relevant scopes that can be used to fetch the data from Method: vitals.crashrate.get
Please point me to any updated document, or the new scope that you know off.

Bridge RESO OData API

Im trying to use the OData Connected Service in Visual Studio to connect to a OData Feed in Bridge (RESO Feed).
However, If I try and pull the metadata directly from a URL, it has errors Adding OData Connected Service to the project failed: Could not get CLR type name for EDM type 'memberMediaEnums.ResourceName'
So I went ahead and downloaded the XML file and tweaked it to get rid of the errors and warnings. This includes Removing Entity references with no parents and removing attributes that were not supported like Precision.
Once its all loaded and the reference file is created I tried pulling data. The endpoint works and data is retrieved, but it is not thrown into the object as i would expect.
IEnumerable<Property> properties= await context.Property.ExecuteAsync();
foreach (var property in properties) //Errors trying to make a property
{
Console.WriteLine("{0} {1}", property.YearBuilt, property.ListPrice);
}
When I try and loop over the object I get this error:
The context URI 'https://api.bridgedataoutput.com/api/v2/OData/imls2/$metadata#Property' is not valid for the expected payload kind 'Resource'.
Where I am confused, is in the name Resource There is no object or entity in the Reference file or in the XML scheme that references that word. I'm not sure if its coming from OData services or the reference file it created. The call stack does not contain anything but the exact line of the loop.
Any insights would be helpful but i know its a long shot. Let me know if I need to provide more details.
Thanks

Error Adding a Switch Mediator inside a Proxy Service in WSO2 Developer Studio

I'm trying to do a simple Proxy Service using the Developer Studio tool from the open-source SOA middleware provider WSO2.
When I drag into the flow a Switch Mediator in the graphical view there is no problem but when I changed to the text view, I'm facing the following error:
Cannot update source view. The following error(s) have been detected
Reason: XPathFactoty#newInstance() failed to create an XPathFactoty for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactotyConfigurationException: javax.xml.xpath.XPathFactotyConfigurationException: java.util.ServiceConfigurationError javax.xml.xpath.XPathFactoty: bundleresource://1013.fwk317983781:21/META-INF/services/javax.xml.xpath.XPathFa ctory:2: Illegal configuration-file syntax
And the XML is empty, so I can't to add any Switch Mediator and get it working with the WSO2 DS.
This is happening with the 3.5.0 and 3.6.0 version of the tool, and I even try one of the sample in the website but with the same result.
Anyone have any reason why this error is happening?
Thank you!
Each switch element needs to have an attribute called 'source'. This is the Xpath attribute that is checked against the criteria in each case. To add the 'source' attribute, type the Xpath and then click 'update' or 'save'. With that required attribute, a valid xml configuration file may be created and viewed as text.
Here is more documentation on the switch mediator: https://docs.wso2.org/display/ESB481/Switch+Mediator

Creating the first web page via brew

When a use accesses my application, I want to return a web page that I construct using brew. Right now I have an init() - this is the function that the user specifies. The function executes brew and creates a web page. It then returns the file name of the web page.
When I attempt the following ../library/xbrowser/R/init/file I get the following error reported to the browser:
cannot coerce type 'closure' to vector of type 'character'
In call:
as.character(x)
The documentation indicates that I could use the /file output as a means to create and return a web page. Am I using this feature incorrectly? Is there a better way to create and return a web page?
OK, I think my problem is an operator error.
I should have been testing the function with POST instead of GET which is, of course, the method used when you use a browser.
I don't get this message if I POST with curl - for instance.
My apologies for wasting anyone's time.
Peter
One more observation: don't use init as a function name; it seems to use some other namespace and complains about lazy-loading a database named 'P'

Server Error with the griffin.mvccontrib package in asp.net

In order to be able to translate my data annotations in my model with a resource file, I saw that many people recommend the solution offered by jgauffin.
However, when I follow the localization tutorial my project cannot launch.
The problematic code is this one, which is supposed to go in the Global.asax.cs file:
ModelValidatorProviders.Providers.Add(
new LocalizedModelValidatorProvider(stringProvider)
);
It says that the LocalizedModelValidatorProvider constructor does not take any arguments, which is also shown by other tutorials.
But when I change the line like this:
ModelValidatorProviders.Providers.Add(
new LocalizedModelValidatorProvider()
);
I get the following error in the browser:
Attempted to access an element as a type incompatible with the array.
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.ArrayTypeMismatchException: Attempted to access an element as a type incompatible with the array.
The griffin.mvccontrib packages were installed with NuGet under Visual Studio 2012. Any idea what I am doing wrong ?
You might find this link helpful
Here is how I did the registration in the above link:
ResourceStringProvider myResouceFile = new ResourceStringProvider(ModelsResources.ResourceManager);
//ModelsResources is my resource file generated class
GriffinStringsProvider griffinStringsProvider = new GriffinStringsProvider(myResouceFile);
ValidationMessageProviders.Clear();
ValidationMessageProviders.Add(griffinStringsProvider);
ModelMetadataProviders.Current = new LocalizedModelMetadataProvider(myResouceFile);
ModelValidatorProviders.Providers.Clear();
ModelValidatorProviders.Providers.Add(new LocalizedModelValidatorProvider());
Make sure you are including the right assemblies
using System.Resources;
using Griffin.MvcContrib.Localization;
using Griffin.MvcContrib.Localization.ValidationMessages;
Also the assembly for your Resource file.

Resources