如何在asp.net c中发布来自Web服务的数据 [英] How to Post data from web services in asp.net c#

查看:67
本文介绍了如何在asp.net c中发布来自Web服务的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ .ajax

({

url:'http:// localhost:8080 / WebService.asmx / GetValue',

async:true,

类型:POST,

数据:Xyz,

contentType:application / json; charset = utf -8,

dataType:json,

成功:功能(数据)

{

alert (data.toSource());

alert('Success');

},

错误:function(data,status,jqXHR ){

提醒(状态);

}

});





在IIS 6.0中部署Web服务。

我需要另一个发布数据的应用程序。

所以如何解决这个问题。



Web服务在浏览器上通过IIS运行但不能在我的应用程序中使用



另一个设置是使用网络服务??

喜欢web.config文件

$.ajax
({
url:'http://localhost:8080/WebService.asmx/GetValue',
async:true,
type: "POST",
data:"Xyz",
contentType: "application/json; charset=utf-8",
dataType: "json",
success:function(data)
{
alert(data.toSource());
alert('Success');
},
error: function (data, status, jqXHR) {
alert(status);
}
});


web services deploy in IIS 6.0.
I require for another application for post data.
so how to solve this issue.

Web services run on browser through IIS but not use in my application

Another setting is require for using web services ??
like web.config file

推荐答案

嗨。

如果我理解你的问题,你想从服务向客户端发送回调异步吗?

如果是,那么你不需要任何更改,呈现的JQuery脚本将收到响应,但你必须确保连接将积极点。如果你的服务工作很长时间,超过超时,你需要增加超时时间,或者在服务器上创建一些状态方法,并通过计时器从客户端调用该方法。



最好的问候

Deverno
Hi.
If I understand your question, you want to send callback async from service to client?
If yes, then you don't need any changes, the presented JQuery script will receive the response, but you must be sure that the connection will be active. In case when your service working a long time, more then timeout, you need to increase timeout time, or create some status method on server and call that method from client by timer.

Best Regards
Deverno


这篇关于如何在asp.net c中发布来自Web服务的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆