[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [DataContract] public class MyService : IMyService { [WebGet] // Using WebPost causes 405 Errors public MyDataType GetMyData(string input) // input is always empty. ? {
WebChannelFactory<IMyService> factory = new WebChannelFactory<IMyService>( new WebHttpBinding(WebHttpSecurityMode.TransportCredentialOnly), new Uri("http://127.0.0.1/Services/MyService.svc") ); factory.Endpoint.Behaviors.Add(new WebHttpBehavior()); IMyService service = factory.CreateChannel(); MyDataType my = service.GetMyData("input"); ((IClientChannel)service).Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)