jjzjj

webmethod

全部标签

c# - .Net WebServices 和 out/ref WebMethod 参数

我从我们的供应商之一那里收到了一些他们正在发布的网络服务的文档,他们非常具体地指出,在他们的一个WebMethods上,一个参数有out修饰符(?不确定这是否是正确的描述符)例如考虑以下WebMethod签名:[WebMethod]publicvoidHelloWorld(outstringstrVal){strVal="HelloWorld";}[显然实际方法不是HelloWorld方法]现在,我从未考虑过设计带有out/ref参数的WebMethod,这让我想知道他们为什么会使用它。为了理解这个设计决定的应用,我将一个原型(prototype)和一些基本的HelloWorld风格的

c# - JQuery ajax 调用 httpget webmethod (c#) 不工作

我正在尝试让ajax访问代码隐藏的web方法。问题是我不断从jQueryonfail方法中收到错误“parserror”。如果我将GET更改为POST,一切正常。请在下面查看我的代码。Ajax调用varid="li1234";functionAjaxGet(){$.ajax({type:"GET",url:"webmethods.aspx/AjaxGet",data:"{'id':'"+id+"'}",contentType:"application/json;charset=utf-8",dataType:"json",async:false,success:function(msg

c# - asmx 服务方法中的可空参数导致其他方法失败

要重现我遇到的问题,请使用VS2010创建一个空网站并添加带有代码隐藏的Web服务(asmx)。使用下面的代码,两个webmethods都可以调用成功:[WebService(Namespace="http://tempuri.org/")][WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]publicclassWebService:System.Web.Services.WebService{[WebMethod]publicvoidMethod1(intx){//i'mgood}[WebMethod]publics

c# - 如何在Asp.net C#中调用webmethod

我想使用以下代码在asp.netc#应用程序中调用web方法Jquery:jQuery.ajax({url:'AddToCart.aspx/AddTo_Cart',type:"POST",data:"{'quantity':"+total_qty+",'itemId':"+itemId+"}",contentType:"application/json;charset=utf-8",dataType:"json",beforeSend:function(){alert("Start!!!");},success:function(data){alert("a");},failure:f

javascript - 通过 jQuery AJAX 将字符串数组传递给 C# WebMethod

我想通过jQuery(POST)将JavaScript字符串数组传递给C#WebMethod:$.ajax({type:"POST",//GETorPOSTorPUTorDELETEverburl:PageURL+'ChangeColor',//Locationoftheservicedata:"{'OriginalColorHex':'"+JSON.stringify(clipartOriginalColorsHex)+"','ModifiedColorHex':'"+JSON.stringify(clipartModifiedColorsHex)+"','OriginalColor

java - 使用 WebFilter 从 XML 获取请求参数

我使用Glassfish和SOAP开发Web服务。我有几个web方法,我想把我的web方法名和他的参数介绍给httphead请求。例如:我有这条路:context:WebServiceswebMethod:makeSomethingparameters:a=2所以我创建了一个名为ProfilingFilter的类:@OverridepublicvoiddoFilter(ServletRequestrequest,ServletResponseresponse,FilterChainchain)throwsjava.io.IOException,javax.servlet.Servlet

c# - ASP.NET WebMethod 和半开连接

考虑一些客户端调用WebMethod并且在建立连接后主机进程崩溃并且连接变为半打开的情况。ASP.NETWebMethod代理会自动检测到它吗?我们假设WebMethod超时设置为无穷大或某个较长的时间。是否仅在TCPkeep-alive数据包发送时检测到连接错误(默认情况下在Windows上空闲2小时后)?[WebService(Namespace="http://www.example.com/TestService/")][WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]publicclassTestServic

java - 如何从 CXF WebService 中排除方法 - 奇怪的行为

有人可以向我解释CXF的以下行为吗?我有简单的网络服务:importjavax.jws.WebMethod;publicinterfaceMyWebService{@WebMethodStringmethod1(Strings);@WebMethodStringmethod2(Strings);@WebMethod(exclude=true)StringmethodToExclude(Strings);}我想在接口(interface)(针对Spring)中使用我的methodToExclude,但我不想在生成的WSDL文件中使用此方法。上面的代码正是这样做的。但是当我向接口(inte

c# - 如何在 UserControl (.ascx) 中调用 ASP.NET WebMethod

是否可以将WebMethod放在ascx.cs文件中(对于UserControl),然后从客户端jQuery代码中调用它?由于某些原因,我无法将WebMethod代码放在.asmx或.aspx文件中。示例:在ArticleList.ascx.cs中,我有以下代码:[WebMethod]publicstaticstringHelloWorld(){return"helloWorld";}在ArticleList.ascx文件中,我调用了WebMethod,如下所示:$.ajax({type:"POST",contentType:"application/json;charset=utf-

c# - 如何在 UserControl (.ascx) 中调用 ASP.NET WebMethod

是否可以将WebMethod放在ascx.cs文件中(对于UserControl),然后从客户端jQuery代码中调用它?由于某些原因,我无法将WebMethod代码放在.asmx或.aspx文件中。示例:在ArticleList.ascx.cs中,我有以下代码:[WebMethod]publicstaticstringHelloWorld(){return"helloWorld";}在ArticleList.ascx文件中,我调用了WebMethod,如下所示:$.ajax({type:"POST",contentType:"application/json;charset=utf-