Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi CP users,

I m using the locally hosted WCF REST service which was working fine with VS2013 and Cordova and suddenly getting the error when running ripple .

To call the service.. i m using ANGULARJS factory design pattern .
now throwing this error ..
Failed to load resource: net::ERR_CONNECTION_REFUSED

and Detail is here

OPTIONS http://localhost:4400/ripple/xhr_proxy?tinyhippos_apikey=ABC&tinyhippos_rur…Serv.svc/userlogin%3FId%3D352373057521820%26UserName%3Dsrk%26Password%3Ds net::ERR_CONNECTION_REFUSEDripple.js:50 ripple.define.object.(anonymous function)angular.js:9814 (anonymous function)angular.js:9615 sendReqangular.js:9331 $get.serverRequestangular.js:13170 processQueueangular.js:13186 (anonymous function)angular.js:14383 $get.Scope.$evalangular.js:14199 $get.Scope.$digestangular.js:14488 $get.Scope.$applyangular.js:22954 (anonymous function)jquery-2.1.3.js:4430 jQuery.event.dispatchjquery-2.1.3.js:4116 jQuery.event.add.elemData.handle

And Here is mine factory code..

JavaScript
'use strict';
var app =  angular.module('app');
app.factory('authorize', function ($http) {
    
    return {
        validateUser: function (credential) {
           
            //return $http.get('http://localhost:1097/TestServ.svc/userlogin?Id=' + credential.id+ '&UserName=' + credential.username + '&Password=' + credential.password + '');
            return $http.get('http://localhost:1097/TestServ.svc/userlogin?Id=12345&UserName=srk&Password=s');
        }

    };
});


AND CONTROLLER Code is here

JavaScript
app.controller('LoginCtrl', function ($scope, $location, $window, authorize) {
   
    $scope.username = '';
    $scope.password = '';
    $scope.id = '123456';

    $scope.login = function () {

        var username = $scope.username;
        var password = $scope.password;
        var id= '123456';

        var credential = {};
        credential.username = username;
        credential.password = password;
        credential.id= id;
       
        if (username == '' || password == '') {
            alert('Enter username and password...');
        }
        else {
          
            var promiseGet = authorize.validateUser(credential);
            promiseGet.then(function(pl) {
               
                var log = pl.data;
                    
                    angular.forEach(log, function (value, key) {
                        // this.push(key + ': ' + value);
                        console.log('valuesGot- ' + key + ': ' + value);
                    });
                    
                    $location.path('/dashboard');
                },
                function (errorPl) {
                    alert('failure loading Employee ..' + errorPl);
                }
            );
        }
    };
});
Posted
Updated 3-Feb-15 21:13pm
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900