Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Describe the situation:

I have a certain wcf service published in IIS7.

There is a point in my workflow in which I generate a page(.Aspx) dynamically in which, when the user enter and confirm, the service is consumed.

The problem is basically that I dont know how to do it, I have a page from which you have to consume wcf service, but that page does not belong to any Visual Studio solution, simply is hosted in IIS on the same directory as my website , which is in the solution(the website).

I can not make a service reference to the service, or I couldnt do it, then I cant use for example: "Using myService;" in my page.

Any suggestions? Is a way to consume de wcf service without adding the service reference?
Thank you!
Posted

You can't call SOAP based WCF service this way. However you may call REST service from your aspx page which does not require any Service Reference.

REST service can be called by using JQuery-Ajax.

Have a look at below link.
http://pranayamr.blogspot.com/2011/03/rest.html
 
Share this answer
 
If the page (on the client side) is calling the service then you need client code - that means probably javascript (AJAX). Search on "wcf call from javascript" and there's many examples, like this one: Calling a WCF service from Javascript[^].

*Edit* Not sure how the service is implemented, but using jQuery could work for you as well. For example... Consuming WCF REST Services Using jQuery AJAX Calls[^]
 
Share this answer
 
v3
Comments
Gastonp_103 19-Nov-11 12:29pm    
Thanks, but in that example I need to add a reference to a proyect(step 5).
In my case I have an isolated .aspx page hosted in IIS, and the page doesnt below to any vs solution. And I need to consume de wcf service from that page..
Any suggestion?
Mark Salsbery 19-Nov-11 13:03pm    
That was just one example, and the reference in step 5 is to the service library - code you already have. You just need to call the existing service (steps 10-11 at the link) from a page, right?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900