Results 1 to 7 of 7

Thread: Create a Windows Communication Foundation Client

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    470

    Create a Windows Communication Foundation Client

    Hello,

    According to http://msdn.microsoft.com/en-us/library/ms733133.aspx, I am going to use the command-line tool Service Model Metadata Utility Tool(SvcUtil.exe) with the appropriate switches to create the client code.
    At step 5 I got the error below.
    Code:
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>svcutil.exe /language:vb /out:
    generatedProxy.vb /config:app.config http://localhost:8080/ServiceSamples/servic
    e
    Microsoft (R) Service Model Metadata Tool
    [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    Attempting to download metadata from 'http://localhost:8080/ServiceSamples/servi
    ce' using WS-Metadata Exchange or DISCO.
    Microsoft (R) Service Model Metadata Tool
    [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.2152]
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    Error: Cannot obtain Metadata from http://localhost:8080/ServiceSamples/service
    
    
    If this is a Windows (R) Communication Foundation service to which you have acce
    ss, please check that you have enabled metadata publishing at the specified addr
    ess.  For help enabling metadata publishing, please refer to the MSDN documentat
    ion at http://go.microsoft.com/fwlink/?LinkId=65455.
    
    
    WS-Metadata Exchange Error
        URI: http://localhost:8080/ServiceSamples/service
    
        Metadata contains a reference that cannot be resolved: 'http://localhost:808
    0/ServiceSamples/service'.
    
        There was no endpoint listening at http://localhost:8080/ServiceSamples/serv
    ice that could accept the message. This is often caused by an incorrect address
    or SOAP action. See InnerException, if present, for more details.
    
        The remote server returned an error: (400) Bad Request.
    
    
    HTTP GET Error
        URI: http://localhost:8080/ServiceSamples/service
    
        There was an error downloading 'http://localhost:8080/ServiceSamples/service
    '.
    
        The request failed with HTTP status 400: Bad Request.
    
    If you would like more help, type "svcutil /?"
    
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin>
    Thanks for your help.

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Create a Windows Communication Foundation Client

    I hope you have read my post in your last thread because I suspect it is the same cause here - your WCF server program needs to be running when you try to do this.

    PS its easier to use the "Add Service Reference" option in Visual Studio instead of using svcutil - does the exact same thing.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    470

    Re: Create a Windows Communication Foundation Client

    Could you look at here?
    I posted it there and got some answers but having not found the final solution.
    http://social.msdn.microsoft.com/For...-cc3812109306/

  4. #4
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: Create a Windows Communication Foundation Client

    How is the config file of your service?
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  5. #5
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Create a Windows Communication Foundation Client

    I dont think he is using a config file, just hosting it via the ServiceHost class. Or at least he was in a previous thread..
    Last edited by chris128; Jul 24th, 2009 at 12:37 PM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    470

    Re: Create a Windows Communication Foundation Client

    The configuration file(Client.exe.config)

    HTML Code:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_ICalculator" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                        allowCookies="false">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="Message">
                            <transport clientCredentialType="Windows" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                                algorithmSuite="Default" establishSecurityContext="true" />
                        </security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8080/ServiceModelSamples/Service/CalculatorService"
                    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ICalculator"
                    contract="ICalculator" name="WSHttpBinding_ICalculator">
                    <identity>
                        <userPrincipalName value="HZHAO\hz" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Create a Windows Communication Foundation Client

    Looks like, from the thread, that it was a case of not running the service. Add resolved to the thread title.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width