Calling wsHttpBinding service under IIS

G

Guest

Hello,

I am attempting to call a single WCF wsHttpBinding service under IIS from
two seperate Web Sites on the same server. Unfortunately, it appears that
only one can communicate to the WCF service at a time returning
"WSHttpBinding_IMyService Error: The communication object,
System.ServiceModel.Channels.ServiceChannel, cannot be used for communication
because it is in the Faulted state." I suspect that it is because IIS is, by
default, using the same IP address for both Web Sites while being a client
calling the service, even though this server has multiple IP addresses,
because I can call the server from two different Web Sites if they are on
different computers.

Is there a way to explicitly set the client IP address to use within the
web.config file (under <system.serviceModel> section)?


Much thanks,
Michael
 
S

Steven Cheng[MSFT]

Hello Michael,

From your description, you're encountering some connection issue when try
consuming a IIS hosted WCF wshttpbinding service from two asp.net WEB
applications on the same server in IIS, correct?

As for this problem, I would suggest you try further tracking down the
issue scenario since I also haven't met the same problem before(running all
the WCF client service on the same machine and all hosted in LOCAL IIS).
You can test the following cases:

** a very simple WCF service (maybe hello world one) and test the same
behavior

** try using other binding like basicHttpbinding or netTCPBinding to see
whether the same problem occur.

In addition, how do you currently specify your WCF service's base address,
are you using "localhost" or your machine's DNS or Netbios name? If you're
using "localhost", I suggest you try changing it to the DNS/netbios name to
see whether it helps.

If you get any other finding, please also feel free to let me know and I
can help you perform some local tests.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.

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


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

Steven Cheng[MSFT]

Hi Michael,

I've just performed some further research and here is the new result I got:

I tested the scenario on my local machine(windows Vista/IIS7/VS2005+WCF
extension), the test steps are as below:

** create the WCF service and hosted it in IIS default site(wshttpbinding)

** create a class library project which add service referene against the
WCF service so as to generate the proxy

**create two separate ASP.NET web sites in the same solution and both of
them are hosted in localhost (iis default site)

** reference the class library project(in step2) and use the generated
proxy to call the WCF service in both the two ASP.NET applications

It seems both of the two ASP.NET application can call the wcf method and
get the result correctly. Therefore, I'm wondering the problem should be a
bit more specific either to the application service code or the host
environment. How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


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

Steven Cheng[MSFT]

Hi Michael,

How are you doing? Have you got any progress on this issue? If there is
anything else we can help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


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

Shweta Patel

Hi Steven,

I have created a WCF service and exposed it though a svc file. When I
call this service with a ASP.Net client (Add Service Reference) , there
is no problem. When I call this service as it was a Web Service (Add Web
Reference) I get an exception "Operation has timed out".

Can you please help me?

Thanks & Regards
Shweta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top