Tag Archives: WCF

Azure Relay – WCF Relay [Robert Haken, HAVIT Vzdělávací okénko, 2.8.2018]

Záznam ze Vzdělávacího okénka HAVIT z 2. srpna 2018, kde jsem ukazoval, jak lze Azure Relay využít pro komunikaci s WCF službou umístěnou uvnitř zabezpečené sítě, která nedovoluje inbound komunikaci.

Nahrávka je publikována na našem HAVIT YouTube Channelu.

WCF: The message with Action “ cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher.

Pokud voláte WCF webovou službu (SOAP) a dostáváte tuto response

The message with Action “ cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

…může to být kromě obvyklých zřejmých důvodů způsobeno i zcela chybějící HTTP-hlavičkou SOAPAction v příchozím HTTP-POST SOAP requestu (match je potom možný pouze na *-wildcard-action, cokoliv jiného končí chybou výše).

Fiddler: Zachytávání WCF SOAP volání localhost služby

Pokud ladíte projekt s WCF client-server komunikací (WCF SOAP), může se hodit možnost zachytávat tuto komunikaci ve Fiddleru.

Mnoho návodů vám pomůže nastavit Fiddlera jako proxy, pokud chcete zachytávat komunikaci svého WCF clienta se vzdálenou webovou službou. Pokud však serverovou stranu sami vyvíjíte a běží vám právě na localhost, postup dle těchto návodů vám komunikaci nezachytí.

Je potřeba na straně WCF clienta nastavit adresu cílových endpointů pomocí “localhost.fiddler:port”, všude tam, kde dosud máte “localhost”:

<system.serviceModel>
    <client>
        <endpoint address="http://localhost.fiddler:12890/WebServices/MyService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyService" contract="MyApp.IMyService" name="BasicHttpBinding_IMyService"/>
    </client>
</system.serviceModel>