Why can't my test client connect to my WCF rest service? - c#

I have a simple wcf rest service. I can test it ok using the WCF Test Client.
I created a test client of my own via svcutil.exe. This builds and runs. However, it always gives this exception when instantiating the service object:
Could not find default endpoint element that references contract
'IBookService' in the ServiceModel client configuration section. This
might be because no configuration file was found for your application,
or because no endpoint element matching this contract could be found
in the client element.
I'm basically following the tutorial here:
http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services
I also cannot access the endpoints via a url when running it locally. It's unclear to me why this tutorial has a .svc file in the url when trying to access the service from a browser though. I have no .svc files anywhere.

The WCF Test Client is for testing SOAP-based services (those services using any binding other than webHttpBinding in WCF).
The WCF Test Client however is NOT capable of working with REST services.
For REST, use something like Fiddler instead.

Related

Build a WCF according to a reference service

I am building a WCF service based on a given wsdl reference service given by Readify as a part of its technical interview process. What I did is that I built a client application that explores the methods exposed through this WCF, and then I started implementing my own version from this WCF.
I have finished the coding and the hosting part for my WCF version, and I had built another client that tests the results return from both WCFs, and everything seems okay. However, when I pass my WCF URL to the Readify testing app, it gives me this message:
I couldn't connect to that service with the contract I expected. The exception message was: There was no endpoint listening at {My WCF URL} that could accept the message.
Although, I am sure that the methods names and parameter types and the returned are the same.
Any hint???

Error while consuming wcf service

I created a wcf application library with no modification from the original example and I hosted it in IIS. It's on a remote computer and using chrome i can see that the service is up and running but if i try to create a config file using
svcutil.exe http://IP_HERE/serv/WcfServiceLibrary1.Service1.svc?wsdl
i receive the following error.
I think that it has something to do with the application pool. What do you think?
My default config: http://pastebin.com/a355LcWp
After checking your service config file I found that you are hosting service on port 8733 which is mentioned in base address value. You need to make sure that you include this port number while accessing wsdl.

Consuming wcf service in coldfusion without generating proxy

We are consuming a WCF service using coldfusion. the wcf service does not expose metadata endpoint instead they share service contracts in dll and svcutil.exe generated proxy class.
Now, how can i consume the wcf service in coldfusion without generating proxy.? i see .net client can access that way by creating channel factory as given in the following url:
http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/accessing-wcf-service-without-creating-proxy/
i researched adobe help page:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-78b4.html
but there is no clue.
what possibilities i have to consume the service?
I don't understand the question. Let me see if I can figure this out:
No proxy would be involved unless you specify one. The client computer will invoke and consume the web service on the server without anything inbetween. It's a standard HTTP call.
You say you are connecting to svcutil.exe, a c# utility. So you seem to mean you have an additional layer between the two CF applications, correct? So svcutil.exe is acting as the "proxy"?

unable to configure any security with basicHttpbinding in wcf test client

I've been working with wcf library project and I cannot test my project in wcf test client with security settings for basicHttpBinding either message or transport.
You can use SoapUI, it is a proper tool for testing wcf services in both http & https mode
the site is:
http://www.soapui.org/
you can see tje feature here:
http://www.soapui.org/About-SoapUI/features.html

Using IIS ARR to route SOAP requests

The situation is that we have some SOAP (asmx) services that are version dependent upon a 3rd party software. These services reside on domainA.
We are in the process of migrating to a new version of the 3rd party software where the existing SOAP services will not be able to reside because of a version incompatibility. Currently the upgraded stuff lives on temp.domainA.
We are developing new services to replace the old SOAP services and will plug in wcf routing or something to save us from the next 3rd party version upgrade party.
Ideally, once temp.domainA is all ready to go we will switch that dns to be domainA and change the old domainA to be old.domainA there for breaking all existing applications referencing the soap services.
I've been fooling around with IIS and ARR matching on a common naming convention that the soap services have and trying to have those requests routed. This works very well for Get requests but not so well for POST requests which is what soap uses.
I set up a little test by having 2 identical services running, one on a test server and one on my local machine. The one on my local machine returns different data than the one on the test server so I can tell which one is being invoked.
I set up ARR's proxy in my local iis to be a reverse proxy to the service on the test server. I set up a url rewrite rule to inspect the incoming requests based on the naming convention of the soap service url.
If I browse to the soap endpoint via a browser and httpget's everything works as planned. I get a response from the remote test server with the request originating from localhost.
When I run the test app which makes the same call except as a post with soap I get this error
exception.message: There was no endpoint listening at http://localhost/webservice/Default.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
exception.InnerException: The remote server returned an error: (404) Not Found.
my settings
and then for Proxy Type i have
use url rewrite to inspect checked
enable ssl offloading checked
and reverse proxy: set to remote.test.server

Categories