wcf-client

Error consuming webservice, content type “application/xop+xml” does not match expected type “text/xml”

妖精的绣舞 提交于 2019-11-26 11:07:09
问题 I\'m having a weird issue when consuming a webservice for a product that my company has bought. The product is called Campaign Commander and it\'s made by a company called Email Vision. We\'re trying to use the \"Data Mass Update SOAP API\". Whenever I try to call any of the methods on the webservice, the call actually succeeds but the client fails when processing the response and I get an exception. The details of the errors are below, thanks for any help you guys can offer. Error using Web

How to add custom soap headers in wcf?

核能气质少年 提交于 2019-11-26 10:34:58
问题 Can I add Custom SOAP header in WCF incoming/outgoing messages in basicHttpBinding, like we can add custom authentication header in ASMX web services? Those custom SOAP header should be accessible using .net 2.0/1.1 web service clients (accessible by WSDL.EXE tool) . 回答1: Check out the WCF Extras on Codeplex - it's an easy extension library for WCF which offers - among other things - custom SOAP headers. Another option is to use WCF message contracts in your WCF service - this also easily

WCF change endpoint address at runtime

怎甘沉沦 提交于 2019-11-26 08:04:49
问题 I have my first WCF example working. I have the host on a website which have many bindings. Because of this, I have added this to my web.config. <serviceHostingEnvironment multipleSiteBindingsEnabled=\"true\"/> This is my default binding http://id.web, which works with the following code. EchoServiceClient client = new EchoServiceClient(); litResponse.Text = client.SendEcho(\"Hello World\"); client.Close(); I am now trying to set the endpoint address at runtime. Even though it is the same

What is the best workaround for the WCF client `using` block issue?

送分小仙女□ 提交于 2019-11-25 21:55:59
问题 I like instantiating my WCF service clients within a using block as it\'s pretty much the standard way to use resources that implement IDisposable : using (var client = new SomeWCFServiceClient()) { //Do something with the client } But, as noted in this MSDN article, wrapping a WCF client in a using block could mask any errors that result in the client being left in a faulted state (like a timeout or communication problem). Long story short, when Dispose() is called, the client\'s Close()