惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Know Your Adversary
Know Your Adversary
月光博客
月光博客
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
NISL@THU
NISL@THU
爱范儿
爱范儿
S
Securelist
博客园 - 叶小钗
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
aimingoo的专栏
aimingoo的专栏
D
DataBreaches.Net
G
GRAHAM CLULEY
P
Proofpoint News Feed
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
博客园 - 【当耐特】
H
Help Net Security
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss

博客园 - aquilahkj

在Flutter中使用极光推送集成华为通道踩坑 Flutter中生成Android的jks签名文件并使用 ABP Vnext使用mysql数据库 实现ElementUI Dialog宽度响应式变化 使用Vue Baidu Map对百度地图实现输入框搜索定位 在dotnet core实现类似crontab的定时任务 使用Docker搭建HttpRunnerManager环境 docker搭建nginx反代ngrok服务 - aquilahkj 开源一个基于dotnet standard的轻量级的ORM框架-Light.Data VMware Fusion下安装Win8启用Hyper-V centos下安装rinetd(转载) 在Mac OS X上安装JavaHL SVN数据仓库配置 mysql 创建 主键索引 唯一索引 全文索引 多列索引 添加索引 CentOS 6.0 安装 MONO 2.10.8 关于MYSQL 远程登录的授权方法 命令 CentOS 6.0 编译安装 MySQL 5.5.17 linux下允许root用户远程登录 Linux Vi命令
在MONO下实现WCF所遇到的问题
aquilahkj · 2011-11-10 · via 博客园 - aquilahkj

最近要在Linux上移植一套.net开发的B/S系统,首先需要部署一个WCF服务,系统选用CentOS,现用虚拟机测试,已安装mono 2.10.6,xsp2,mod_mono和httpd,一切部署,建立测试用的aspx页面,访问正常,xsp的测试网站也全部正常.

安装方法 http://www.cnblogs.com/aquilahkj/archive/2011/11/03/2234380.html#

  编辑/etc/httpd/conf.d/mod_mono.conf

在下方加入 AddType application/x-asp-net .svc 这样mod_mono才会解析WCF的svc页面.

建立测试用的WCF程序放进服务器,输入地址访问服务svc页面,报500错误  

  Contract 'MyWcfApp.IService1' was not found in the implemented contracts in this service host.

google很久也没有结果,测试服务在windows下正常访问,无任何问题,无论怎修改方法和特性标签也没用,折腾到最后,发现~~原来是编译版本的问题,在windows下使用了3.5的的framework编译,改为4.0就没有问题,原因应该是我们mod_mono.conf中,把MonoServerPath设置为mod-mono-server4,所以需要用4.0的框架编译.

用4.0编译后再次打开连接,返回soap错误

anyType was already contained in the schema object table. Consider setting MONO_STRICT_MS_COMPLIANT to 'yes' to mimic MS implementation. Related schema item SourceUri

google了文章  http://archive.cnblogs.com/a/2113112/ 发现应该是环境变量的问题,需要设置环境变量MONO_STRICT_MS_COMPLIANT=yes

有两个方法解决:

1. 在WCF网站中新增Global.asax文件,修改代码如下

protected void Application_Start(object sender, EventArgs e)

        {

#if MONO

            Environment.SetEnvironmentVariable("MONO_STRICT_MS_COMPLIANT", "yes");

#endif

        } 

2.修改/etc/rc.d/init.d/httpd

在末端添加如下代码:

MONO_STRICT_MS_COMPLIANT=yes

export MONO_STRICT_MS_COMPLIANT 

httpd作为服务随系统启动时,加入该环境变量,并export 

配置完成后,在windows编写测试客户端测试,能正常调用,但每次首次调用时连接时程序卡了10多秒,之后请求就很快了,不知原因为何,还望指点,另外如果我在服务端抛出异常时,客户端就报一下错误

Addressing Version 'AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)' does not support adding WS-Addressing headers. 

不会报我服务器实际的异常错误.也找不到解决方法,但当把客户端部署在CentOS直接调用访问服务端时,连接只卡了1秒多,并且也能抛出真正异常.估计是mono生成的SOAP请求问题吧.