473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HttpChannel in WCF

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

HttpChannel ipc = new HttpChannel( nPort );
ChannelServices.RegisterChannel( ipc, false );
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(WsdlClient.CJLResponse), "JLSoapResponse.rem",
WellKnownObjectMode.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.serviceModel>
<services>
<service name="WsdlClient.CJLResponse"
behaviorConfiguration="SoapRspService">
<host>
<baseAddresses>
<add baseAddress="http://xx.xx.xx.xx:5300/JLSoapResponse.wcf"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding" bindingConfiguration="SoapRspBindingBasicHttp"
contract="JLSoapCommon.IJLSoapResponse" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="SoapRspBindingBasicHttp"
maxReceivedMessageSize="65536">
<readerQuotas maxStringContentLength="65536"/>
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SoapRspService">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<diagnostics>
<messageLogging logEntireMessage="true"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
maxMessagesToLog="100">
</messageLogging>
</diagnostics>
</system.serviceModel>

--
Scott
Jan 11 '08 #1
3 2432
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 programmatically. 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 programmatically
http://www.west-wind.com/WebLog/posts/9323.aspx

#Creating WCF Service Host Programmatically
http://geekswithblogs.net/hinshelm/a...-WCF-Service-H
ost-Programmatically.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=?= <sn******@newsgroups.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.RegisterChannel( ipc, false );
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(WsdlClient.CJLResponse), "JLSoapResponse.rem",
WellKnownObjectMode.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.serviceModel>
<services>
<service name="WsdlClient.CJLResponse"
behaviorConfiguration="SoapRspService">
<host>
<baseAddresses>
<add baseAddress="http://xx.xx.xx.xx:5300/JLSoapResponse.wcf"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="SoapRspBindingBasicHttp"
contract="JLSoapCommon.IJLSoapResponse" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="SoapRspBindingBasicHttp"
maxReceivedMessageSize="65536">
<readerQuotas maxStringContentLength="65536"/>
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SoapRspService">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<diagnostics>
<messageLogging logEntireMessage="true"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
maxMessagesToLog="100">
</messageLogging>
</diagnostics>
</system.serviceModel>

--
Scott

Jan 14 '08 #2
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 programmatically. 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 programmatically
http://www.west-wind.com/WebLog/posts/9323.aspx

#Creating WCF Service Host Programmatically
http://geekswithblogs.net/hinshelm/a...-WCF-Service-H
ost-Programmatically.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=?= <sn******@newsgroups.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.RegisterChannel( ipc, false );
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(WsdlClient.CJLResponse), "JLSoapResponse.rem",
WellKnownObjectMode.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.serviceModel>
<services>
<service name="WsdlClient.CJLResponse"
behaviorConfiguration="SoapRspService">
<host>
<baseAddresses>
<add baseAddress="http://xx.xx.xx.xx:5300/JLSoapResponse.wcf"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="SoapRspBindingBasicHttp"
contract="JLSoapCommon.IJLSoapResponse" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="SoapRspBindingBasicHttp"
maxReceivedMessageSize="65536">
<readerQuotas maxStringContentLength="65536"/>
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SoapRspService">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<diagnostics>
<messageLogging logEntireMessage="true"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
maxMessagesToLog="100">
</messageLogging>
</diagnostics>
</system.serviceModel>

--
Scott
Jan 14 '08 #3
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=?= <sn******@newsgroups.nospam>
References: <3A**********************************@microsoft.co m>
<qr**************@TK2MSFTNGHUB02.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 programmatically. 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 programmatically
http://www.west-wind.com/WebLog/posts/9323.aspx

#Creating WCF Service Host Programmatically
http://geekswithblogs.net/hinshelm/a...-WCF-Service-H
ost-Programmatically.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=?= <sn******@newsgroups.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.RegisterChannel( ipc, false );
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(WsdlClient.CJLResponse), "JLSoapResponse.rem",
WellKnownObjectMode.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.serviceModel>
<services>
<service name="WsdlClient.CJLResponse"
behaviorConfiguration="SoapRspService">
<host>
<baseAddresses>
<add
baseAddress="http://xx.xx.xx.xx:5300/JLSoapResponse.wcf"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="SoapRspBindingBasicHttp"
contract="JLSoapCommon.IJLSoapResponse" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="SoapRspBindingBasicHttp"
maxReceivedMessageSize="65536">
<readerQuotas maxStringContentLength="65536"/>
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SoapRspService">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"
/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<diagnostics>
<messageLogging logEntireMessage="true"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true"
maxMessagesToLog="100">
</messageLogging>
</diagnostics>
</system.serviceModel>

--
Scott
Jan 15 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David | last post by:
What is the namespace of HttpChannel type in VS.NET 2003? I'm using System.Runtime.Remoting.Channels.Http, but there is error while compiling. Error Message: "The type or namespace name 'http'...
4
by: Christian Westerlund | last post by:
Hi! Does anyone know if it is possible for a client server communication easy in .NET with these requirements: The client always initiates the communication The server only answers (responds)...
4
by: Tom | last post by:
what is the difference between HttpChannel() and HttpServerChannel() both can act like a server or client so I'm a little confused as HttpChannel(8000) is pretty much the same as...
1
by: Dan | last post by:
I posted the following on the remoting board, but it doesn't look like there is a lot of traffic there. Maybe someone has an idea of what I should try here. That is if everyone's full attention...
1
by: teddy | last post by:
Hello! I have HttpChannel (client server) and I want to authenticate users (username and password, specified not by system, but myself). Can you help me please? Thanks a lot My connection codes:...
4
by: marcelino | last post by:
Hi, I have c# express beta I try to write the following using clause: System.Runtime.Remoting.Channels.Http; because I want to create a http channel. HttpChannel aJobChannel = new...
3
by: Fredric Ragnar | last post by:
Hi, I am making a prototype system with Remoting in the bottom of the system. An XML Web Service is using the remote object on an IIS to present data. I am using a TcpChannel for communicating...
3
by: archana | last post by:
Hi all, I am confuse at selecting httpchannel and tcpchannel. I read on MSDN that ' HttpChannel is a good channel to start with because in some scenarios it can be used through firewalls without...
3
by: Ashutosh | last post by:
Hi, Facing issue with HttpChannel....I have always used TcpChannel...using it for the first time.. This code works fine for TcpChannel but gives exception when using HttpChannel on calling the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.