none
add remote WCF reference to VB project RRS feed

  • Question

  • I'm trying to add a reference to a WCF service on a remote computer. It works perfectly locally but when the service is deployed remotly, I can't add the reference.

    WCF is embedded in a Console VB 2010 application. I've enabled all features of IIS on the host computer.

    here is the app.config file:

    <configuration>
        <system.serviceModel>
          <behaviors>
            <serviceBehaviors>
              <behavior name="serviceBehavior">
                <serviceMetadata httpGetEnabled="true"/>
              </behavior>
            </serviceBehaviors>
          </behaviors>
            <bindings>
              <basicHttpBinding>
                <binding name ="defaultBasicHttpBinding">
                  <security mode ="Transport">
                    <transport clientCredentialType="None"/>
                  </security>
                </binding>
              </basicHttpBinding>
                <wsDualHttpBinding>
                    <binding name="WSDualHttpBinding_StitchingSequence" closeTimeout="00:00:20" openTimeout="00:00:20" sendTimeout="00:00:10" bypassProxyOnLocal="false"
                             transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                             messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                        <reliableSession ordered="true"/>
                        <security mode="None">
                            <message clientCredentialType="Windows" negotiateServiceCredential="true"/>
                        </security>
                    </binding>
                </wsDualHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://192.168.1.30:8080/StitchingSeq" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_StitchingSequence"
                          contract="StitchingSequence" name="WSDualHttpBinding_StitchingSequence"/>
            </client>
        </system.serviceModel>
    <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

    On the client side, in Internet Explorer (address: http:/192.168.1.30:8080/StitchingSeq), I get an XML file and all the details of my service. When trying to add the reference in VS 2010, I get the following error:

    any help would be really appreciate!

    thanks!

    • Moved by Youen Zen Wednesday, March 6, 2013 7:39 AM From Visual Basic
    Tuesday, March 5, 2013 2:56 PM

Answers

  • On 3/6/2013 9:55 AM, Dominic33 wrote:

    Hi, thanks for the answer.

    Service was running on the remote PC when I tried to add the reference in Visual Studio. The very same address used (http://192.168.1.30:8080/StitchingSeq) in Internet Explorer gives me an XML with the service methods and definition. If I stop the WCF on the remote and try again, it gives another error saying textually it cannot find the service.


    We managed to make it work by doing a simple "Find and replace" from "localhost" to "192.169.1.30" in the VS solution, as the service as been developped locally first and it worked perfectly.

    It is now working at runtime but not at design. If we do changes in the WCF by adding callbacks, for example, we can't do an Update service reference, it won't work.

    And again you should change it back to LocalHost, which would be the Loopback IP of 127.0.0.1 or you give the name of LocalHost, if you want the service to work again in the VS IDE. Then if one wants to access the Web service from a client machine on the LAN, then the LAN IP must be given in the config file to point to the LAN IP of the machine that is hosting the WCF service.

    http://en.wikipedia.org/wiki/Loopback

    The LoopBack routes the traffic back to the local machine, which is needed if you want the service to work locally on the development machine with VS.

    On that same dime, if the service is to be published to the Internet or WAN, then WAN IP and not the LAN IP must be the IP to be used.

    The Update service references must be against the Localhost or Loobback IP of 127.0.0.1 since the loacl development is hosting the WCF service, and then it is changed to a LAN or WAN IP in the config files Web.config or app.config depending upon what type of the WCF service is being used for the remote client.

    • Marked as answer by Dominic33 Wednesday, March 6, 2013 8:19 PM
    Wednesday, March 6, 2013 6:09 PM

All replies

  • I'll move this thread to a WCF forum for better support.

    Thanks,


    Shanks Zen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 6, 2013 7:39 AM
  • Hi,

    The client cannot find the service from the screenshot, if you want to access a wcf service remotly, you need publish the service, for example, publish the service to IIS (on the machine where the service is located). You can check "Using WCF Service Publishing" part for the steps in below documents.

    #WCF Service Publishing

    http://msdn.microsoft.com/en-us/library/bb924407.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, March 6, 2013 7:55 AM
    Moderator
  • Hi, thanks for the answer.

    Service was running on the remote PC when I tried to add the reference in Visual Studio. The very same address used (http://192.168.1.30:8080/StitchingSeq) in Internet Explorer gives me an XML with the service methods and definition. If I stop the WCF on the remote and try again, it gives another error saying textually it cannot find the service.

    We managed to make it work by doing a simple "Find and replace" from "localhost" to "192.169.1.30" in the VS solution, as the service as been developped locally first and it worked perfectly. It is now working at runtime but not at design. If we do changes in the WCF by adding callbacks, for example, we can't do an Update service reference, it won't work.

    Wednesday, March 6, 2013 2:55 PM
  • On 3/6/2013 9:55 AM, Dominic33 wrote:

    Hi, thanks for the answer.

    Service was running on the remote PC when I tried to add the reference in Visual Studio. The very same address used (http://192.168.1.30:8080/StitchingSeq) in Internet Explorer gives me an XML with the service methods and definition. If I stop the WCF on the remote and try again, it gives another error saying textually it cannot find the service.


    We managed to make it work by doing a simple "Find and replace" from "localhost" to "192.169.1.30" in the VS solution, as the service as been developped locally first and it worked perfectly.

    It is now working at runtime but not at design. If we do changes in the WCF by adding callbacks, for example, we can't do an Update service reference, it won't work.

    And again you should change it back to LocalHost, which would be the Loopback IP of 127.0.0.1 or you give the name of LocalHost, if you want the service to work again in the VS IDE. Then if one wants to access the Web service from a client machine on the LAN, then the LAN IP must be given in the config file to point to the LAN IP of the machine that is hosting the WCF service.

    http://en.wikipedia.org/wiki/Loopback

    The LoopBack routes the traffic back to the local machine, which is needed if you want the service to work locally on the development machine with VS.

    On that same dime, if the service is to be published to the Internet or WAN, then WAN IP and not the LAN IP must be the IP to be used.

    The Update service references must be against the Localhost or Loobback IP of 127.0.0.1 since the loacl development is hosting the WCF service, and then it is changed to a LAN or WAN IP in the config files Web.config or app.config depending upon what type of the WCF service is being used for the remote client.

    • Marked as answer by Dominic33 Wednesday, March 6, 2013 8:19 PM
    Wednesday, March 6, 2013 6:09 PM
  • thanks!
    Wednesday, March 6, 2013 8:20 PM