Theres an item on the view menu to make the output

Info icon This preview shows pages 508–511. Sign up to view the full content.

View Full Document Right Arrow Icon
(There’s an item on the View menu to make the Output window visible, if it’s not already open.) The Output window gets fairly busy, so you might have to look quite 484 | Chapter 13: Networking
Image of page 508

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
carefully, but somewhere in the noise, you’ll see that the from and note argument values are both shown, for example: Ian: Hello, world If you’re trying this yourself, it’s possible you’ll see an error back in the WCF Test Client if you set breakpoints in Visual Studio—the client program will time out if you spend too long suspended at a breakpoint. It’s common with networking systems to give up after a certain length of time. If a client doesn’t get a response, all manner of things could be wrong—there may be a network problem, perhaps locally, or maybe at the server end, or somewhere in between. Maybe the server is offline, or just too busy to respond to the request. The client can’t easily tell— all it knows is it’s not getting a response. So by default, WCF gives up after a minute and throws an exception. The WCF Test Client reports this with an error dialog. Figure 13-5. Passing arguments with the WCF Test Client Once the test client has received a response from the service, it indicates this in the bottom half of the tab. Our PostNote operation has a return type of void , which means that it sends back an empty response. (It still sends a response to report that the oper- ation has finished. It just contains no data.) You may be curious to know what the messages being sent between the client and the server look like. And if you’re not, we’d recommend becoming curious about such things. It’s difficult to design good, nontrivial distributed systems (and impossible to diagnose problems with them) if you don’t know what the messages they send look like. Sadly, some developers are happy to be ignorant about this sort of thing, but they WCF | 485
Image of page 509
frequently get stuck and have to ask for help from people who know what they’re doing anytime something goes wrong. If you’d rather be one of the wizards who can fix these problems, you need to learn what the messages that go over the network really look like. You can see the messages in the WCF Test Client by clicking on the XML tab at the bottom. It’s beyond the scope of this book about C# to explain the structure of these WCF messages in detail, but it’s easy to see where the data you sent ended up in this example. If you want to learn more, the book Learning WCF by Michele Leroux Bustamante (O’Reilly) would be a good place to start, or for a more advanced treatment, you could try Programming WCF Services by Juval Lowy (O’Reilly). If you plan to do any real work with network communications, one of the most useful things you can do is get familiar with a tool that lets you inspect the contents of the messages being sent and received by your computer’s network card. Microsoft’s Network Monitor program is available for free, as is the open source Wireshark . They can seem a little
Image of page 510

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 511
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern