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

    如何创建一个RESTful WCF Service

    AspNetCompatibilityRequirementsMode.Allowed)] public class CostService { // To use HTTP GET, add [WebGet ResponseFormat is WebMessageFormat.Json) // To create an operation that returns XML, // add [WebGet UpdateEmployee(Employee employee) { return; } [OperationContract] [WebGet ResponseFormat is WebMessageFormat.Json) // To create an operation that returns XML, // add [WebGet UpdateEmployee(Employee employee) { return; } [OperationContract] [WebGet

    91010发布于 2018-09-19
  • 来自专栏pangguoming

    WCF 添加 RESTful 支持,适用于 IIS、Winform、cmd 宿主

    so, the service will be available at http://www.example.com/soap http://www.example.com/json Apply [WebGet operation contract to make it RESTful. e.g. public interface ITestService { [OperationContract] [WebGet ServiceContract(Namespace = "http://test")] public interface ITestService { [OperationContract] [WebGet

    1.2K90发布于 2018-03-08
  • 来自专栏Python程序员杂谈

    java使用正则表达式抓取网页内容存为txt

    java.util.regex.Pattern; /** * 网页抓取 * @author 胡阳 * @blog http://www.the5fire.com * */ public class WebGet contextAll = new StringBuilder(""); private int pageCount = 0; private String pageType = ""; public WebGet () { } public WebGet(String url) { this.myUrl = url; } public WebGet(String url,int pageCount return contextAll.toString(); } public static void main(String[] args) throws IOException { WebGet wg = new WebGet("http://www.tianyabook.com/qita/hougeixue/",227,"html"); try { if (wg.writeTxt(

    1.3K20发布于 2019-02-28
  • 来自专栏大内老A

    [WCF REST] UriTemplate、UriTemplateTable与WebHttpDispatchOperationSelector

    ServiceContract(Namespace = "http://www.artech.com/")] 2: public interface ICalculator 3: { 4: [WebGet = webGet) ? = 20: webGet)? (UriTemplate = "Add/{x}/{y}")] 5: double Add(double x, double y); 6:  7: [WebGet(UriTemplate = "Multiply/{x}/{y}")] 11: double Multiply(double x, double y); 12:  13: [WebGet(UriTemplate

    1.3K60发布于 2018-02-07
  • 来自专栏【计网】Cisco

    【斯坦福计网CS144】Lab0终结笔记

    图1-6 运行结果 (3)打开webget.cc文件,将代码修改,如图1-7所示。代码源码见附录。 ​图1-7 代码细节 (4)输入make进行编译,编译结果如图1-8所示。 ​ /apps/webget cs144.keithw.org /hello 进行测试,测试结果如图1-9所示。 . /apps/webget cs144.keithw.org /hello ​图1-9 测试结果 (6)输入make check_webget测试样例,测试结果如图1-10所示。 make check_webget ​图1-10 测试结果 3 实现内存中的可靠字节流 (1)输入命令”.. 这里在webget.cc文件首先需要创建一个TCPSocket,只要管道未关闭就需要从管道内提取发送的消息,所以这里使用了while循环进行判断,直到eof结束,这里需要注意空格,特别容易出错。

    67020编辑于 2024-02-20
  • 来自专栏c++与qt学习

    CS 144 Lab Zero -- 可靠的内存字节流

    本节我们将写一个“webget”程序,创建一个TCP stream socket,去和一个web server建立连接。 FileDescriptor, Socket, TCPSocket, and Address classes 各个类的继承关系如下: 看上去比较重要的是TCPSocket这个类,读完文档之后,我们就可以去实现webget 程序了,代码量预计 10 行左右,位于apps/webget.cc,实现代码时务必借助 libsponge 中的 TCPSocket 和 Address 类来完成。 /apps/webget cs144.keithw.org /hello 它的行为应该和上述2.1小节的行为保持一致。 最后它应该能够通过测试 make check_webget ---- In-memory reliable byte stream 要求 字节流可以从写入端写入,并以相同的顺序,从读取端读取 字节流是有限的

    51420编辑于 2023-10-11
  • 来自专栏大内老A

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

    1: [ServiceContract] 2: public interface IEmployees 3: { 4: [WebGet(UriTemplate = "all") ] 5: [Description("获取所有员工列表")] 6: IEnumerable<Employee> GetAll(); 7:  8: [WebGet 1: [ServiceContract] 2: public interface IEmployees 3: { 4: //其他成员 5: [WebGet(UriTemplate

    93870发布于 2018-02-07
  • 来自专栏技术之路

    wcf http 返回图片

    .85).aspx [ServiceContract] public interface IImageServer { [OperationContract, WebGet

    95960发布于 2018-01-31
  • 来自专栏张善友的专栏

    RESTful WCF

    Client》 下面我们来看一个简单的例子: [ServiceContract] public interface IService {      [OperationContract]      [WebGet

    1K100发布于 2018-01-29
  • 来自专栏张善友的专栏

    WCF Data Service 的.NET Client 的不支持原生类型服务操作的解决方法

    WCF Data Service  的.NET Client 的不支持返回值为原生类型(string,int)的服务操作调用,例如我们用如下服务操作: [WebGet] public ObjectQuery

    1.1K100发布于 2018-01-30
  • 来自专栏熊二哥

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

    2 { 3 [ServiceContract(Namespace = "http://www.sory.com")] 4 public interface IEmployees 5 { 6 [WebGet (UriTemplate="all")] 7 IEnumerable<Employee> GetAll(); 8 9 [WebGet(UriTemplate = "{id}")] 10 Employee

    96170发布于 2018-01-24
  • 来自专栏张善友的专栏

    入门:构建简单的Web API

    ContactApi类,添加下述引用: using System.ServiceModel.Web; using ContactManager.Resources; 添加一个Get方法返回所有的contracts [WebGet Contact {ContactId = 6, Name = "Yavor Georgiev"} }; return contacts.AsQueryable(); } Get方法上加了WebGet

    4.1K90发布于 2018-01-19
  • 来自专栏木宛城主

    SharePoint 2013创建WCF REST Service

    创建用于测试的契约接口: [ServiceContract] public interface IService1 { [OperationContract] [WebGet

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

    ExtJs与WCF交互:生成树

    RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]  public class WcfTreeService  {  // 添加 [WebGet

    1.6K90发布于 2018-01-23
  • 来自专栏技术博客

    MVC项目开发中那些用到的知识点(WCF Rest在MVC项目中的两种调用方式)

    接口代码 namespace WCFLib { [ServiceContract] public interface IRestService { [WebGet

    98120发布于 2018-09-11
  • 来自专栏大内老A

    一个通过JSONP跨域调用WCF REST服务的例子(以jQuery为例)

    5: { 6: [ServiceContract] 7: public interface IEmployees 8: { 9: [WebGet

    1K80发布于 2018-02-07
  • 来自专栏大内老A

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

    ServiceContract(Namespace="http://www.artech.com/")] 2: public interface IEmployees 3: { 4: [WebGet (UriTemplate = "all")] 5: IEnumerable<Employee> GetAll(); 6:  7: [WebGet(UriTemplate

    94170发布于 2018-01-16
  • 来自专栏大内老A

    [WCF REST] 通过ASP.NET Output Caching实现声明式缓存

    (Namespace = "http://www.artech.com/")] 7: public interface ITime 8: { 9: [WebGet

    96670发布于 2018-01-16
  • 来自专栏圣杰的专栏

    Asp.net web api 知多少

    支持HTTP GET和POST,分别对应使用 [WebGet] 和 [WebInvoke] 特性。 如果需要支持其他HTTP动词,你需要在.svc文件中针对需要支持的HTTP动词做一些配置。 使用WebGet通过参数传递数据,需要配置。同时,UriTemplate 必须指定。 支持XML, JSON 和 ATOM 数据格式。

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

    [WCF REST] 通过ASP.NET Output Caching实现声明式缓存

    (Namespace = "http://www.artech.com/")] 7: public interface ITime 8: { 9: [WebGet

    94580发布于 2018-01-16
领券