文章列表
 
您正在查看 "wcf/rest" 分类下的文章

2010-01-13 9:16

Usually the WCF service is hosted in a ServiceHost, if the WCF-Service fails then the only option is to kill the WCF service and start a new one.

The ServiceHost has an event trigger "Faulted" that is activated when the WCF Service fails:

ServiceHost host =
 
2009-11-06 22:23

http://msdn.microsoft.com/zh-cn/magazine/cc163569(en-us).aspx#S1

Serialization in Windows Communication Foundation
Aaron Skonnard
 
2009-10-16 19:00

WCF按照basicHttpBinding方式发布,.net按照Web Service方式调用,自动生成的Proxy中枚举类型和Nullable类型的参数,在Proxy里面发现一些不一样的东西,都额外生成一个配对的XXSpecified的字段和属性。你必须将该值设为true,否则,WCF序列化的时候回忽略相应的枚举类型或Nullable类型,全部使用的默认值,你所赋的值都被忽略了,只有你将XXSpecified设置为true就可以了。

 
2009-10-13 14:33

如果修改了netTcpBinding的maxConnections的值,服务会导致不正常,会报端口已经被占用

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
     <services>
     <service name="MaxConnections.Service" behaviorConfiguration="mexBehavior">
         <host>
    

 
2009-09-20 22:06

public static class ex
    {
        /// <summary>
        /// Json序列化,用于发送到客户端
        /// </summary>
        public static string ToJsJson(this object item)
        {

            Dat

 
2009-09-19 23:37
 
2009-09-13 21:19

When using WCF to write RESTful web services, the default XML response stream doesn’t contain the XML Declaration or XML DOCTYPE. the default XML serialization mechanism used by WCF’s data contract serializer does support emitting XML declaration, but it isn’t turned out by default. You could try using XmlSerializer instead which does support emitting XML declaration, but if you need stick to data contract serializer, you could try hooking into the WCF serialization p

 
2009-09-13 21:12

WCF RESTful service API 可以让我们通过HTTP协议传输 POX格式的内容,如果你用DataContractSerializer 消息序列化器,默认的Content-Type Header是application/xml类型,如果用DataContractJsonSerializer,则Content-Type默认就是application/json类型。如果你想输出其他类型的内容,如 video/audio 类型的内容,需要显示的控制Content-type header头,通过编写一个自定义的message formatter可以达到这个目的,下面是个例程:

 
2009-09-13 0:21
Web Programming Model Extensibility Samples

The samples in this section demonstrate Windows Communication Foundation (WCF) Web programming model extensibility concepts.

WebContentTypeMapper Sample
Demonstrates how to map new content types to WCF message body formats.

 
 
   
 
 
文章分类
 
   
 
文章存档
 
     
 
最新文章评论
  

gss
 

学习了
 

很精辟,希望有时间能跟楼主讨论学习。
 

苦难中的中国?苦难中的中国人民? 在这里记录。。。
 

那悲剧了。。。。
   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu