Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am clearly not looking in the right places and have gotten myself so confused that I don't even know how to ask this question, but here goes...
A prior product version about a decade ago (as in ".NET Framework 2.0") offered a single WebMethod via a dedicated WebService that handled an HTTP Post message over SOAP. (Did I manage to express that in a valid context?) I had incidental interaction with that part of the development team and only learned enough to "tag along" during its testing.
C#
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class TheWebService : System.Web.Services.WebService
{
    [WebMethod]
    public string DoSomething(string a, string b) { . . . }
}
And a web.config file:
HTML
<configuration>
  <system.web>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
  </system.web>
</configuration>
Somewhere along the overall application's progression to WCF-based communication, the accessibility of that particular WebMethod got lost. I need to resurrect it. The MSDN content I have found tells me that those web functions are now wrapped somewhere in WCF. At about there, I get lost.
What once was decorated with the WebService attribute now has the ServiceBehavior attribute; what used the system.web configuration section now uses system.serviceModel; and I have a test application that can invoke the desired method via a ServiceModel.ClientBase<T> object using the DLL containing the service's interface definition. But I don't know where to look for information to help me recover the simple HTTP Post accessibility (that knows only the URI and the webmethod's signature) nor explain to me what that even looks like.
C#
namespace Contracts 
{
    [ServiceContract(Namespace = "MyApp.SomeNS")]
    public interface IWcfService
    {
        [OperationContract]
        string DoSomething(string a, string b);
    }
}

namespace Services 
{
    [ServiceBehavior(Namespace = "MyApp.SomeNS")]
    public class WcfService : Contracts.IWcfService
    {
        public string DoSomething(string a, string b) { . . . }
    }
}
I'm having difficulty sorting out the new from the obsolete or superseded. Can I get a simple example that says "This is the direction you want to go" and some pointers to where I should look to understand the example so I can apply it?

What I have tried:

I have managed to explore the serviceModel configuration bindings enough to see the difference between basicHttpBinding and wsHttpBinding when the test application is exercised and recognize that basic is what I need (since I couldn't get even simple authentication to work), but that added as much confusion as it did clarity.
Posted
Updated 4-Jun-18 7:33am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900