Geeks With Blogs
Stas Kondratiev's Blog blog

Today I've encountered an interesting issue with the SharePoint. I wrote a code to call a couple of SharePoint web services. But it did not work. SoapException occurred with the message "Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown.". Having played a little bit with the code I understood that the same exception occured whenever I called some SharePoint web method. I tried GetListCollection method of the Lists web service - it should work, i've used it often - but it would not work either. I had a look at the Detail property of the SoapException and saw "Method not found: System.Collections.IEnumerator Microsoft.SharePoint.SPListCollection.GetEnumerator". Now I started recalling that we'd had the same problem a long time ago when we used foreach loop to traverse a collection of sites or something else - it doesn't matter anyway, all SharePoint collections inherit the SPBaseCollection which implements the interface System.Collections.ICollection. The code then had compiled successfully but in runtime when it ran up to the method with the foreach, the application crashed with a runtime exception saying "Method not found: System.Collections.IEnumerator Microsoft.SharePoint.SPListCollection.GetEnumerator.". It looked like the collection object did not have the method GetEnumerator in runtime...

I searched in Google and found a few messages from people having the same problem but no one could answer them. I decided to dig it up to understand what really happened. I examined Microsoft.SharePoint.dll (from GAC) and STSSOAP.dll (it's in C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\ISAPI\BIN\). STSSOAP.dll contains SharePoint web services (Lists.asmx, Dws.asmx, etc.). Nothing was suspicious. SPBaseCollection really implements ICollection and its metod GetEnumerator. Also STSSOAP.dll references Microsoft.SharePoint.dll with assembly version 11.0.0.0. No application or publisher policy that might override versions existed.

I ran once again my console application that called SharePoint web service, launched Process Explorer and looked at modules loaded into w3wp.exe. Microsoft.SharePoint.dll assembly had version 11.0.0.0 and was loaded from the GAC. OK, I looked at STSSOAP.dll and here it was. There were two copies of it loaded into w3wp.exe with the same assembly version - 11.0.0.0! They were different in File Versions. The first one was 11.0.6361.0 (file version) and loaded from the Temporary ASP.NET Files (ASP.NET copies web application assemblies over there) and the second assembly was 11.0.4920.0 and loaded from the GAC.

I compared these assemblies and they were different in size: the 6361 was 200K, the 4920 - 180K. Both assemblies had the same Assembly Version - 11.0.0.0! And both referenced Microsoft.SharePoint.dll with Assembly Version 11.0.0.0. Moreover, the 6361 assembly was copyrighted all-right but the 4920 was marked "Unpublished work.". Cool, isn't it? :-) By the way, it's a good idea to put strings like "Unpublished work" before your application is released, but I guess you shouldn't distribute it before you remove such a string... :-) Anyway, after I had removed this unpublished assembly from the GAC everything worked like it should.

Now I wonder where it came from...

Posted on Wednesday, March 23, 2005 7:31 PM SharePoint | Back to top


Comments on this post: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Hi, Stas! Is it possible to get a copy of this "Unpublished work"?
Left by Maxim Tarassenko on Jul 20, 2005 11:21 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
I have checked about what you have said. There is only one version of the Soap dll. But still the problem persists.

Any clues?
Thanks in Advance.
Left by Amit Hiremath on Sep 09, 2005 10:13 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Hi, Stas.
As i can tell you know quite a bit about Sharepoint. I have a few questions as I am starting to learn and wanted to find out if you'd be willing to point me in the right direction, so far I have experienced simple problems such as locating Microsoft.Sharepoint.dll for example.
I don't have Win03 and therefore cannot non-portal Sharepoint. Hence unable to test my solution. Any suggestions?
spasibo
Left by CBETA on Sep 18, 2005 7:59 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Sveta, it's impossible to install WSS20/SPPS2003 on the OS other than Win2003. Drop your email, anyway.
Left by Stas on Sep 19, 2005 7:42 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Amit, no clues so far. Did you find the solution?
Left by Stas on Sep 19, 2005 7:43 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Would be interesting to know if service pack 2 fixed this
Left by Ted on Oct 20, 2005 12:36 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
I've just had this issue also. I checked my GAC and I only had the one DLL.

However I checked my syntax on my code which was:
Dim UserGroup As New AddUserWS.UserGroup
UserGroup.Credentials = System.Net.CredentialCache.DefaultCredentials
UserGroup.AddUserToRole("Reader", "nib\Employees", "test@t.com", "All Users", "")

And I found that I had the items in the string the wrong was round. They should have been:

Dim UserGroup As New AddUserWS.UserGroup
UserGroup.Credentials = System.Net.CredentialCache.DefaultCredentials
UserGroup.AddUserToRole("Reader", "All Users", "nib\Employees", "test@t.com", "")

Then the error went away!
Left by Daniel on Nov 03, 2005 1:13 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
I get the following exception

Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at SharepointPublisher.SharePointServices.Lists.AddAttachment(String listName, String listItemID, String fileName, Byte[] attachment) in f:\sharepointpublisher\web references\sharepointservices\reference.cs:line 213
at SharepointPublisher.Form1.m_btnPublish_Click(Object sender, EventArgs e) in f:\sharepointpublisher\form1.cs:line 341
Left by Sabry Guen on Mar 23, 2006 4:24 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
try
{
SharePointServices.Lists service = new Lists();
service.Url = "http://localhost/_vti_bin/Lists.asmx";
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

string attachemtRes = service.AddAttachment(m_cmbList.Text, "3", "sab.doc", m_bytes);

MessageBox.Show(attachemtRes);
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
Left by Sabry Guen on Mar 23, 2006 4:26 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Please help
Left by Michael on Sep 02, 2006 4:17 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
I faced the same problem in MOSS 2007 / WSS v3.0 and I have found the solution.

http://chongtingfong.blogspot.com/2007/05/microsoftsharepointsoapserversoapserver_08.html
Left by CHONG Ting Fong on May 08, 2007 9:07 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
This is my code:

PermissionsMoss.Permissions permService = new PermissionsMoss.Permissions();
permService.Credentials = System.Net.CredentialCache.DefaultCredentials;

XmlNode ndPermissions = permService.GetPermissionCollection("PTSDSPS", "Site");

I find the same question.

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown."} System.Exception {System.Web.Services.Protocols.SoapException}

please give some helps.
tx
Left by herry on Jan 15, 2008 12:30 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Hi All,
I am facing problems with that exception when working with Forms (Form Library).. it was properly working one day ago and all of a sudden, today I got that exception. I did all the steps of creating/uploading/connecting the form but nothings changed.. :-(

Don't know what more to do..
stella
Left by Stella on Jul 15, 2009 10:34 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
In my case SP2 installation has not resolved the issue.
Trying GetListCollection() method still getting:
Message="Server was unable to process request. ---> The type initializer for 'Microsoft.SharePoint.SoapServer.SoapServerException' threw an exception. ---> Could not load file or assembly 'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542) ---> Could not load file or assembly 'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542) ---> Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)"
Left by Alex on Oct 15, 2009 9:02 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
Is it possible to get a copy of this "Unpublished work"? Thanks.
Left by Download Torrents on Jan 21, 2011 6:32 AM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
What console application do you use?
Left by Chris on Aug 16, 2011 2:12 PM

# re: Exception of type Microsoft.SharePoint.SoapServer.SoapServerException was thrown
Requesting Gravatar...
hi, thank you for information about this topic.
I am new for sharepoint, i had same problem. For two days i try to fix it.



But i can not understand this on your comment.

"I had removed this unpublished assembly from the GAC everything worked like it should. "

could you please more detailed explain, where from do you removed and i dont know what is GAC.

thank you in advance

Left by GOKCE on Oct 25, 2011 4:28 PM

Your comment:
 (will show your gravatar)


Copyright © Stas Kondratiev | Powered by: GeeksWithBlogs.net