RE: HttpChannel in WCF



{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Scott,
\par
\par From your description ,I understand you want to convert a .NET remoting service to WCF hosted. However, you met some problems on converting a singleton SAO since it uses dynamically assigned listening port, so you're wondering how to do this in WCF, correct?
\par
\par If your main concern is dynamically configuring service port. I think you can consider do the ServceHost creation programmatically. Thus, you can use code to specify the baseAddress or subaddress for each endpoint of the service.
\par
\par I've found two web articles which provide some sample code on creating WCF service host programmtically. They also include the code that supplyl the service's address(include port)
\par #Adding a WCF MetaData EndPoint programmatically
\par http://www.west-wind.com/WebLog/posts/9323.aspx
\par
\par #Creating WCF Service Host Programmatically
\par http://geekswithblogs.net/hinshelm/archive/2007/05/30/Creating-WCF-Service-Host-Programmatically.aspx
\par
\par Hope this helps some.
\par
\par Sincerely,
\par
\par Steven Cheng
\par
\par Microsoft MSDN Online Support Lead
\par
\par
\par
\par ==================================================
\par
\par Get notification to my posts through email? Please refer to
\par http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
\par ications.
\par
\par
\par
\par Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
\par where an initial response from the community or a Microsoft Support
\par Engineer within 1 business day is acceptable. Please note that each follow
\par up response may take approximately 2 business days as the support
\par professional working with you may need further investigation to reach the
\par most efficient resolution. The offering is not appropriate for situations
\par that require urgent, real-time or phone-based interactions or complex
\par project analysis and dump analysis issues. Issues of this nature are best
\par handled working with a dedicated Microsoft Support Engineer by contacting
\par Microsoft Customer Support Services (CSS) at
\par http://msdn.microsoft.com/subscriptions/support/default.aspx.
\par
\par ==================================================
\par \tab
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par
\par \pard\li720 --------------------
\par From: =?Utf-8?B?U2NvdHQ=?= <snorberg@xxxxxxxxxxxxxxxxx>
\par Subject: HttpChannel in WCF
\par Date: Fri, 11 Jan 2008 06:27:00 -0800
\par
\par I have a small program that exposes an interface via soap as follows:
\par
\par HttpChannel ipc = new HttpChannel( nPort );
\par ChannelServices.RegisterChannel( ipc, false );
\par RemotingConfiguration.RegisterWellKnownServiceType(
\par typeof(WsdlClient.CJLResponse), "JLSoapResponse.rem",
\par WellKnownObjectMode.Singleton );
\par
\par This works fine. Note that the port the program is listening on varies. This
\par allows for multiple instances of the program to run concurrently.
\par
\par I want to convert this to its WCF equivalent.
\par
\par I am current using the following configuration which works for a single
\par instance but not for multiple.
\par
\par <system.serviceModel>
\par <services>
\par <service name="WsdlClient.CJLResponse"
\par behaviorConfiguration="SoapRspService">
\par <host>
\par <baseAddresses>
\par <add baseAddress="http://xx.xx.xx.xx:5300/JLSoapResponse.wcf"/>
\par </baseAddresses>
\par </host>
\par <endpoint address=""
\par \tab\tab\tab\tab\tab binding="basicHttpBinding" bindingConfiguration="SoapRspBindingBasicHttp"
\par \tab\tab\tab\tab\tab\tab contract="JLSoapCommon.IJLSoapResponse" />
\par </service>
\par </services>
\par <bindings>
\par <basicHttpBinding>
\par <binding name="SoapRspBindingBasicHttp"
\par maxReceivedMessageSize="65536">
\par <readerQuotas maxStringContentLength="65536"/>
\par <security mode="None">
\par <transport clientCredentialType="None" />
\par </security>
\par </binding>
\par </basicHttpBinding>
\par </bindings>
\par <behaviors>
\par <serviceBehaviors>
\par <behavior name="SoapRspService">
\par <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
\par <serviceDebug includeExceptionDetailInFaults="true" />
\par </behavior>
\par </serviceBehaviors>
\par </behaviors>
\par <diagnostics>
\par <messageLogging logEntireMessage="true"
\par \tab\tab\tab\tab logMalformedMessages="true"
\par \tab\tab\tab\tab logMessagesAtServiceLevel="true"
\par \tab\tab\tab\tab logMessagesAtTransportLevel="true"
\par \tab\tab\tab\tab maxMessagesToLog="100">
\par </messageLogging>
\par </diagnostics>
\par </system.serviceModel>
\par
\par --
\par Scott
\par \pard
\par
\par }

Relevant Pages

  • Re: How to set port # for internal web browser?
    ... Do you mean how to explicit spedific the port number of the Asp.net2.0 ... Re-select the Web Site node in "Solution Explorer" window to update the ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)
  • RE: How to set port # for internal web browser?
    ... Do you mean how to explicit spedific the port number of the Asp.net2.0 ... Re-select the Web Site node in "Solution Explorer" window to update the ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.debugging)
  • RE: BamEndtoEnd sample sdk
    ... "DocumentID" node on the LHS of the Tracking Profile Editor. ... specify the port in the dialog box that pops up. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.biztalk.general)
  • Re: RoleProvider for AD Group membership
    ... The server name and the port are optional. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Reference count issue with uart_close() on 2.6.16-2.6.20
    ... After that the serial port is no longer usable no matter what. ... Please find my kernel config and dmesg output below. ... # ACPI Support ... # PCI Hotplug Support ...
    (Linux-Kernel)

Loading