WCF Service HowTo. Please help

Discussion in 'Site Programming, Development and Design' started by Beka, Jun 17, 2010.

  1. Hi
    I was checking KB for suggestions but couldn't find info about this

    So i wrote a simple WCF Service Library (VS2010 .NET4). It works fine on local machine. I am connecting to it with Windows Application. It doesn't require any IIS

    Published on this FTP Address
    FTP Address: ftp://[My User]:[My Password]@ftp.onlinexc.w03.Winhost.com (As shown in site info)

    My Site's URL is: http://onlinexc.w03.Winhost.com/ (As shown in site info)

    So, now my Problem is:
    I did put this URL in my Service's app.config this way (sorry for such a large post), but my client can't connect to server:





    Pls let me know what i did wrong

    Thanks
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    Whats the error message? Do you have a URL we can look at?
     
  3. Here is error mesage:

    As seen from here, the URL is:
    http://onlinexc.w03.Winhost.com:8732/Design_Time_Addresses/LotteryServer/Service1/127.0.0.1

    P.S. To connect to service, in Client's app.config the following line:
    <endpoint address="http://localhost:8732/Design_Time_Addresses/LotteryServer/Service1/127.0.0.1"

    Replaced with:
    <endpoint address="http://onlinexc.w03.Winhost.com:8732/Design_Time_Addresses/LotteryServer/Service1/127.0.0.1"
     
    Last edited by a moderator: Oct 14, 2015
  4. Ray

    Ray

    Try replacing the address line from...

    <add baseAddress="http://http://onlinexc.w03.Winhost.com:8732/Design_Time_Addresses/LotteryServer/Service1/" />

    to...

    <add baseAddress="http://onlinexc.w03.Winhost.com:8732/Design_Time_Addresses/LotteryServer/Service1/" />

    It looks like you got the two http mis-typed.
     
    Last edited by a moderator: Oct 14, 2015
  5. Oops. sry
    Corrected but still same error :(

    btw, after i publish my service, will it start automatically? or do i have to somehow start it manually?
     
  6. Ray

    Ray

    It should start automatically. But if you want you can recycle your application and the server will re-upload the application into the process. You can recycle your application pool inside the Winhost control panel under the Site Info Manager page.
     
    Last edited by a moderator: Oct 14, 2015
  7. It appears that Winhost supports WCF only in IIS!!!

    Here is what your Customer Support wrote about it:

    we do not accept connections on port 8732 which is resulting in the problem as we only support IIS-based WCF services
     
    Last edited by a moderator: Oct 14, 2015
  8. So now i converted my App to be hosted in IIS. Locally it works, but here it gives me this error when i try to connect:

    The remote server returned an unexpected response: (405) Method Not Allowed.

    this is the most progress i've made
    Here is my Web.config file

    HTML:
    <?xml version="1.0"?>
    <configuration>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="ServiceBehavior" name="WcfServiceLibrary1.Beka">
            <endpoint address="http://winplatinum.com" binding="basicHttpBinding" bindingConfiguration=""
              contract="WcfServiceLibrary1.IBeka">
              <identity>
                <dns value="winplatinum.com" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehavior">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
     
    </configuration>
    
    And an app.config file on Client side:

    HTML:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_IBeka" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                        useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <security mode="None">
                            <transport clientCredentialType="None" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="UserName" algorithmSuite="Default" />
                        </security>
                    </binding>
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://winplatinum.com"
                    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IBeka"
                    contract="WebServiceReference1.IBeka" name="BasicHttpBinding_IBeka" />
            </client>
        </system.serviceModel>
    </configuration>
    Thanks in advice
     
  9. Ray

    Ray

    Give us another URL to look at the error. The error you provided is not enough to really diagnose the problem.
     

Share This Page