首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏跟着阿笨一起玩NET

    如何创建一个RESTful WCF Service

    WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml"; [OperationContract] [WebInvoke employee) { return Guid.NewGuid(); } [OperationContract] [WebInvoke DeleteEmployee(string id) { return; } [OperationContract] [WebInvoke employee) { return Guid.NewGuid(); } [OperationContract] [WebInvoke DeleteEmployee(string id) { return; } [OperationContract] [WebInvoke

    92310发布于 2018-09-19
  • 来自专栏菩提树下的杨过

    jQuery调用RESTful WCF示例(GET方法/POST方法)

    <param name="welcome"></param> /// <returns></returns> [OperationContract] [WebInvoke <param name="welcome"></param> /// <returns></returns> [OperationContract] [WebInvoke <param name="welcome"></param> /// <returns></returns> [OperationContract] [WebInvoke <param name="welcome"></param> /// <returns></returns> [OperationContract] [WebInvoke <param name="welcome"></param> /// <returns></returns> [OperationContract] [WebInvoke

    2.3K80发布于 2018-01-23
  • 来自专栏菩提树下的杨过

    当wcf遇到JSON ?

    jquery调用,wcf示例代码如下: /**////

    /// 测试 /// /// <returns></returns> [OperationContract] [WebInvoke HelloWorld应付,如下: /**//// /// 测试 /// /// <returns></returns> [OperationContract] [WebInvoke return ms; } /**//// /// 测试 /// /// <returns></returns> [OperationContract] [WebInvoke

    1K50发布于 2018-01-23
  • 来自专栏大内老A

    [WCF REST] Web消息主体风格(Message Body Style)

    1: [ServiceContract] 2: public interface IEmployees 3: { 4: //其他成员 5: [WebInvoke( 1: [ServiceContract] 2: public interface IEmployees 3: { 4: //其他成员 5: [WebInvoke( 1: [ServiceContract] 2: public interface IEmployees 3: { 4: //其他成员 5: [WebInvoke( 1: [ServiceContract] 2: public interface IEmployees 3: { 4: //其他成员 5: [WebInvoke( ServiceContract(Namespace = "http://www.artech.com/")] 2: public interface ICalculator 3: { 4: [WebInvoke

    1.1K100发布于 2018-02-07
  • 来自专栏liulun

    javascript post数据到WCF反馈json或者XML

    ServiceContract(Namespace = "")]     public interface IJsonXmlService     {         [OperationContract]         [WebInvoke JsonService(int id, string mytitle, string mycontent);         [OperationContract(Action="*")]         [WebInvoke

    92130编辑于 2022-05-09
  • 来自专栏张善友的专栏

    入门:添加一个支持获取单一资源以及支持POST,PUT和DELETE方法

    Connection: Close {"ContactId":1,"Name":"Phil Haack"} 3、添加对POST的支持 以下代码是添加一个新的Post方法,添加一个新的Contract [WebInvoke create 加载创建Contact页面,输入“NewContact”按下Create 创建的Contact被返回 7、添加PUT的支持 添加对PUT和DELETE的支持是非常容易的,像POST一样也是使用WebInvoke 制定PUT和DELETE 打开ConactApi.cs把以下代码拷进去 [WebInvoke(UriTemplate ="{id}", Method = "PUT")] public Contact Connection: Close {"ContactId":1,"Name":"Updated Contact" 8、添加对DELETE的支持 切换到ContactApi.cs并复制以下内容: [WebInvoke

    1.9K70发布于 2018-01-22
  • 来自专栏菩提树下的杨过

    用JS + WCF打造轻量级WebPart

    behavior>    </endpointBehaviors>   </behaviors> (2)新建几个方法: Code //取得页面布局数据 [OperationContract] [WebInvoke WebOperationContext.Current.OutgoingResponse.ContentType = "text/plain"; return ms; } //保存布局 [OperationContract] [WebInvoke db.Connection.Close(); } } return _Result; } //取得新闻 [OperationContract] [WebInvoke WebOperationContext.Current.OutgoingResponse.ContentType = "text/plain"; return ms; } //取得图片地址 [OperationContract] [WebInvoke

    1K100发布于 2018-01-22
  • 来自专栏熊二哥

    快速入门系列--WCF--03RESTFUL服务与示例

    IEnumerable<Employee> GetAll(); 8 9 [WebGet(UriTemplate = "{id}")] 10 Employee Get (String id); 11 12 [WebInvoke (UriTemplate = "/", Method = "POST")] 13 void Create(Employee employee); 14 15 [WebInvoke(UriTemplate = "/", Method = "PUT")] 16 void Update(Employee employee); 17 18 [WebInvoke(UriTemplate = "{id}", Method

    97670发布于 2018-01-24
  • 来自专栏平凡少年

    WCFRESTFul服务搭建及实现增删改查

    ServiceContract(Name="user")] public interface IService1 { [OperationContract] [WebInvoke WebMessageBodyStyle.Bare)] string GetData(string value); [OperationContract] [WebInvoke WebMessageBodyStyle.Bare)] string addPeople(People p); [OperationContract] [WebInvoke BodyStyle = WebMessageBodyStyle.Bare)] List<People> GetList(string value); } } 注意:通过WebInvoke

    92930发布于 2019-04-11
  • 来自专栏菩提树下的杨过

    ExtJs学习笔记(20)-利用ExtJs的Ajax与服务端WCF交互

    AspNetCompatibilityRequirementsMode.Allowed)] public class MyService { [OperationContract] [WebInvoke <param name="text"></param> /// <returns></returns> [OperationContract] [WebInvoke param name="input"></param> /// <returns></returns> [OperationContract] [WebInvoke ExtJs获取WCF端的数据,SaveMyData,SaveMyData2用来保存ExtJs提交过来的数据,区别是SaveMyData用于Get方法,SaveMyData2用于Post方法 需要说明的是[WebInvoke

    1.4K70发布于 2018-01-24
  • 来自专栏大内老A

    [WCF REST] 帮助页面与自动消息格式(JSON/XML)选择

    "{id}")] 9: [Description("获取指定ID的员工")] 10: Employee Get(string id); 11:  12: [WebInvoke 13: [Description("创建一个新的员工")] 14: Employee Create(Employee employee); 15:  16: [WebInvoke )] 17: [Description("修改现有员工信息")] 18: void Update(Employee employee); 19:  20: [WebInvoke

    95870发布于 2018-02-07
  • 来自专栏张善友的专栏

    RESTful WCF

    OperationContract]      [WebGet]      string EchoWithGet(string s);      [OperationContract]      [WebInvoke

    1K100发布于 2018-01-29
  • 来自专栏历史专栏

    【愚公系列】2023年10月 .NET CORE工具案例-DeveloperSharp(Web服务负载均衡)

    YZZ.Interface { [ServiceContract] public interface IBase { [OperationContract] [WebInvoke public int right; } } 如上代码所示,IBase接口中定义了一个通过年龄来做权限判断的AccessRight方法,并在该方法上附加了OperationContract与WebInvoke OperationContract这个属性是用来给方法赋予WCF的特性 WebInvoke这个属性则是给方法赋予了Web Api的特性 编译该解决方案,获得YZZ.Interface.dll 2.服务端

    26310编辑于 2025-06-02
  • 来自专栏技术之路

    wcf webHttpBinding Post 大数据量提交 ios c#客户端

    [ServiceContract] public interface IMyWcfServerMethod {     [OperationContract, WebInvoke string postMostStr(string streamLength, Stream getStream); //实验一下接收 [OperationContract, WebInvoke

    1.1K100发布于 2018-01-31
  • 来自专栏大内老A

    [WCF REST] 一个简单的REST服务实例

    6:  7: [WebGet(UriTemplate = "{id}")] 8: Employee Get(string id); 9:  10: [WebInvoke (UriTemplate = "/", Method = "POST")] 11: void Create(Employee employee); 12:  13: [WebInvoke (UriTemplate = "/", Method = "PUT")] 14: void Update(Employee employee); 15:  16: [WebInvoke

    95070发布于 2018-01-16
  • 来自专栏菩提树下的杨过

    silverlight获取外部数据的另一种选择:FluorineFx

    利用系统自动封装成json格式 /// /// <returns></returns> [OperationContract] [WebInvoke 自己封装成json格式 /// /// <returns></returns> [OperationContract] [WebInvoke

    1.3K50发布于 2018-01-23
  • 来自专栏菩提树下的杨过

    ExtJs与WCF交互:生成树

    AspNetCompatibilityRequirementsMode.Allowed)]  public class WcfTreeService  {  // 添加 [WebGet] 属性以使用 HTTP GET  [OperationContract]  [WebInvoke

    1.6K90发布于 2018-01-23
  • 来自专栏大内老A

    [WCF REST] UriTemplate、UriTemplateTable与WebHttpDispatchOperationSelector

    WebGetAttribute webGet = operation.Behaviors.Find<WebGetAttribute>(); 11: WebInvokeAttribute webInvoke "GET" : webInvoke.Method; 13: UriTemplateTable uriTemplateTable; 14: if ( webGet.UriTemplate:webInvoke.UriTemplate; 21: uriTemplateTable.KeyValuePairs.Add(new KeyValuePair

    1.3K60发布于 2018-02-07
  • 来自专栏菩提树下的杨过

    ExtJs学习笔记(6)_可分页的GridPanel

            { get; set; } 16     }     17 } 2.服务端的WCF方法:GetDataByPage [OperationContract]         [WebInvoke

    94580发布于 2018-01-23
  • 来自专栏菩提树下的杨过

    ExtJs学习笔记(2)_Basic GridPanel[基本网格]

    AspNetCompatibilityRequirementsMode.Allowed)] public class MyService     {         [OperationContract]         [WebInvoke ProductName"/><button id="btnRefresh">查询记录</button> 当然,相应的GetClsData部分也要修改: [OperationContract]         [WebInvoke

    2.1K90发布于 2018-01-24
领券