问题描述
大家好,
我正试图从crome和safari浏览器远程服务器URL访问wcf JSON类型服务,但是我收到一条错误消息。以下是代码
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");
}
});
如果我使用本地托管的服务然后它工作正常并给出成功的结果。
从远程服务器拨打服务需要进行哪些更改!!!!
请尽快建议。
感谢您的建议
--Avinash
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
推荐答案
如果我在本地使用托管服务,然后它工作正常,并给出成功的结果。
从远程服务器拨打服务需要进行哪些更改!!!!
请尽快建议。
感谢您的建议
--Avinash
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
这篇关于从远程服务器调用WCF JSON服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!