Test REST WCF Endpoints - wcf

This is a different question than my previous post on testing WCF.
This time after I've created my service, I want to test it not via WSDL, but I want to send an ajax request using $.ajax via jQuery.
I'm not sure how to wire up the service so that it's ready to recieve requests. Do I need the service setup and running in IIS? Or is there a way I can run the WCF project to run the service and then somehow in my NUnit Unit test create the jquery to make an HttpRequest..meaning would it know that the service is up and running? how?

You can host your service in the IIS, As a windows service or in a console app. To me it sounds wrong to call the service in a Unit test. Normally you mock out all external dependencies in a Unit test.

Related

Calling WCF service method from browser?

Since i am new to WCF and Having configured a WCF service endpoint in IIS at Virtual Directory Api ( url goes like
http://localhost/api/taskapi.svc)
i was looking for ways to make request through web browser something like
http://localhost/api/taskapi.svc/GetCompleted
would respond with returnd data .I know this requires the binding of web service with the webHttpBinding but i don't know how to do it any help would be great ?
Use WCFSVGHoST application to test WCF applications. Application enables you to key-in parameters value and execute method of your interest.
Link for the same:
http://msdn.microsoft.com/en-us/library/bb552363.aspx

Consuming WCF Restful Service hosted by IIS

I have successfully deployed my WCF restful web service to IIS 7. I have verified that my service is working when I call it from a browser in IE via a something like "https://myserver/mservice.svc/postuser/JohnSmith" . The method is a POST and I have verified that my IIS configuration allows for POSTS.
My issue is as follows. We are using a 3rd party Software as a Service application that allows for external web service calls. It allows you to configure the URL "https://myserver/mservice.svc/postuser/" and then you can choose a parameter. When I call the web service from the external application, a 404 error is registered in IIS.
I think there must be some difference between the way I call my webservice "https://myserver/mservice.svc/postuser/JohnSmith" and the way the SAAS application is calling my external web service. The web service is attempting to pass the username, but I cannot detect how it is constructing this.
Do I need to write a web enabled front end for my web service that is hosted in IIS that can handle XML? I'm assuming this is how the SAAS application is trying to pass the username onto my web service.
Thank you all in advance for your ideas and help.

How to call local WCF service from webpage?

I'm developing a webpage that is supposed to consume WCF webserice that is located on client's computer. First, user installs some software that hosts WCF service on his computer, then he'll view my webpage which is supposed to call the WCF service. Do you have any idea how to do it without having to use AtiveX and IE?
Add your wcf service as service reference to your web project. You have to specify the url of your wcf service. A clientproxyclass will be generated for you. In your webpages or whathever you can create a instance of this proxyclass and just code what you want.

programmatically call a web service from a test application

I am writing an test application to do a load test on my existing WCF service.
There can be numerous clients calling the WCF service.
How do I write code to generate several clients calling the WCF service.
Any lead or forum or blog will immensely help.
Thanks
I have not used it myself, but the WCF Load Test might do the trick.
You can load test web service using SOAP UI. Free Version is here

WCF MSMQ Unit testing

I have created a custom msmq service with WCF, which uses a custom binding as it needs to do some custom logic at the channel layer, where it calls another wcf service. The service is going to be a core pience of functionality for our systems for at the the next few years. i want to do what I can to make sure the service is robust, but, i'm not sure where to start. Ie testing the response, should I create a mock queue object? how do I test the service is calling another service ?
Best way I have found to unit test msmq services is to actually unit test the service implementation, then do an integration test using msmq with a mock repository. To see if writes are working.