wcf-client

sending custom object from client (Jquery) to server (WCF)

纵饮孤独 提交于 2019-12-10 10:57:45
问题 how to send a custom object from client (jquery) to server (WCF service) what is the way of passing an object? below is my code and when i see in the firebug this is what i get please see the screen shot: http://img88.imageshack.us/img88/205/54211873.png var CustomerInfo = { Name: '', Address: '' }; function buildNewCustomerRequest() { var request = { CustomerInfo: CustomerInfo }; request.CustomerInfo.FirstName = $("#Name").val(); request.CustomerInfo.Address = $("#Address").val(); return

How to add attribute to WCF message header with MessageHeader.CreateHeader() method?

谁说胖子不能爱 提交于 2019-12-10 06:41:29
问题 I am adding a WCF custom header with the following code MessageHeader header = MessageHeader.CreateHeader("Key", "ns", "Value"); OperationContext.Current.OutgoingMessageHeaders.Add(header); With this I also want to add xmlns:wsa="http://www.w3.org/2005/08/addressing" wsa:IsReferenceParameter="1" as an attribute to this Message header. Is there any way to add above namespace and attribute to the message header? 回答1: I found solution. We have to Implement custome header, which is inhertied from

Possible to consume badly formed Fault Messages?

可紊 提交于 2019-12-09 23:47:57
问题 I've a WCF client communicating with an unknown server implementation which I have no control over. This client works fine it just doesn't like, what appears to be, incorrectly formed SOAP Fault messages. The messages I receive look like: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header>...</soap:Header> <soap:Body> <soap:Fault> <soap:faultcode>soap:Client</soap:faultcode> <soap:faultstring>...</soap:faultstring> <soap:detail>...</soap:detail> </soap:Fault>

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

筅森魡賤 提交于 2019-12-09 09:54:05
问题 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'. 回答1: Change your clientCredentialType to " Ntlm ". 来源: https:/

The request was aborted: Could not create SSL/TLS secure channel - Decrypt returned SEC_I_RENEGOTIATE

会有一股神秘感。 提交于 2019-12-08 15:42:24
问题 Our application consumes a web service in C# (.Net framework 3.5). Getting the correct response from the server most of the time, but it is intermittently throwing an error: The request was aborted: Could not create SSL/TLS secure channel. Having enabled the traces it shows: System.Net Error: 0 : [3688] Decrypt returned SEC_I_RENEGOTIATE. Has anyone faced this issue before? What is a fix to this problem. please let me know. Any help would be highly appreciated. Thanks in advance! -Jemo 来源:

WCF Client does not follow contract UriTemplates

心已入冬 提交于 2019-12-08 11:15:08
问题 I have defined a function in the ServiceContract of my WCF service as followed: [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "/test")] CommandResponse Test(); And on the other end, at the client app I added the WCF service via "Add service reference" in visual studio. When calling the service test function using: var test = m_ServiceClient.Test(); I am getting an error saying: Operation 'GetUser' of contract...

Which security mode to use in WCF client with SSL and HTTP Authentication?

筅森魡賤 提交于 2019-12-08 09:21:31
问题 I need to use SSL and HTTP authentication in my WCF client to connect to a web service. I have wcf client binding configuration as shown below and code to load certificate and pass the user name and password for http authorization. When I tried this, I am receiving an error "The http request is unauthorized with client authentication scheme 'Anonymous'. The authentication from the server was 'Basic realm="ws.dataway.com:443'". The remote server returned an error: (401) Unauthorized. Can

Problem authenticating with WCF service cross domain

吃可爱长大的小学妹 提交于 2019-12-08 06:09:02
问题 I'm new to WCF and its security so was looking for some help on a problem I'm having. I have a WCF service that to be deployed to every machine in a small domain. The WCF service is to be hosted in a Windows Service since it has methods in it that need to be invoked elevated. The service is very draft at the moment (it exposes meta-data - but I believe this is to be turned off later - is this possible?). It uses the net.tcp binding - The App.Config of the service is shown below: <?xml version

wcf client - soap encoding - complex types in different namespace

独自空忆成欢 提交于 2019-12-07 21:43:01
问题 I keep running into namespace mismatches when trying to deserialize the SOAP response. The response is unqualified and the nested complex types are qualified with a namespace like this: <getResult> <enc:ApplicationExceptionOccurred xmlns:enc="com.namespace1.www/complexTypes">false</enc:ApplicationExceptionOccurred> <enc:SystemExceptionOccurred xmlns:enc="com.namespace1.www/complexTypes">false</enc:SystemExceptionOccurred> <enc:ComplexType xmlns:enc="com.namespace1.www/complexTypes"> ... </enc

How to send list of objects to WCF service?

孤人 提交于 2019-12-07 16:41:10
问题 I'm building WCF service and I would like to accept List as a parameter to one of my method. Here is my code: [ServiceContract] public interface IProductService { [OperationContract] int InsertProducts(List<Product> products); } [DataContract] [KnownType(typeof(List<Product>))] public class Product { [DataMember] public int ProductId{ get; set; } [DataMember] public string ProductName{ get; set; } [DataMember] public List<Product> Products { get; set; } } When I run service it gives me an