wcf-client

Need help with manipulating SOAP header in my WCF client before sending request

徘徊边缘 提交于 2019-12-04 04:29:17
问题 I have a unique requirement where I need to send a highly customized soap header in a request to a external vendor. The only way my WCF client can interact with their web service is using a combination of Username token and message signing the entire envelope(see vendor provided soap header below). <soapenv:Envelope xmlns:bsvc="urn:com.workday/bsvc" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01

WCF System.Object Serialization

余生颓废 提交于 2019-12-03 23:02:27
问题 I have a requirement in which i have to use System.Object as a parameter in WCF. As it is not serializable,I am getting the message as the operation is not supported as it uses System.Object. Any solution to this problem. 回答1: When sending messages over the wire, WCF by default will only serialize what's enough to get the message across, i.e., the members of the contracts. If your message takes an "object" as a parameter, extra information needs to be sent over the wire with the type

Modify SOAP header Mustunderstand attribute in WCF client

▼魔方 西西 提交于 2019-12-03 21:48:07
I am writing a WCF client for a service (not WCF). Getting an error that Unprocessed 'mustUnderstand' header element: {http://www.w3.org/2005/08/addressing}Action, because request SOAP contains header with mustunderstand='true'. I have to either set it false or remove the whole header. can you show the way to do that? Here is the binding code var transportElement = new HttpsTransportBindingElement(); transportElement.AuthenticationScheme = AuthenticationSchemes.Basic; var messegeElement = new TextMessageEncodingBindingElement(); messegeElement.MessageVersion = MessageVersion.CreateVersion

What is the proper life-cycle of a WCF service client proxy in Silverlight 3?

可紊 提交于 2019-12-03 14:31:01
I'm finding mixed answers to my question out in the web. To elaborate on the question: Should I instantiate a service client proxy once per asynchronous invocation, or once per Silverlight app? Should I close the service client proxy explicitly (as I do in my ASP.NET MVC application calling WCF services synchronously)? I've found plenty of bloggers and forum posters out contradicting each other. Can anyone point to any definitive sources or evidence to answer this once and for all? I've been using Silverlight with WCF since V2 (working with V4 now), and here's what I've found. In general, it

Two WCF services with different contracts but same business objects

断了今生、忘了曾经 提交于 2019-12-03 14:28:16
For example I have two services hosted in IIS. [ServiceContract] public interface IDeviceService { [OperationContract] DeviceCollection GetAllDevices(Customer customer); } [ServiceContract] public interface IUserService { [OperationContract] User Authenticate(string username, string password); } Both the User object that is returned from the Authenticate operation in the UserService and the DeviceCollection that is returned from the GetAllDevices operation in the DeviceService have a child object definition of Customer. Customer is a business object is in the same assembly as the User and

ChannelFactory bug with dynamic arguments

ぃ、小莉子 提交于 2019-12-03 12:51:23
This question is related to Bug in the dynamic language runtime in combination with IIS 7.5 ChannelFactory hangs if I provide it with a correctly typed dynamic object. dynamic src = "MSFT"; var binding = new BasicHttpBinding(); var endpoint = new EndpointAddress("http://www.restfulwebservices.net/wcf/StockQuoteService.svc"); var channel = new ChannelFactory<IStockQuoteService>(binding, endpoint).CreateChannel(); // this will print just fine Console.WriteLine(channel.GetStockQuote(src as string)); // this will print just fine Console.WriteLine(new StockQuoteServiceClient().GetStockQuote(src));

How to force a .net WCF client to use NTLM in an basicHttpBinding?

末鹿安然 提交于 2019-12-03 12:25:51
right now I have the security node defined like this: <security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> Im getting the following error: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'. JP Alioto Change your clientCredentialType to " Ntlm ". 来源: https://stackoverflow.com/questions/1134119/how-to-force-a-net-wcf-client-to-use-ntlm-in-an

Why is my WCF Service not loading my Binding config?

て烟熏妆下的殇ゞ 提交于 2019-12-03 12:23:10
I have the problem with the following error: " The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. " So I did some research and found that I needed to increase the buffer and message size, here's my WCF Service config file: <system.serviceModel> <bindings> <wsHttpBinding> <binding name="default" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/> </wsHttpBinding> </bindings> <services> <service name="WCF.Service.Service"> <endpoint address="ws" name=

WCF Client Configuration: how can I check if endpoint is in config file, and fallback to code if not?

☆樱花仙子☆ 提交于 2019-12-03 09:22:53
问题 Looking to make a Client that sends serialized Message objects back to a server via WCF. To make things easy for the end-developer (different departments) would be best that they didn't need to know how to edit their config file to set up the client end point data. That said, would also be brilliant that the endpoint wasn't embedded/hard-coded into the Client either. A mix scenario would appear to me to be the easiest solution to roll out: IF (described in config) USE config file ELSE

How to handle incorrect SOAP fault in WCF?

筅森魡賤 提交于 2019-12-03 08:56:21
I have to consume to a third-party web service using SOAP. It was easy to get it to work with WCF, but now I have a problem with SOAP faults. The service sends me an incorrect SOAP fault: <?xml version="1.0" encoding="utf-8" ?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <SOAP-ENV:faultcode>14</SOAP-ENV:faultcode> <SOAP-ENV:faultstring>Unknown Function</SOAP-ENV:faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> The error is that the