I have a WCF service that will be called from a HTML form located in the customer’s network.
When the same form is posting the exact same data to an ASP page it expects a response like:
Response.Write “SUCCESS” & vbnewline
How can I send the same response from my WCF service?
Thanks.
A WCF service can return any type of data, really. That covers basic primitive types like
intorstring, but you can also create more advanced composite types (classes) and send them back.HOWEVER: WCF is not designed to return HTML markup – that would be the totally wrong approach to things. WCF is a service – a service provides some functionality, you send in some data/parameters, you get back some data/output types.
WCF should not and must not ever be concerned with the actual representation of that data on the user’s end – that’s the job of your user interface – the ASP page or whatever you’re dealing with.
So you could have a WCF service like this:
and then call that from your client code something like this:
but you should not ever write a WCF service that returns HTML markup or any other system-specific information.
And since WCF is a message-based system, the WCF service has absolutely no connection to your ASP page – it cannot participate in the ASP lifecycle or access the “Response” object or anything like that.