1
votes

We hosted WCF services with basicHttpBinding on server side,

    <bindings>           
      <basicHttpBinding>        
        <binding name="BasicHttpEndpointBinding" >
          <security  mode="TransportCredentialOnly">
            <transport  clientCredentialType="basic" /> 
          </security>          
        </binding>        
      </basicHttpBinding>      
    </bindings>

WCF services hosted in Windows xp sp3 , IIS 5.1 with Anonymous access enabled.
If I want to access the WCF services on .net 2.0 desktop application.
What configuration do I need do, with sample code?

thanks
nrk

2
Which web service API are you planning on using on the client? - Mark Seemann
thanks for the reply, client will be windows application accessing developed in .net 2.0, it previously used access the asp.net 2.0 webserivce. Now I need to update to access WCF services. - nRk
Can you install .NET 3.0 on your clients? - Mark Seemann
It supports only .net 2.0 framework, I am working on windowx xp embedded environment, it supports .net 2.0 framework only. I cannot upgrade it, It doesn't supports .net 3.5 framework. - nRk
.NET 3.0 is not the same as .NET 3.5. .NET 3.0 is basically just a bunch of extra libraries (including WCF) that runs on the .NET 2.0 CLR. This article (msdn.microsoft.com/en-us/library/bb417255(WinEmbedded.5).aspx) looks to me like it's possible to install .NET 3.0 on XP Embedded. - Mark Seemann

2 Answers

0
votes

If you cannot install .NET 3.0 (which is the first .NET to contain the WCF bits), all you can do is add a reference to this service as an ASMX web service.

In Visual Studio, go to your project, and right-click and pick "Add Web Reference" and type in the URL.

There's no other way to do it (with nothing but .NET 2.0).

If you can upgrade to .NET 3.0, then your client app.config will have this exact same section inside it:

<bindings>           
      <basicHttpBinding>        
        <binding name="BasicHttpEndpointBinding" >
          <security  mode="TransportCredentialOnly">
            <transport  clientCredentialType="basic" /> 
          </security>          
        </binding>        
      </basicHttpBinding>      
    </bindings>

but you've not shown us the more interesting part of your server config file - the <services> section that defines the endpoints your service has to offer.

On the client, you'll have at a mimimum:

<client>
  <endpoint name="whatever"
            address="http://yourServer:8080/YourService/"
            binding="basicHttpBinding"
            bindingConfiguration="BasicHttpEndpointBinding"
            contract="IYourServiceContract" />
</client>

That should do it.

0
votes

Assuming that you can install .NET 3.0 (as per the discussion connected to your question), you can use WCF on the client side as well, and you would need to use the same binding configuration as the one you posted.