Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / January 2007

Tip: Looking for answers? Try searching our database.

Timeout when using VS 2005-generated proxies to access WCF web ser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
smithkl42 - 30 Jan 2007 22:13 GMT
I'm just now beginning to experiment with WCF, and I've run into an odd
hiccup right at the beginning.  I presume it's just something I'm doing
wrong, but I can't figure it out.

I've created a simple "Hello World" service, hosted in a console app, and if
I call that service via a ChannelFactory<> generated proxy, life is good:

using (ChannelFactory<IHelloWorld> helloFactory = new
ChannelFactory<IHelloWorld>("MyClient"))
{
 HelloInterface.IHelloWorld proxy = helloFactory.CreateChannel();
 Console.WriteLine(proxy.SayHello());
 Console.ReadLine();
}

However, if I reference the web service in VS 2005, allow it to generate the
proxies for me, and then call the method, it hangs on the method call until
it times out:

helloworld.HelloWorld hello = new helloworld.HelloWorld();
Console.WriteLine(hello.SayHello()) // Here is where it hangs.
Console.ReadLine();

I believe that I've got my config file setup correctly, since if the service
isn't running, or is listening on a different endpoint, or with a different
encoding, it throws an exception immediately, instead of timing out.  Still,
just for the record, here's my server config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <services>
            <service name="HelloService.HelloWorld"
behaviorConfiguration="metadataSupport">
                <endpoint address="" binding="wsHttpBinding"
contract="HelloInterface.IHelloWorld" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:8080/helloworld" />
                    </baseAddresses>
                </host>
            </service>
        </services>

        <behaviors>
            <serviceBehaviors>
                <behavior name="metadataSupport">
                    <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
                </behavior>
            </serviceBehaviors>
        </behaviors>

    </system.serviceModel>
</configuration>

And here's my client config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <configSections>
       <sectionGroup name="applicationSettings"
type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" >
           <section name="HelloClient.Properties.Settings"
type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
       </sectionGroup>
   </configSections>

    <system.serviceModel>
        <client>
            <endpoint address="http://localhost:8080/helloworld"
binding="wsHttpBinding" contract="HelloInterface.IHelloWorld" name="MyClient"
/>
        </client>
    </system.serviceModel>

    <applicationSettings>
       <HelloClient.Properties.Settings>
           <setting name="HelloClient_helloworld_HelloWorld"
serializeAs="String">
               <value>http://localhost:8080/helloworld</value>
           </setting>
       </HelloClient.Properties.Settings>
   </applicationSettings>
</configuration>

Any thoughts on what I'm running into?  I'm sure it's a basic mistake, but
danged if I know what it is.

Ken
Mariano Omar Rodriguez - 30 Jan 2007 23:25 GMT
You need to use Add Service Reference or generate the proxy with svcutil,
the standard Web Services don't interoperate with WCF by default (You need
put specific configuration).

http://msdn2.microsoft.com/en-us/library/ms735103.aspx
http://msdn2.microsoft.com/en-us/library/ms751433.aspx
http://www.microsoft.com/downloads/details.aspx?familyid=F54F5537-CC86-4BF5-AE44
-F5A1E805680D&displaylang=en


> I'm just now beginning to experiment with WCF, and I've run into an odd
> hiccup right at the beginning.  I presume it's just something I'm doing
[quoted text clipped - 96 lines]
>
> Ken
smithkl42 - 31 Jan 2007 01:38 GMT
Thank you -- that fixed it.  Nice to know it was just a rookie mistake.

Ken

> You need to use Add Service Reference or generate the proxy with svcutil,
> the standard Web Services don't interoperate with WCF by default (You need
[quoted text clipped - 104 lines]
> >
> > Ken

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.