AnsweredAssumed Answered

Using RepositoryService to upload a file in C#

Question asked by uheber on Jan 13, 2010
Latest reply on Jan 15, 2010 by uheber
Hello community,

currently we evalute the enterprise edition of Alfresco_3.1 as a new document management system in our company. As development environment we use Visual Studio 2008 and the web services example "dotNET" (http://forge.alfresco.com/frs/download.php/80/alfresco-dotNet-0.2Beta.zip).

After solving minor issues with calling Alfreco web services (Tutorial » http://sangosthi.blogspot.com/2009/04/calling-alfresco-web-services-from-c.html) the application can be built. But during execution the ImageUploadExample or ImageUploadExample2 we get an exception 

   on System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   on System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   on Alfresco.RepositoryWebService.RepositoryService.update(CML statements) in U:\InfoPath\Alfresco\alfresco-dotNet-2\Alfresco\Web References\RepositoryWebService\Reference.cs:Line 356.
   on Samples.ImageUploadExample.btnUpload_Click(Object sender, EventArgs e) in U:\InfoPath\Alfresco\alfresco-dotNet-2\Samples\ImageUploadExample.cs:Line 110.
  
when the repository service is called:
  
UpdateResult[] updateResult = repoService.update(cml);

All other web service examples work fine.

There may be problems in use Visual Studio 2005 vs. 2008? I have read, in VS2005 will be used the WSE 3.0 (Web Services Enhancements) framework which in VS2008 is obsolete. Microsoft uses for it in VS2008 the WCF (Windows Communication Foundation) framework. Are there any problems if the application is built?

The second question is, why are the content (reference.cs) of web services are different? When I create a new class library and add a web service from WSDL (eq. http://localhost:8080/alfresco/wsdl/repository-service.wsdl), the content of this service is in the object browser different than the original from the Alfresco project example "dotNET". 

The file upload via web service is an important feature, which our prototype must be have. Is there a working example, which was developed in VS2008 and use this service?

Thank you for your help. 

Best Regards,
Uwe

Outcomes