Thursday, 28 June 2012

Strange Web Services Exception

One of the application I work on started playing up recently.  The application communicates with one of our customers systems via web services.  Due to technical reasons on their side they are changing the platform that their web services run on.  This has meant that we have had to make some changes to accomodate their changes and get our application talking to the new web services correctly.  Once released into their testing environment some of the web services call started to throw a System.ServiceModel.CommunicationException:

System.ServiceModel.CommunicationException: There was an error in serializing body of message checkIssueDeliveryRequest: 
'Unable to generate a temporary class (result=1).  error CS2001: Source file '
C:\Windows\TEMP\rjsmbtjy.0.cs' could not be found  error CS2008: No inputs specified  '.  
Please see InnerException for more details. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).  
error CS2001: Source file 'C:\Windows\TEMP\rjsmbtjy.0.cs' could not be found  error 
CS2008: No inputs specified       
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)   
....
....

It turns out the problem is down to the fact that the User account that the Application Pool associated with the web services website does not have read and write permissions to the c:\windows\temp directory as described here http://support.microsoft.com/kb/322886.  Below is a more detailed step by step approach that I to solve the issue.
  • Open IIS Manager
  • Click on the web services application node of the problem web services website
  • Click on Basic Settings... to see what Application Pool is being used (in my case it was ASP.NET v4.0 Integrated)
  • Click the Application Pools node and select the Application Pool associated with your web services website
  • Click on Advances Settings... and check the Process > Identity to get the account that is being used
  • Open an explorer window and browse to c:\windows\temp
  • Right click on the folder and click properties
  • Select the Security tab and  click Edit:
  • If the account already appears under "Group or user names:", highlight the account by clicking on it and ensure that the read and write checkboxes are checked
  • If it is not already listed click Add... to add the account before ensuring that the read and write permission are checked for that account
That's it for now.

No comments:

Post a Comment