Click here to Skip to main content
15,887,917 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am trying to access the wcf JSON type service from remote server url from crome and safari browsers, but I am getting an error message. Following is the code
var jsonText2=JSON.stringify({"FirstName": "Avinash","LastName": "Patil"});

$.ajax({
            type:"POST",                     
            url:"http://192.168.2.56/AndroidWcfService/Service1.svc/UserRegistration",
            data:jsonText2,
            contentType:"application/json;charset=utf-8",
            dataType:"jsonp",        
            timeout: 1000*60*15,
            success:function(data )
            {
            	alert("inside success");
            	//alert(data.loginResponse+" ");
            	 
            	if(data)
            		{
            		//InsertDeviceInformation();
            		 alert("Success");       		
            	    }
            },
            error:function(error){
                alert("checkNWCon");
                }
            });


If I used the locally hosted service then it is working fine and giving the success results.

What are the changes need to call service from remote server!!!!
Please suggest ASAP.

Thanks for suggestions

--Avinash
Posted
Comments
RaisKazi 18-May-13 7:44am    
Seems like network/fire-wall issue. Check if you are able to ping that server ip.

1 solution

Should have been better if you have had mentioned the error too.

Check if you have configured the Firewall properly. In the firewall section, add "Program" or application in the "Exception" tab. Also make sure you select a "Port" and assign it, if the default port is already taken by another application.
 
Share this answer
 

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