HttpChannel in WCF

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?U2NvdHQ=?=

    #1

    HttpChannel in WCF

    I have a small program that exposes an interface via soap as follows:

    HttpChannel ipc = new HttpChannel( nPort );
    ChannelServices .RegisterChanne l( ipc, false );
    RemotingConfigu ration.Register WellKnownServic eType(
    typeof(WsdlClie nt.CJLResponse) , "JLSoapResponse .rem",
    WellKnownObject Mode.Singleton );

    This works fine. Note that the port the program is listening on varies. This
    allows for multiple instances of the program to run concurrently.

    I want to convert this to its WCF equivalent.

    I am current using the following configuration which works for a single
    instance but not for multiple.

    <system.service Model>
    <services>
    <service name="WsdlClien t.CJLResponse"
    behaviorConfigu ration="SoapRsp Service">
    <host>
    <baseAddresse s>
    <add baseAddress="ht tp://xx.xx.xx.xx:530 0/JLSoapResponse. wcf"/>
    </baseAddresses>
    </host>
    <endpoint address=""
    binding="basicH ttpBinding" bindingConfigur ation="SoapRspB indingBasicHttp "
    contract="JLSoa pCommon.IJLSoap Response" />
    </service>
    </services>
    <bindings>
    <basicHttpBindi ng>
    <binding name="SoapRspBi ndingBasicHttp"
    maxReceivedMess ageSize="65536" >
    <readerQuotas maxStringConten tLength="65536"/>
    <security mode="None">
    <transport clientCredentia lType="None" />
    </security>
    </binding>
    </basicHttpBindin g>
    </bindings>
    <behaviors>
    <serviceBehavio rs>
    <behavior name="SoapRspSe rvice">
    <serviceMetadat a httpGetEnabled= "true" httpsGetEnabled ="false" />
    <serviceDebug includeExceptio nDetailInFaults ="true" />
    </behavior>
    </serviceBehavior s>
    </behaviors>
    <diagnostics>
    <messageLoggi ng logEntireMessag e="true"
    logMalformedMes sages="true"
    logMessagesAtSe rviceLevel="tru e"
    logMessagesAtTr ansportLevel="t rue"
    maxMessagesToLo g="100">
    </messageLogging>
    </diagnostics>
    </system.serviceM odel>

    --
    Scott
  • Steven Cheng[MSFT]

    #2
    RE: HttpChannel in WCF

    Hi Scott,

    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?

    If your main concern is dynamically configuring service port. I think you
    can consider do the ServceHost creation programmaticall y. Thus, you can use
    code to specify the baseAddress or subaddress for each endpoint of the
    service.

    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)
    #Adding a WCF MetaData EndPoint programmaticall y


    #Creating WCF Service Host Programmaticall y
    Geeks with Blogs — developer blogs and technical articles from the community.

    ost-Programmaticall y.aspx

    Hope this helps some.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    =============== =============== =============== =====

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscripti...ult.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscripti...t/default.aspx.

    =============== =============== =============== =====


    This posting is provided "AS IS" with no warranties, and confers no rights.




    --------------------
    From: =?Utf-8?B?U2NvdHQ=?= <snorberg@newsg roups.nospam>
    Subject: HttpChannel in WCF
    Date: Fri, 11 Jan 2008 06:27:00 -0800

    I have a small program that exposes an interface via soap as follows:

    HttpChannel ipc = new HttpChannel( nPort );
    ChannelServices .RegisterChanne l( ipc, false );
    RemotingConfigu ration.Register WellKnownServic eType(
    typeof(WsdlClie nt.CJLResponse) , "JLSoapResponse .rem",
    WellKnownObject Mode.Singleton );

    This works fine. Note that the port the program is listening on varies.
    This
    allows for multiple instances of the program to run concurrently.

    I want to convert this to its WCF equivalent.

    I am current using the following configuration which works for a single
    instance but not for multiple.

    <system.service Model>
    <services>
    <service name="WsdlClien t.CJLResponse"
    behaviorConfigu ration="SoapRsp Service">
    <host>
    <baseAddresse s>
    <add baseAddress="ht tp://xx.xx.xx.xx:530 0/JLSoapResponse. wcf"/>
    </baseAddresses>
    </host>
    <endpoint address=""
    binding="basicH ttpBinding"
    bindingConfigur ation="SoapRspB indingBasicHttp "
    contract="JLSoa pCommon.IJLSoap Response" />
    </service>
    </services>
    <bindings>
    <basicHttpBindi ng>
    <binding name="SoapRspBi ndingBasicHttp"
    maxReceivedMess ageSize="65536" >
    <readerQuotas maxStringConten tLength="65536"/>
    <security mode="None">
    <transport clientCredentia lType="None" />
    </security>
    </binding>
    </basicHttpBindin g>
    </bindings>
    <behaviors>
    <serviceBehavio rs>
    <behavior name="SoapRspSe rvice">
    <serviceMetadat a httpGetEnabled= "true" httpsGetEnabled ="false" />
    <serviceDebug includeExceptio nDetailInFaults ="true" />
    </behavior>
    </serviceBehavior s>
    </behaviors>
    <diagnostics>
    <messageLoggi ng logEntireMessag e="true"
    logMalformedMes sages="true"
    logMessagesAtSe rviceLevel="tru e"
    logMessagesAtTr ansportLevel="t rue"
    maxMessagesToLo g="100">
    </messageLogging>
    </diagnostics>
    </system.serviceM odel>

    --
    Scott

    Comment

    • =?Utf-8?B?U2NvdHQ=?=

      #3
      RE: HttpChannel in WCF

      Steven,

      This turned out to be not such as easy question. The links you gave where
      helpful and I ended up purchasing a book or two on the topic that had several
      other examples.

      Thanks!
      --
      Scott Norberg


      "Steven Cheng[MSFT]" wrote:
      Hi Scott,
      >
      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?
      >
      If your main concern is dynamically configuring service port. I think you
      can consider do the ServceHost creation programmaticall y. Thus, you can use
      code to specify the baseAddress or subaddress for each endpoint of the
      service.
      >
      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)
      #Adding a WCF MetaData EndPoint programmaticall y

      >
      #Creating WCF Service Host Programmaticall y
      Geeks with Blogs — developer blogs and technical articles from the community.

      ost-Programmaticall y.aspx
      >
      Hope this helps some.
      >
      Sincerely,
      >
      Steven Cheng
      >
      Microsoft MSDN Online Support Lead
      >
      >
      >
      =============== =============== =============== =====
      >
      Get notification to my posts through email? Please refer to
      http://msdn.microsoft.com/subscripti...ult.aspx#notif
      ications.
      >
      >
      >
      Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
      where an initial response from the community or a Microsoft Support
      Engineer within 1 business day is acceptable. Please note that each follow
      up response may take approximately 2 business days as the support
      professional working with you may need further investigation to reach the
      most efficient resolution. The offering is not appropriate for situations
      that require urgent, real-time or phone-based interactions or complex
      project analysis and dump analysis issues. Issues of this nature are best
      handled working with a dedicated Microsoft Support Engineer by contacting
      Microsoft Customer Support Services (CSS) at
      http://msdn.microsoft.com/subscripti...t/default.aspx.
      >
      =============== =============== =============== =====
      >
      >
      This posting is provided "AS IS" with no warranties, and confers no rights.
      >
      >
      >
      >
      --------------------
      From: =?Utf-8?B?U2NvdHQ=?= <snorberg@newsg roups.nospam>
      Subject: HttpChannel in WCF
      Date: Fri, 11 Jan 2008 06:27:00 -0800
      >
      I have a small program that exposes an interface via soap as follows:
      >
      HttpChannel ipc = new HttpChannel( nPort );
      ChannelServices .RegisterChanne l( ipc, false );
      RemotingConfigu ration.Register WellKnownServic eType(
      typeof(WsdlClie nt.CJLResponse) , "JLSoapResponse .rem",
      WellKnownObject Mode.Singleton );
      >
      This works fine. Note that the port the program is listening on varies.
      This
      allows for multiple instances of the program to run concurrently.
      >
      I want to convert this to its WCF equivalent.
      >
      I am current using the following configuration which works for a single
      instance but not for multiple.
      >
      <system.service Model>
      <services>
      <service name="WsdlClien t.CJLResponse"
      behaviorConfigu ration="SoapRsp Service">
      <host>
      <baseAddresse s>
      <add baseAddress="ht tp://xx.xx.xx.xx:530 0/JLSoapResponse. wcf"/>
      </baseAddresses>
      </host>
      <endpoint address=""
      binding="basicH ttpBinding"
      bindingConfigur ation="SoapRspB indingBasicHttp "
      contract="JLSoa pCommon.IJLSoap Response" />
      </service>
      </services>
      <bindings>
      <basicHttpBindi ng>
      <binding name="SoapRspBi ndingBasicHttp"
      maxReceivedMess ageSize="65536" >
      <readerQuotas maxStringConten tLength="65536"/>
      <security mode="None">
      <transport clientCredentia lType="None" />
      </security>
      </binding>
      </basicHttpBindin g>
      </bindings>
      <behaviors>
      <serviceBehavio rs>
      <behavior name="SoapRspSe rvice">
      <serviceMetadat a httpGetEnabled= "true" httpsGetEnabled ="false" />
      <serviceDebug includeExceptio nDetailInFaults ="true" />
      </behavior>
      </serviceBehavior s>
      </behaviors>
      <diagnostics>
      <messageLoggi ng logEntireMessag e="true"
      logMalformedMes sages="true"
      logMessagesAtSe rviceLevel="tru e"
      logMessagesAtTr ansportLevel="t rue"
      maxMessagesToLo g="100">
      </messageLogging>
      </diagnostics>
      </system.serviceM odel>
      >
      --
      Scott
      >

      Comment

      • Steven Cheng[MSFT]

        #4
        RE: HttpChannel in WCF

        Thanks for your reply Scott,

        If you meet any further problem need help, welcome to post here.

        Sincerely,

        Steven Cheng

        Microsoft MSDN Online Support Lead


        This posting is provided "AS IS" with no warranties, and confers no rights.

        --------------------
        From: =?Utf-8?B?U2NvdHQ=?= <snorberg@newsg roups.nospam>
        References: <3A5117F8-E8C3-4512-BAD5-12D510D1F3FE@mi crosoft.com>
        <qrz8fxlVIHA.42 00@TK2MSFTNGHUB 02.phx.gbl>
        Subject: RE: HttpChannel in WCF
        Date: Mon, 14 Jan 2008 07:52:02 -0800


        Steven,

        This turned out to be not such as easy question. The links you gave where
        helpful and I ended up purchasing a book or two on the topic that had
        several
        other examples.

        Thanks!
        --
        Scott Norberg


        "Steven Cheng[MSFT]" wrote:
        Hi Scott,
        >
        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?
        >
        If your main concern is dynamically configuring service port. I think you
        can consider do the ServceHost creation programmaticall y. Thus, you can
        use
        code to specify the baseAddress or subaddress for each endpoint of the
        service.
        >
        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)
        #Adding a WCF MetaData EndPoint programmaticall y

        >
        #Creating WCF Service Host Programmaticall y
        >
        http://geekswithblogs.net/hinshelm/a...-WCF-Service-H
        ost-Programmaticall y.aspx
        >
        Hope this helps some.
        >
        Sincerely,
        >
        Steven Cheng
        >
        Microsoft MSDN Online Support Lead
        >
        >
        >
        =============== =============== =============== =====
        >
        Get notification to my posts through email? Please refer to
        >
        http://msdn.microsoft.com/subscripti...ult.aspx#notif
        ications.
        >
        >
        >
        Note: The MSDN Managed Newsgroup support offering is for non-urgent
        issues
        where an initial response from the community or a Microsoft Support
        Engineer within 1 business day is acceptable. Please note that each
        follow
        up response may take approximately 2 business days as the support
        professional working with you may need further investigation to reach the
        most efficient resolution. The offering is not appropriate for situations
        that require urgent, real-time or phone-based interactions or complex
        project analysis and dump analysis issues. Issues of this nature are best
        handled working with a dedicated Microsoft Support Engineer by contacting
        Microsoft Customer Support Services (CSS) at
        http://msdn.microsoft.com/subscripti...t/default.aspx.
        >
        =============== =============== =============== =====
        >
        >
        This posting is provided "AS IS" with no warranties, and confers no
        rights.
        >
        >
        >
        >
        --------------------
        From: =?Utf-8?B?U2NvdHQ=?= <snorberg@newsg roups.nospam>
        Subject: HttpChannel in WCF
        Date: Fri, 11 Jan 2008 06:27:00 -0800
        >
        I have a small program that exposes an interface via soap as follows:
        >
        HttpChannel ipc = new HttpChannel( nPort );
        ChannelServices .RegisterChanne l( ipc, false );
        RemotingConfigu ration.Register WellKnownServic eType(
        typeof(WsdlClie nt.CJLResponse) , "JLSoapResponse .rem",
        WellKnownObject Mode.Singleton );
        >
        This works fine. Note that the port the program is listening on varies.
        This
        allows for multiple instances of the program to run concurrently.
        >
        I want to convert this to its WCF equivalent.
        >
        I am current using the following configuration which works for a single
        instance but not for multiple.
        >
        <system.service Model>
        <services>
        <service name="WsdlClien t.CJLResponse"
        behaviorConfigu ration="SoapRsp Service">
        <host>
        <baseAddresse s>
        <add
        baseAddress="ht tp://xx.xx.xx.xx:530 0/JLSoapResponse. wcf"/>
        </baseAddresses>
        </host>
        <endpoint address=""
        binding="basicH ttpBinding"
        bindingConfigur ation="SoapRspB indingBasicHttp "
        contract="JLSoa pCommon.IJLSoap Response" />
        </service>
        </services>
        <bindings>
        <basicHttpBindi ng>
        <binding name="SoapRspBi ndingBasicHttp"
        maxReceivedMess ageSize="65536" >
        <readerQuotas maxStringConten tLength="65536"/>
        <security mode="None">
        <transport clientCredentia lType="None" />
        </security>
        </binding>
        </basicHttpBindin g>
        </bindings>
        <behaviors>
        <serviceBehavio rs>
        <behavior name="SoapRspSe rvice">
        <serviceMetadat a httpGetEnabled= "true" httpsGetEnabled ="false"
        />
        <serviceDebug includeExceptio nDetailInFaults ="true" />
        </behavior>
        </serviceBehavior s>
        </behaviors>
        <diagnostics>
        <messageLoggi ng logEntireMessag e="true"
        logMalformedMes sages="true"
        logMessagesAtSe rviceLevel="tru e"
        logMessagesAtTr ansportLevel="t rue"
        maxMessagesToLo g="100">
        </messageLogging>
        </diagnostics>
        </system.serviceM odel>
        >
        --
        Scott
        >

        Comment

        Working...