开发者

Why is WCF communication a tcp even if I say http in URI?

开发者 https://www.devze.com 2023-02-19 10:53 出处:网络
I have created a WCF server in a PC named PC1. I access the URI http://PC1:8000/ServiceModelSamp开发者_开发问答les/Service using internet explorer from another PC named PC2.

I have created a WCF server in a PC named PC1. I access the URI http://PC1:8000/ServiceModelSamp开发者_开发问答les/Service using internet explorer from another PC named PC2.

When I debug the messages in Wireshark, I am confused that why there is no HTTP message, even though I specify "http://" in my URI. It only shows TCP protocol, there is no HTTP message or header.

Please advice


To wireshark, any browser request is just another TCP connection. As far as showing the HTTP protocol details is concerned, it might be guessing that traffic on a specific port (80) would be http. Since you are using a non-standard http port, it might not be able to do so.

To confirm this, try loading some other website/webpage (e.g. www.google.com) and see if it is able to show you http details. If it works, then next thing would be try and find some setting/configuration by which you can tell wireshark that it should treat traffic from another port (8000 in your case) as http traffic.

EDIT:

See this question as a guide to configure wireshark for http ports.


HTTP is an application layer protocol that sits on top of TCP, the transport layer protocol.

See http://en.wikipedia.org/wiki/TCP/IP_model for more information.


When you access the service using a browser, a "friendly" service responds to generate a web form to your browser. If you get a web page back in your browser, it is HTTP. That's not part of the "SOAP" spec, but it is part of the MS WCF stack supporting HTTP.

Then, if you fill it out, you might be POSTing or GETing the form, but POST is the default. That's also HTTP. GET is often disabled in WCF.

Then, you get back XMLish stuff in your browser, that also came by HTTP.

So you might just be missing an HTTP protocol decode in wireshark.

EDIT: I didn't see your URL included :8000. Wireshark won't decode that as HTTP unless you force it to, because it's not on the HTTP port. You can right-click on a port 8000 packet and say "follow conversation", and you'll see all the http goodness. You can also force wireshark to decode that stream as HTTP, which will let you "drill into" the packets past the TCP layer.

0

精彩评论

暂无评论...
验证码 换一张
取 消