Note that there are some explanatory texts on larger screens.

plurals
  1. POExposing WCF Services Via HTTP when not hosted in IIS
    text
    copied!<p>Like the title says, we need to set up WCF services between a .NET app, and a Adobe AIR app. We don't want to run IIS on the machine, and would much prefer to install and run the WCF services hosted within a windows service.</p> <p>However, I am uncertain of doing that will let us use HTTP as the transport, of does that only work within IIS? I was able to set things up to use the TCP transport, but that doesn't interop with AIR nearly as nice as using HTTP.</p> <p>EDIT: Some test code I've been using to see if this works:</p> <p>Regular console app:</p> <pre><code> static void Main() { using (ServiceHost host = new ServiceHost(typeof(TestService))) { host.Open(); } Console.WriteLine("Waiting..."); Console.ReadLine(); } </code></pre> <p>TestService is a simple HelloWorld type service.</p> <p>In the App.Config:</p> <pre><code>&lt;configuration&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="WCFExample2.TestService" behaviorConfiguration="WCFExample2.TestServiceBehavior"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress = "http://localhost:8731/Design_Time_Addresses/WCFExample2/Service1/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;!-- Service Endpoints --&gt; &lt;!-- Unless fully qualified, address is relative to base address supplied above --&gt; &lt;endpoint address ="" binding="wsHttpBinding" contract="WCFExample2.ITestService"&gt; &lt;!-- Upon deployment, the following identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically. --&gt; &lt;identity&gt; &lt;dns value="localhost"/&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;!-- Metadata Endpoints --&gt; &lt;!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --&gt; &lt;!-- This endpoint does not use a secure binding and should be secured or removed before deployment --&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="WCFExample2.TestServiceBehavior"&gt; &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt; &lt;serviceMetadata httpGetEnabled="True"/&gt; &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --&gt; &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt; &lt;/configuration&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload