wcf

WCF异常信息

无人久伴 提交于 2020-02-03 12:39:42
1、服务“CJ.Demo.Conso.WcfService.EmployeeMngService”有零个应用程序(非基础结构)终结点。这可能是因为未找到应用程序的配置文件,或者在配置文件中未找到与服务名称匹配的服务元素,或者服务元素中未定义终结点。 <service name="CJ.Demo.Conso.WcfService.EmployeeMngService"> 整个类的路径未设置正确 2、IIS部署WCF出现‘当前已禁用此服务的元数据发布’ a)如果用4.0框架需要在IIS中将asp.net版本设置为4.0 b )出现提示原因分析:当机器上安装了asp.net 2.0和4.0时,需分别建立应用程序池,并在部署虚拟目录时分属于不同应用程序池。 1) 建立不同应用池 2) 将4.0虚拟目录应用到4.0的应用程序池 //name属性值必须置空 <behavior name="" > <!-- 将下列元素添加到服务行为配置中。 --> <serviceMetadata httpGetEnabled="true" /> </behavior> 3、没有与给定的地址“”匹配的协议绑定。协议绑定在 IIS 或 WAS 配置中的站点级别配置。 http://blog.csdn.net/jhhja/article/details/6226307 正确的:address单独放置

JSON 学习总结(1)

倾然丶 夕夏残阳落幕 提交于 2020-02-03 11:17:11
http://www.cnblogs.com/KangC/archive/2008/12/08/1349130.html JSON进阶一-初识JSON JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScript(Standard ECMA-262 3rd Edition - December 1999)的一个子集。 JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScript, Perl, Python等)。这些特性使JSON成为理想的数据交换语言。 上述的JSON,是我网上找来的,而我理解的JSON是一种以键值对形式描述的数据结构,他可以等同于后台的类。 例如:我们在后台有个People类,以C#为例: public class People { /**/ /// <summary> /// 姓名 /// </summary> public string name; /**/ /// <summary> /// 性别 /// </summary> public byte sex; /**/ /// <summary> /// 出生日期 /// </summary> public DateTime

Cross domain javascript callback is not supported in authenticated services. AJAX query to WCF service via SSL proxy

大憨熊 提交于 2020-02-03 05:19:05
问题 I have a WCF / SVC web service which is consumed by a JavaScript call via AJAX. The page is accessed via a SSL proxy ( https://gate.company.com/MyPage ) located in the DMZ which then forwards the request to the internal webserver ( http://myLocalWebServer/MyPage ). After a lot of googeling and trying around, I was able to make it work, playing around with the parameters crossDomainScriptAccessEnabled and Access-Control-Allow-Origin . Although, it does only work if the authentication mode is

Silverlight + WCF 的IIS 发布部署

本秂侑毒 提交于 2020-02-02 23:08:23
SL + WCF 在iis(7.0以下)上部署真是有点麻烦…记录一下: 1. 在服务器上安装 Framework 3.0 , Framework 3.5 ,和 Framework 3.5 SP1 (我就是因为没装SP1,wcf一直报错。。。。。) 2. cmd下输入: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i -enable, 刚装新版本要确保.aspx可以正常显示, 我没注册之前都是“服务器没有响应” 3. cmd下输入: C:\WINDOWS\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe /i /x 在iis中注册WCF组件。 4. iis7以下的版本要注册一下silverlight文件类型: iis---右键网站属性----HTTP Headers---File Types--添加下面两个类型 .xaml --- application/xaml+xml .xap ----application/x-silverlight-app 经过这番折腾终于可以正常显示silverlight + wcf 了,呵呵 !!! 来源: https://www.cnblogs.com

Display all messageHeader's values

戏子无情 提交于 2020-02-02 11:35:30
问题 I'd like to know what is the best way to display all MessageHeaders server side. Actually the only way I know is the following: OperationContext.Current.IncomingMessageHeaders.GetHeader<T>(Name, Namespace) That method is only for a known MessageHeader but I'd like to display their values in a loop. Thank You 回答1: The headers are loopable: for (int i = 0; i < OperationContext.Current.IncomingMessageHeaders.Count; ++i) { MessageHeaderInfo h = OperationContext.Current.IncomingMessageHeaders[i];

net.tcp binding metadata problem

那年仲夏 提交于 2020-02-02 11:31:12
问题 <system.serviceModel> <services> <service name="SUR.Core.Service.Implementation.SURDirectoryService" behaviorConfiguration="DefaultServiceBehavior"> <host> <baseAddresses> <add baseAddress="net.tcp://127.0.0.1:8731/ISURDirectoryService"/> </baseAddresses> </host> <endpoint address="" binding="netTcpBinding" bindingConfiguration="DefaultDirectoryServiceBindConfig" contract="SUR.Core.Service.Facade.ISURDirectoryService"/> <endpoint address="mex" binding="mexTcpBinding" contract=

WCF client security header error “An invalid security token was provided”

落花浮王杯 提交于 2020-02-02 06:22:50
问题 According to our provider we need to send this kind of Header: <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-12" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>string</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">string<

WCF client security header error “An invalid security token was provided”

别说谁变了你拦得住时间么 提交于 2020-02-02 06:21:11
问题 According to our provider we need to send this kind of Header: <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-12" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>string</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">string<

WCF client security header error “An invalid security token was provided”

ε祈祈猫儿з 提交于 2020-02-02 06:20:06
问题 According to our provider we need to send this kind of Header: <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-12" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>string</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">string<