Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>To your specific questions:</strong></p> <ol> <li>In your client code, what you're constructing are instances of lightweight proxy classes that wrap the channel infrastructure that serialize messages to/from the service's endpoints. As such, these client proxy classes are cheap and fast to construct because they don't generally do a great deal until you actually send something to the service. One thing to watch out for is when you call services which employ a more complex security scheme - establishing connections to such services can be costly and so it's worth caching or re-using such connections if you can.</li> <li>"Any workarounds"? Nope! Alas, the service you're consuming is poorly designed - not only do they require username and password to be supplied as part of the service method invocation, but they require that you pass them in the clear over HTTP. You might want to ask them to AT LEAST provide an SSL endpoint so that the username and password can be secured during transit. Better still, they could implement basic-auth to allow you to acquire an HTTP auth cookie that you can attach to subsequent calls against their services.</li> <li>Yes, the GC will eventually clean-up your proxy instances. Better still, you could wrap your instances in <code>using</code> statements to invoke the Dispose pattern and clean-up deterministically. See my <a href="http://magic8ballservice.codeplex.com/" rel="nofollow">Magic8Ball WCF Service</a> on Codeplex for examples.</li> </ol> <p><strong>Other observations:</strong></p> <ol> <li>Because your service requires your username and passoword, each time you call it, you need to pay some very careful thought to how you're going to obtain and store the username and password.</li> <li>I would urge you to specify your binding information in the app.config rather than inline in your code. Again, see the <a href="http://magic8ballservice.codeplex.com/" rel="nofollow">Magic8Ball WCF Service</a>: If you create bindings in code and the endpoint changes or if they open up a new endpoint, protocol, encoding and/or binding, you'll have to recompile and redist your entire app. If you specify your bindings in config, you might just be able to get away with shipping an updated app.config.</li> </ol> <p>Hope this helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload