wcf-client

Setting MessageHeaders.To field gets overwritten

♀尐吖头ヾ 提交于 2020-01-15 11:54:29
问题 Here's the scenario: I'm trying to send a SOAP message to an intermediary router service. That service only cares about my SOAP message headers, and uses the WS-Addressing To header to forward along my message. I need to basically POST a request like the following to the router service: POST http://gatewayRouter/routingService HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Host: gatewayRouter Content-Length: 8786 Expect: 100-continue Connection: Keep-Alive <s:Envelope xmlns:s=

Setting MessageHeaders.To field gets overwritten

假装没事ソ 提交于 2020-01-15 11:53:06
问题 Here's the scenario: I'm trying to send a SOAP message to an intermediary router service. That service only cares about my SOAP message headers, and uses the WS-Addressing To header to forward along my message. I need to basically POST a request like the following to the router service: POST http://gatewayRouter/routingService HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8 Host: gatewayRouter Content-Length: 8786 Expect: 100-continue Connection: Keep-Alive <s:Envelope xmlns:s=

Strange exception when connecting to a WCF service via a proxy server

爷,独闯天下 提交于 2020-01-14 09:17:07
问题 The exception " This operation is not supported for a relative URI. " occurs in the following situation: I have a WCF service: [ServiceContract(ProtectionLevel=ProtectionLevel.None)] public interface IMyService { [OperationContract] [FaultContract(typeof(MyFault))] List<MyDto> MyOperation(int param); // other operations } public class MyService : IMyService { public List<MyDto> MyOperation(int param) { // Do the business stuff and return a list of MyDto } // other implementations } MyFault

The server was unable to process the request due to an internal error. in WCF error

偶尔善良 提交于 2020-01-13 11:37:07
问题 I have written my service in framework 4.0 using C#. It's an simple method which returns a value The Web.config is like this: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <machineKey validationKey="0E1F430D6FFFA91FBEDAEC1D2DDAAC2127EB055DBAFB78328C5BDE83249A94EA66400453B" decryptionKey="A13EACEAAABBECF2D06619924A8" validation="SHA1" decryption="AES" /> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <services> <service name=

How to bind a WCF Http client to a specific outbound IPAddress before making the request

独自空忆成欢 提交于 2020-01-13 03:50:13
问题 I want my request to go out through a specific IP Addresses. Is there a way to do that in WCF. The explanation of why I need this is a little long winded so i'd rather not get into that. Here is sample code string ipAddress = "192.168.0.32"; IService service; ChannelFactory<IOmlService> factory = new ChannelFactory<IService>(new BasicHttpBinding(), new EndpointAddress("http://" + IPAddress + ":6996/IService")); service = factory.CreateChannel(); service.Test(); Here is an example scenario to

Can you combine the WSDL and XSD data from a WCF service?

北城余情 提交于 2020-01-11 06:15:29
问题 Is it possible to create a single file to generate a client from a WCF generated WSDL file (and any additional XSD files that are also generated from this service) I can generate a valid client using svcutil.exe passing both the wsdl file and each xsd file, but I have a customer who is using a PHP tool to generate this and I wanted to see if I could make it easy for them by having only one file instead of many. 回答1: Yes, you can - with some clever WCF extensions. Check out these ready-made

WCF client unit test/integration test

本秂侑毒 提交于 2020-01-07 06:44:11
问题 I generated a proxy client to a SOAP web service. I would like to test the request envelop without actually calling the service at the other end (actual endpoint) for now, i wrap my tests in try/catch block as It will timeout. is they a way fake the endpoint as I'm only testing the request body? 回答1: Use New MockService option from within SoapUI. Here are detailed steps: Create a new SoapUI project As a Initial WSDL provide url of you local service (with ?wsdl added) or WSDL of external

calling a WCF service object method in another WCF service

扶醉桌前 提交于 2020-01-06 19:38:30
问题 I using two WCF services. WCF service A is hosted in my .NET Winform application and WCF Service B is hosted on a Windows Service. I am able to instantiate a client for WCF Service B and use the methods - i.e. call the WCF service hosted on Windows service from the .NET Winform app. I am not able to accomplish the reverse with WCF Service A - i.e. call the WCF Service hosted on the .NET Winform application from the Windows Service. The call to the method times out. I have used the WCF Test

ClientBase classes are not available in Reference.cs file

。_饼干妹妹 提交于 2020-01-05 07:08:21
问题 I added a service reference in Visual Studio 2010 using following wsdl. It is added successfully. This is a wsdl generated from schema xsd files; not from actual service code. Any idea why this is not generating the required class and methods in Reference.cs file? <?xml version="1.0" encoding="utf-8"?> <definitions xmlns:import0="urn:thinktecture-com:demos:restaurantservice:messages:v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:import1="urn:thinktecture-com:demos:restaurantservice

How to get the base64 signature encoding for a WCF request

陌路散爱 提交于 2020-01-04 16:24:06
问题 I have a WCF client proxy and am using the following binding element to sign the request to a third party Java web service: Dim asec As TransportSecurityBindingElement = SecurityBindingElement.CreateCertificateOverTransportBindingElement() asec.EnableUnsecuredResponse = True asec.SetKeyDerivation(False) asec.AllowInsecureTransport = True asec.IncludeTimestamp = True However, I'm told there is a validation error on the service side: Signature validation failed: Invalid encoding type (only