Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with wsHttpBinding
Message
From
07/04/2012 10:21:20
 
 
General information
Forum:
ASP.NET
Category:
Windows Communication Foundation (WCF)
Environment versions
Environment:
C# 4.0
Miscellaneous
Thread ID:
01540381
Message ID:
01540581
Views:
35
>>For me, the same thing happened that has been happening all along ... it worked fine when I had Fiddler running. It didn't work when I shut Fiddler down (froze up my laptop).
>>
>>It could be my laptop I suppose. After I rebooted again after the last freeze up, I couldn't get Internet Explorer to connect to any web sites. At all ... nothing! It wasn't my Internet connection ... my email and Trillian were working fine. Another computer that was on the same network could access web sites, so it wasn't a problem with my ISP.
>>
>>But, here's something weird: while I still had IE up (with the message that there's a problem connecting), I fired up Fiddler. Then I refreshed that web page ... voila (viola? <g>) ... it's back to working just fine. Shut down Fiddler and all is still working fine. Very, very strange, IMHO!
>
>Indeed. Could you access the server from a browser rather than using your client? Was only IE affected or was there also a problem with other browsers?


My service or your sample? I didn't try my service from a browser, I only tried yours (just didn't think of it). I only have IE, I don't have any other browsers.

>>>>Although, then the question becomes ... why? Using the computer name worked fine when using netTcpBinding, why wouldn't it work with wsHttpBinding?
>>>
>>>It's odd. If the computer name was not correct then I wouldn't expect Fiddler to intercept. But if it *was* correct then it should have worked in the first place :-{


Yep, odd indeed. Fiddler must be magic! <g>

~~Bonnie


>>>
>>>FWIW here's a simple test (console to console on the same machine) that I use (substitute your machine name in the Uri's). Server:
using System;
>>>using System.ServiceModel;
>>>using System.ServiceModel.Description;
>>>using System.ServiceModel.Web;
>>>
>>>namespace ConsoleApplication2
>>>{
>>>    class Program
>>>    {
>>>        static void Main(string[] args)
>>>        {
>>>            WebServiceHost host = new WebServiceHost(typeof(Service), new Uri("http://machinename:8000/"));
>>>            host.AddServiceEndpoint(typeof(IService), new WebHttpBinding(), "");
>>>            host.Open();
>>>            Console.ReadLine();
>>>            host.Close();
>>>        }
>>>    }
>>>
>>>    [ServiceContract]
>>>    public interface IService
>>>    {
>>>        [OperationContract]
>>>        [WebGet]
>>>        string Echo(string s);
>>>    }
>>>
>>>    public class Service : IService
>>>    {
>>>        public string Echo(string s)
>>>        {
>>>            Console.WriteLine("Got: " + s);
>>>            return "Returning:" + s;
>>>        }
>>>    }
>>>}
Client:
using ConsoleApplication2;
>>>using System.ServiceModel;
>>>using System.ServiceModel.Description;
>>>using System;
>>>
>>>namespace ConsoleApplication3
>>>{
>>>    class Program
>>>    {
>>>        static void Main(string[] args)
>>>        {
>>>            using (ChannelFactory<IService> channel =
>>>                new ChannelFactory<IService>(new WebHttpBinding(), "http://machinename:8000/"))
>>>            {
>>>                channel.Endpoint.Behaviors.Add(new WebHttpBehavior());
>>>                IService myChannel = channel.CreateChannel();
>>>                string s;
>>>                do
>>>                {
>>>                    s = Console.ReadLine();
>>>                    Console.WriteLine(myChannel.Echo(s));
>>>                } while (s != "Q");
>>>            }
>>>        }
>>>    }
>>>}
For me Fiddler intercepts that out of the box and I can also use it from the browser with http://machinename:8000/Echo?s=Testing.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform