Search Posts

Category: rest

Wcf Rest Service Method Returns Errors Unable to Cast Object Of Type

I am consuming Wcf Rest Service into Angular JS Web Application. I am posting multi request from angular js application to wcf . When i post the request to wcf service i got following errors in console application . The server encountered an error processing the request. The exception message is ‘Unable to cast object of type ‘System.Data.Entity.Infrastructure.DbQuery`1[System.String]’ to type ‘System.IConvertible’.’. See server logs for more details. The exception stack trace is: Here is the […]

What is the best way to communicate authorization between a client and REST API?

I’m developing an application will use AngularJS for the front-end, communicating to a REST service on the backend, implemented as J2EE/Spring. The back-end services are secured through role-based authorization. In the front end of the application I would like to have the UI only allow users to perform operations for which they are authorized. The code should, for example, show/hide elements based on the user’s permissions. What is the best way to communicate the user’s […]

Securing REST + AngularJS with JWT or OAuthv2

I’m pretty new to REST security and am trying to build an AngularJS (Angular 1) app that integrates against a RESTful web service as its backend. This web service will be how the app (frontend) fetches and writes all data. The app will initially be the REST service’s only client, but eventually I’d like to open the service up as an exposed public API, not only used/consumed by my Angular app. I’m trying to figure […]

AngularJs does not read url

I need to use angularJS to call a rest api located at localhost:80/users. The problem is that it does not read the url (the url works if I access it in the browser). <!DOCTYPE html> <html> <script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js”></script> <body> <div ng-app=”myApp” ng-controller=”myCtrl”> <p>Today’s welcome message is:</p> <h1>{{myWelcome}}</h1> </div> <p>The $http service requests a page on the server, and the response is set as the value of the “myWelcome” variable.</p> <script> var app = angular.module(‘myApp’, []); […]

Response Headers Gets changed on making Java REST API call from AngularJS

My main issue is, that when I make a GET call to a JAVA API, it hits correctly. I’ve set the CORS headers as well in JAVA API. But when i make a POST request, I see that , the response headers are not what I’ve set for CORS. Even the content-type which i Use as ‘application/json’ gets changed to ‘application/vnd.sun.wadl+xml’ in Response when I see the response header feilds in developer Tool. And that’s […]

Angular JS Is Not Displaying Data with Wcf Rest Service

I am consuming wcf Rest Service into Angular JS Appplication . My wcf service is working fine but the problem is when i enter the text and then click button to display that particular record , its not displaying anythings . In Google Chrome Network Tab the record is display correctly . Here is my Interface . [OperationContract] [WebInvoke(Method = “GET”, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = “/GetCustomers/{Account_Holder_Last_Name}”)] string GetCustomers(string Account_Holder_Last_Name); Here is […]

Wcf Rest Service Through Number Conversion Error with Angular JS Application

I am consuming Wcf Rest Service into Angular JS Application . I am trying to retrieve a single record based on account number. But when i click the submit button to display the record then i got following errors in Google Console window. The server encountered an error processing the request. The exception message is ‘Conversion failed when converting the nvarchar value ‘{Account_Number}15′ to data type int.’. See server logs for more details. The exception […]

Angular JS Application Unable To Find Single Record with Wcf Rest Service

I am consuming wcf rest service into angular js application. I am trying to display single record based on user Last Name in Angular JS Application. I can get the details (JSON Format) of the user when i run wcf service on local host. Here is the interface. [OperationContract] [WebInvoke(Method = “GET”, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = “/GetCustomers/{Account_Holder_Last_Name}”)] string GetCustomers(string Account_Holder_Last_Name); Here is the Implementation . public string GetCustomers(string Account_Holder_Last_Name) { List<object> […]

Wcf Rest Service End point Not fount

I am consuming Wcf Rest Service into Angular JS Application. I am trying to retrieve a single record based on string parameter Account_Number.when user enter account number into input filed i want to display single record in angular js application but its not displaying the data.I am facing two problems. I write the url in local host with the method name .I got the result is Method not allowed . when i clicked the submit […]

Next Page »