Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - ServiceHost BaseAddress annoying situation in January CTP release

 
 
Old 03-04-2006   #1 (permalink)
Jose Antonio


 
 

ServiceHost BaseAddress annoying situation in January CTP release

Hi all,

I have been working only with the November release until the release of the
January version. After doing the needed changes, I ran my program (windows
console self hosted service) without any exception (phew!!).
Just then, when I tried to check everything was fine by visiting the address
of the service I received the following xml as I were downloading a file:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<s:Header>
<a:Action
s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</a:Action>
<a:To
s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value>a:ActionNotSupported</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="es-ES">The message with action '' cannot be processed at
the receiver.</s:Text>
</s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>

After a "bit" of reviewing January samples and coding a fool service from
scratch, I noticed that:
- Although in the contructor of ServiceHost it is optional to supply
addresses, it does NOT make the service attend to the endpoint address
specified in the config file. If you debug and watch the servihost object you
have just created, it has correctly your specified endpoint (with its
address) but there is 0 addresses in its BaseAddresses properties. That
implies the xml error file cited above.
- If you code as on the samples and many other code on the inet, and put
your address as a key in the appsettings section of the config file, and when
creating the servicehost you retrieve and pass that address, everything works
fine. Your not modified endpoint is there, and now BaseAddresses contains the
address.

IMHO this is an annoying behavior. Is the intended coding behavior to put
addresses in appsettings as it is in the samples? Or add them to
BaseAddresses after the creation of the servicehost (tested and works)?

If there is a way to create a ServiceHost just from the info specified in
the <system.serviceModel> section, I will be very pleased to know about it.

Best regards.

My System SpecsSystem Spec
Old 03-04-2006   #2 (permalink)
Jose Antonio


 
 

Re: ServiceHost BaseAddress annoying situation in January CTP release

Thanks for the answer Clemens. Although now it is clearer for me the meaning
of the BaseAddresses property, I still having doubts.
The constructor of the ServiceHost says it is optional to pass addresses as
parameter; my endpoint definition in the config file has an absolute URI;
therefore, if all it needs is there, why one has to put extra code to pass an
address to the ServiceHost constructor?
Why the Open method not raise an exception because there is not a base
address for the service?
Why if one type the endpoint address where the service should be listening
gets that meaningless response (see the first post of this thread)?

Well, I think I liked more the way this worked in the November release :,( .
Nevertheless, a beta is a beta and now we are closer to the final release

PD: I hope this questions don't sound very aggresive or rude; if so, excuse
me because I don't speak english so well in order to notice that.
My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Vista release on January the 30th Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46