0
votes

I am working on both the project using .Net 2.0 Web Application and also WCF. If I use the WCF by its default configuration, when the .Net 2.0 project call its method, it throws an exception for unsupported SOAP message.

Goggled and found that people mentioned that WCF need to change the binding to BasicHttpBinding ->http://msdn.microsoft.com/en-us/library/ms731134.aspx

Tried that and since I am hosting in IIS I did not do the BasicHttpBinding instantiation like the example shown below.

// Create a BasicHttpBinding instance
BasicHttpBinding binding = new BasicHttpBinding();

However this time round, I can't even run the WCF service. When I run using right click, view in browser, I get a page with

"Service name" has zero application (non-infrastructure) endpoints

My web config for WCF is exactly same as the link I have given, only that I have changed the contract to suit my file.

Anyone with experience that care to help? Thanks

The web.config

<system.serviceModel>
    <services>
      <service name="MyService" behaviorConfiguration="HttpGetMetadata">
        <endpoint address="" contract="MyContractName" binding="basicHttpBinding" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="HttpGetMetadata">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
1
You'll need to share your config for us to help.RQDQ
basically the config file is the default when a new WCF project is created, and I added like example here. Only changed the contract nameC_Rance
Show us the code and config, or we can't help.John Saunders
@ John, I think that since RQSQ and u were trying to help, I just post up the config. But I got it to work by deleting the service section for the web.config, and use svceditor to add in. works fine after.C_Rance

1 Answers

1
votes

Yes, I just did that today.

  • Define the WCF service with BasicHttpBinding
  • On your client, add web reference and it will create a SoapClient
  • If you need security you need to use WSE 2.0 SP3.

My case had a requirement for clear-text username/password with SSL and I happily got it working using this.