When MPS Web Service Debug Logging is enabled, it saves out the XML input (request) and the XML output (response) for each Web Service request. It can be helpful in identifying malformed requests as a result of bugs in Web or Client interfaces or as a result of invalid data being submitted to the Web Services. The input XML files can be resubmitted through ProvTest for further troubleshooting after some minor modification.

Enable MPS Web Service Debug Logging

To enable MPS Web Service Debug Logging, you must edit the MPSWS Web.Config file, which is typically located in the C:\Program Files\Microsoft Hosting\Provisioning\MPSWS folder.

Set the WriteDebug value to "true" and ensure that the DebugFilePath value is set to a valid location on the local hard disk, as in the following example:

  Copy Code
<?xml version="1.0" encoding="iso-8859-1" ?> 
<configuration> 
... 
		<appSettings> 
				<add key="WriteDebug" value="true" /> 
				<add key="DebugFilePath" value="C:\Debug\" /> 
				<!-- to enable event sink set to 1. Otherwise leave at 0--> 
				<add key="EnableEventSink" value="1"/> 
		</appSettings>
Note:
Ensure that the DebugFilePath value is set to a path that exists; otherwise you will get a .Net exception similar to the following:System.IO.DirectoryNotFoundException: Could not find a part of the path "C:\Debug\<RequestName><TimeStamp>IN.xml". at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Xml.XmlDocument.Save(String filename) at MPSWS.Utilities.SubmitRequest(XmlDocument requestXml)

More on MPS Web Service Debug Logging

After MPS Web Service Debug Logging is enabled, separate files will be created under the DebugFilePath for each request and each corresponding response respectively. The files are named as follows:

  • Requests will be in the format of <Procedure Name>_<Day>_<TimeStamp>_IN.xml
  • Successful responses will be in the format of <Procedure Name>_<Day>_<TimeStamp>_OUT.xml
  • Failed responses will be in the format of <Procedure Name>_<Day>_<TimeStamp>_ERR.xml
Note:
A busy server may have hundreds if not thousands of files created under the DebugFilePath within minutes. This can have an impact on very busy Web Services servers with slow IO. However, the impact is typically minimal.

Resubmit a Request through ProvTest

In addition to the ability to know exactly what the request looked like, another valuable troubleshooting technique that Web Service Debug Logging enables is to modify and resubmit the same request through ProvTest in order to further isolate an issue. To do this, you must first slightly modify the request file.

The following example is one of the most common Web Services requests made by the Sample Web UI or Sample Control Panel. The GetCallerUiRoles_Monday_11h16m50s_IN.xml request is to the Managed Hosting::GetCallerUIRoles procedure.

  Copy Code
<?xml version="1.0" encoding="iso-8859-1"?> 
<request> 
  <data> 
	<hostingPath>LDAP://OU=Hosting,DC=fabrikam,DC=Com</hostingPath> 
	<preferredDomainController>ADEXBE.fabrikam.com</preferredDomainController> 
  </data> 
  <procedure> 
	<execute namespace="Managed Hosting" procedure="GetCallerUiRoles"> 
	<before source="data" destination="executeData" mode="merge" /> 
	<after source="executeData" destination="data" mode="insert" /> 
	</execute> 
  </procedure> 
  <context> 
	<securityContext> 
	<authentication> 
		<basic username="FABRIKAM\Administrator" password="********" /> 
	</authentication> 
	</securityContext> 
  </context> 
</request>

In order to resubmit this request, you have to deal with the password attribute of the basic authentication node as it has been populated with asterisks to conceal the password. You can set the correct password or remove the entire <context> node from this request. Resetting the password allows you to control the context of the request; removing the <context> node causes the request to be submitted under the context of the user you logged on as when running ProvTest.

After fixing or removing the <context> node in this file, run ProvTest to submit this request as follows:

  Copy Code
C:\Debug>provtest /x2 GetCallerUiRoles_Monday_11h16m50s_IN.xml 
<response> 
  <data> 
	<hostingPath>LDAP://OU=Hosting,DC=fabrikam,DC=Com</hostingPath> 
	<preferredDomainController>ADEXBE.fabrikam.com</preferredDomainController> 
	<executeData> 
	<hostingPath>LDAP://OU=Hosting,DC=fabrikam,DC=Com</hostingPath> 
	<preferredDomainController>ADEXBE.fabrikam.com</preferredDomainController> 
	<uiRoles> 
		<uiRole>6000</uiRole> 
		<uiRole>5000</uiRole> 
		<uiRole>2000</uiRole> 
		<uiRole>1500</uiRole> 
		<uiRole>1000</uiRole> 
		<uiRole>0500</uiRole> 
		<uiRole>0100</uiRole> 
		<uiRole>0000</uiRole> 
	</uiRoles> 
	<highestUiRole>6000</highestUiRole> 
	</executeData> 
  </data> 
</response>
Note:
This request will only work after the Microsoft Provisioning Tools directory was added to the local path as described here.