wcf

Windows Communication Foundation

徘徊边缘 提交于 2020-01-25 02:47:31
什么是 Windows Communication Foundation? Web 服务中包含了用于应用程序间通信的标准协议,它在全球范围内的广泛采纳改变了软件开发。 例如,如今 Web 服务提供的功能包括安全性、分布式事务协调和可靠的通信。 Web 服务所发生的这些改变的效益应反映在开发人员所使用的工具和技术方面。设计 Windows Communication Foundation (WCF) 的目的是为分布式计算提供可管理的方法,提供广泛的互操作性,并为服务定位提供直接的支持。 WCF 通过一种面向服务的新型编程模型简化了关联应用程序的开发。通过提供分层的体系结构,WCF 支持多种风格的分布式应用程序开发。 WCF 通道体系结构在底层提供了异步的非类型化消息传递基元。 而建立在此基础之上的是用于进行安全可靠的事务处理数据交换的各种协议功能,以及广泛的传输协议和编码选择。 类型化编程模型(称为“服务模型”) 设计用来降低分布式应用程序的开发难度,并为 ASP.NET Web 服务、.NET Framework 远程处理和企业服务领域的专业开发人员,以及将要从事 WCF 开发的人员提供熟悉的开发体验。 该服务模型的特点在于它将 Web 服务的概念直接映射到 .NET Framework 公共语言运行库 (CLR) 中的对应内容,包括将消息灵活且可扩展地映射到用诸如 Visual

Using IParameterInspector to stop unauthorized user to read data without proper access in WCF

左心房为你撑大大i 提交于 2020-01-25 02:44:37
问题 I'm having a WCF service and several operations where I return arrays of basic poco items. To mitigate cases where I by mistake return items which the client doesn't have access to, I was planning to use IParameterInspector, attach that to an IOperationBehavior-attribute and then validate read access in AfterCall. If the client doesn't have read rights then I throw a WebFaultException. I'm using custom authentication on my items-repository (the service class) and the ServiceSecurityContext is

How to deserialize soap response?

ⅰ亾dé卋堺 提交于 2020-01-25 01:49:46
问题 I'm trying to deserialize following xml to c# object: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:topupResponse xmlns:ns2="http://www.claro.com.hn/esb/ws/topups/" xmlns:ns3="http://www.claro.com.hn/esb/ws/ops/"> <result> <conversionRate>7.7765</conversionRate> <datetime>2018-01-10T08:33:19.685-06:00</datetime> <distAmount>5.00</distAmount> <msisdn>50279613880</msisdn> <newBalance>38</newBalance> <operAmount>38.882500</operAmount> <responseCode>0<

Problem with POST request to RESTful WCF Service

不打扰是莪最后的温柔 提交于 2020-01-25 00:45:07
问题 I am trying to make a post request to my restful WCF service. The contract looks like this: [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "UploadMovie")] string UploadMovie(Stream stream); or [OperationContract] [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,

Echo xml result from wcf service in php?

微笑、不失礼 提交于 2020-01-24 23:02:45
问题 I have a WCF Operation GetColors which returns a list of colors as GetColorsResult. I am getting the result fine, but how do I loop through GetColorsResult in php and echo each element? I am doing: <?php header('Content-Type: text/plain'); echo "WCF Test\r\n\r\n"; // Create a new soap client based on the service's metadata (WSDL) $client = new SoapClient('http://localhost:8181/Colors.svc?wsdl',array( 'login' => "test", 'password' => "test")); $retval = $client->GetColors(); //Need to loop

Reading a particular config element using c#?

本小妞迷上赌 提交于 2020-01-24 21:28:08
问题 Here i have a config file and i am reading that config elements in c#. What i need is to read all the elements based on the host <Brand Host="localhost:64995"> .For example if the host is localhost:64995 i need the nodes inside it like <add Name="aaa" BrandId="13" /> Here is my config <SingleSignOn> <Brands> <Brand Host="localhost:64995"> <add Name="aaa" BrandId="1" /> </Brand> <Brand Host="aaaaa"> <add Name="bbbb" BrandId="2" /> </Brand> </Brands> </SingleSignOn> and my code string host =

The target assembly contains no service types. You may need to adjust the Code Access Security policy of this assembly

醉酒当歌 提交于 2020-01-24 21:08:05
问题 I have a small WCF solution with 2 methods but am getting this error when I build it. If I leave the message without dismissing it, I get WCF Service Host cannot find any service metadata. This may cause the client application to run improperly. Please check if metadata is enabled. I'm pretty sure my config is wrong, probably the defined endpoint does not match the namespace but I'm not sure what to set where. The namespace of the Contracts class is JOB_1_0_Service.Contracts with 2 methods.

Populate routetable of wcf from database

徘徊边缘 提交于 2020-01-24 20:59:48
问题 I want to add end points dynamically to routing table of wcf. Code: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class PersonService : IPersonService { [WebInvoke(UriTemplate = "", Method = "GET")] public void GetPerson() { string k = "a"; } } [ServiceContract] public interface IPersonService { [OperationContract] void GetPerson(); } public class Global : System.Web.HttpApplication { protected void Application_Start(object sender,

Populate routetable of wcf from database

China☆狼群 提交于 2020-01-24 20:59:28
问题 I want to add end points dynamically to routing table of wcf. Code: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class PersonService : IPersonService { [WebInvoke(UriTemplate = "", Method = "GET")] public void GetPerson() { string k = "a"; } } [ServiceContract] public interface IPersonService { [OperationContract] void GetPerson(); } public class Global : System.Web.HttpApplication { protected void Application_Start(object sender,

WCF Blocking problem with mutiple clients!

孤者浪人 提交于 2020-01-24 19:51:07
问题 I seem to have a blocking issue with WCF. Say I have two users and each have created their own instance of a class exposed on a WCF host using net.tcp with endpoint something like this "net.tcp://localhost:32000/SymHost/". The class is PerSession context and concurrency is reentrant. The class exposes two methods Alive() which return a bool of true straight away and an AliveWait which I inserted which does a Thread.Sleep for 4 seconds before returning true (testing purposes). Now client 1