Friday, March 27, 2009

Merge Joe Schulman's Public Client's Settings into ILM 2's Web Service Config File

This is a unit step that I separated from another post in order to keep it uncluttered.

We're going to merge the contents of Joe Schulman's public client into the ILM 2 web service config file. You can find the public client's config file under the project folder at SampleApplication\app.config, but I provide the complete contents in my instructions below.

Locate your ILM 2 web service config file. Mine is at C:\Program Files\Microsoft Identity Management\Common Services\Microsoft.ResourceManagement.Service.exe.config. First of all, make a backup copy of this file. Then, edit the original with the following changes. Note: I heard that I've confused some people with my use of ellipses (sorry!), so I'll try to explain things a little better.

Your config file already contains a root element named "configuration" and a child element named "configSections", so I've greyed them out below. Also, I've added an ellipsis (...) to show that the "configSections" element contains other existing children (which you shouldn't touch, by the way). I want you to place the following bold text inside the "configSections" element, and after its existing children.

<configuration>

<configSections>

...


<!--Begin PublicResourceManagementClient-->
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Microsoft.ResourceManagement.Samples.ResourceManagementClient.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
<!--End PublicResourceManagementClient-->


</configSections>

...

</configuration>

Okay, now let's place the next block of bold text immediately after the closing "configSections" tag. So, this block will be a direct child of the root "configuration" element.

<configuration>

<configSections>

...

</configSections>

<!--Begin PublicResourceManagementClient-->
<applicationSettings>
<Microsoft.ResourceManagement.Samples.ResourceManagementClient.Settings>
<setting name="WsEnumerationDefaultExpiresAdd" serializeAs="String">
<value>15</value>
</setting>
<setting name="WsEnumerationDefaultPull" serializeAs="String">
<value>15</value>
</setting>
<setting name="IlmSchemaFilename" serializeAs="String">
<value>IlmSchema.xsd</value>
</setting>
</Microsoft.ResourceManagement.Samples.ResourceManagementClient.Settings>
</applicationSettings>
<!--End PublicResourceManagementClient-->


...

</configuration>

All right, one more (long) code block to go; hang in there! Now, your config file already contains a "system.serviceModel" element, which is also a child of the root "configuration" element. The "system.serviceModel" element already contains children, also (hence, another ellipsis below it). I want you to copy the following bold text inside the "system.serviceModel" element, but after its existing children.

<configuration>

...

<system.serviceModel>

...


<!--Begin PublicResourceManagementClient-->
<bindings>
<wsHttpBinding>
<binding name="MetadataExchangeHttpBinding_IMetadataExchange"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
maxReceivedMessageSize="965536" messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
<wsHttpContextBinding>
<binding name="ServiceMultipleTokenBinding_Resource" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false" contextProtectionLevel="Sign">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
<binding name="ServiceMultipleTokenBinding_ResourceFactory" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false" contextProtectionLevel="Sign">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
<binding name="ServiceMultipleTokenBinding_Search" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="165536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false" contextProtectionLevel="Sign">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
<binding name="ServiceMultipleTokenBinding_Resource1" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false" contextProtectionLevel="Sign">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
</wsHttpContextBinding>
</bindings>
<client>
<endpoint address="http://localhost:526/ResourceManagementService/Resource"
binding="wsHttpContextBinding" bindingConfiguration="ServiceMultipleTokenBinding_Resource"
contract="Resource" name="ServiceMultipleTokenBinding_Resource" />
<endpoint address="http://localhost:526/ResourceManagementService/ResourceFactory"
binding="wsHttpContextBinding" bindingConfiguration="ServiceMultipleTokenBinding_ResourceFactory"
contract="ResourceFactory" name="ServiceMultipleTokenBinding_ResourceFactory" />
<endpoint address="http://localhost:526/ResourceManagementService/Enumeration"
binding="wsHttpContextBinding" bindingConfiguration="ServiceMultipleTokenBinding_Search"
contract="Search" name="ServiceMultipleTokenBinding_Search" />
<endpoint address="http://localhost:526/ResourceManagementService/Alternate"
binding="wsHttpContextBinding" bindingConfiguration="ServiceMultipleTokenBinding_Resource1"
contract="Resource" name="ServiceMultipleTokenBinding_Resource1" />
<endpoint address="http://localhost:526/ResourceManagementService/MEX"
binding="wsHttpBinding" bindingConfiguration="MetadataExchangeHttpBinding_IMetadataExchange"
contract="IMetadataExchange"
name="MetadataExchangeHttpBinding_IMetadataExchange" />
</client>
<!--End PublicResourceManagementClient-->


</system.serviceModel>

...

</configuration>

That's it! You'll know that you had a typo if the service refuses to restart. For completeness, I've posted our config file, in case you'd like to compare notes with a program like ExamDiff.

No comments:

Post a Comment