Receiving an IRequestReplyRouter does not match the service contract or is there a valid contract error?

enter image description here

No matter what I try to do when it comes to WCF Routing, I constantly get this error (through the WCF test client). Can't I see any methods in my services?

At first, I just assumed that this was my code, so I downloaded almost all the examples that I could find in WCF + Routing, and just ran them as is. The same error will happen!

I checked event view logs, etc. to see if there is an error there? nothing. I tried google search and searches here for others (as of course I'm not alone) nothing.

Note:

  • I am using IIS7 with AppFabric installed.
  • I am using .NET 4.0
  • I use the WCF Service application template (default in VS2010)
  • I'm losing my mind about this :)

It completely lost me, what's going on?

Here's what the WCF test client returns -

enter image description here

+4
source share
2 answers

WCF 4 Routing Service will not provide metadata for your β€œactual” service unless you provide it through a filtered endpoint or a separate URL. The wcf test client is not smart enough to figure it out anyway.

What would I suggest if you want to test your routing functionality, use something like soapui. Then you can use it to change the address of the service to which you send your request.

If you want to expose service metadata through a router, this article should help.

http://www.devproconnections.com/article/net-framework-402/Routing-Service-Metadata/

NTN

+2
source

When I got this error, it was because I made the first approach to the contract and made my own WSDL, and then used it to create an interface for the service.

The WCF testing client will dynamically create the WSDL, and then the name of the contract that it dynamically assigns does not match the setting that I manually set.

As soon as I changed my web.config so that the externalMetadataLocation attribute was populated with the serviceMetadata element and pointed it to my static WSDL, everything was fine.

+1
source

Source: https://habr.com/ru/post/1346547/


All Articles