cancel
Showing results for 
Search instead for 
Did you mean: 

Using Alfresco Webservice in .NET (VB.net)

maheshlinga
Champ in-the-making
Champ in-the-making
Hi,

I downloaded the project Dotnet2 ,which when I opened in Visual Studio and try build the solution, I was getting the following errors:

*************************************************************

Error   3   The best overloaded method match for 'Alfresco.WebServiceFactory.addSecurityHeader(Microsoft.Web.Services3.WebServicesClientProtocol)' has some invalid arguments   C:\Documents and Settings\mlinga\My Documents\alfresco-dotNet-0[1].2Beta\Alfresco\WebServiceFactory.cs   146   13   Alfresco
Error   4   Argument '1': cannot convert from 'Alfresco.AuthoringWebService.AuthoringService' to 'Microsoft.Web.Services3.WebServicesClientProtocol'   C:\Documents and Settings\mlinga\My Documents\alfresco-dotNet-0[1].2Beta\Alfresco\WebServiceFactory.cs   146   31   Alfresco
Error   5   The best overloaded method match for 'Alfresco.WebServiceFactory.addSecurityHeader(Microsoft.Web.Services3.WebServicesClientProtocol)' has some invalid arguments   C:\Documents and Settings\mlinga\My Documents\alfresco-dotNet-0[1].2Beta\Alfresco\WebServiceFactory.cs   172   13   Alfresco
Error   6   Argument '1': cannot convert from 'Alfresco.ActionWebService.ActionService' to 'Microsoft.Web.Services3.WebServicesClientProtocol'   C:\Documents and Settings\mlinga\My Documents\alfresco-dotNet-0[1].2Beta\Alfresco\WebServiceFactory.cs   172   31   Alfresco
Error   7   The best overloaded method match for 'Alfresco.WebServiceFactory.addSecurityHeader(Microsoft.Web.Services3.WebServicesClientProtocol)' has some invalid arguments   C:\Documents and Settings\mlinga\My Documents\alfresco-dotNet-0[1].2Beta\Alfresco\WebServiceFactory.cs   185   13   Alfresco
Error   8   Argument '1': cannot convert from 'Alfresco.AccessControlWebService.AccessControlService' to 'Microsoft.Web.Services3.WebServicesClientProtocol'   C:\Documents and Settings\mlinga\My Documents\alfresco-dotNet-0[1].2Beta\Alfresco\WebServiceFactory.cs   185   31   Alfresco
*************************************************************
I am .net developer intend to us the Alfresco webservices.

Alfresco is running on Tomcat server in my system.I want to use local alfresco webservices.
Is there any thing to change in the project like Webservice reference to get rid of those errors?

Else could any one pls post a .NET sample code of using local Alfresco webservices ,just to show me the Way I have to approach.An example like uploading an image to local alfresco server will really help.

Thanks in advance.
Mahesh
15 REPLIES 15

mightycoco
Champ in-the-making
Champ in-the-making
Hi jharrop,

I tried you approach but still cannot use the WebServiceFactory.cs to connect to Alfresco.

I'm using VS2005, WSE 3.0, Alfresco 3.0b (Ubuntu Server), C#

Compiling the DotNet2 examples or my own app throws following error:

C:\…\WebServiceFactory.cs(111,13): error CS1502: The best overloaded method match for 'Alfresco.WebServiceFactory.addSecurityHeader(Microsoft.Web.Services3.WebServicesClientProtocol)' has some invalid arguments

Argument '1': cannot convert from 'OLAlfrescoTransport.RepositoryWebService.RepositoryService' to 'Microsoft.Web.Services3.WebServicesClientProtocol'

Alfresco is running inside an VMWare, VS is on the Host-OS

I couldn't access your info on http://dev.plutext.org/trac/plutext-client-word2007/browser/trunk/plutext-client-word2007/wse3policy... so I'm not sure if I have down the right thing…

Any more hints?

Thanks,
c0c0

rbenedict
Champ in-the-making
Champ in-the-making
This error:
Error 1 The best overloaded method match for 'WebServiceFactory.addSecurityHeader(Microsoft.Web.Services3.WebServicesClientProtocol)' has some invalid arguments

Can be solved by the following:
1. In Visual Studio, double-click on the error message.  This will take you to a code segment something like this:

AdministrationService administrationService = new AdministrationService();
administrationService.Url = endPointAddress + ADMINISTRATION_SERVICE_ADDRESS;
addSecurityHeader(administrationService);
return administrationService;

Right-click on the AdministrationService (in the first line of the above code segment) and select “Go To Definition”. This should take you to something like this in the service Reference.cs file:

public partial class AdministrationService : System.Web.Services.Protocols.SoapHttpClientProtocol {

Replace System.Web.Services.Protocols.SoapHttpClientProtocol with Microsoft.Web.Services3.WebServicesClientProtocol

That should do it.
Good luck!

nileshbhise
Champ in-the-making
Champ in-the-making
I am using Alfresco 3.2r2 with ASP.NET Web Services and still struggling to get it to work. I am using VS2010 as my IDE and in-turn WCF for Web Services

After a much of search I stumbled across a workaround to addSecurityHeader issue. When you generate Proxy code using SVCUTIL.EXE,
1. You can change binding from basicBinding to wsBinding and you will not get Missing security header error any more BUT you will get NoSOAPAction error which is caused by Binding mismatch. So I figured that changing Binding from basic to WS is of no use
2. you can change the config file security section to the following
<security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Digest"/>           
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
Now I get Expected HTTPS but got HTTP error.

I am no way expert on WCF or Alfresco. Can any expert use this information and help me further?

arasumurali
Champ in-the-making
Champ in-the-making
Where can I get the Dotnet2 project?

kaynezhang
World-Class Innovator
World-Class Innovator
Why not choose Apache Chemistry DotCMIS

anilkumarsahoo
Champ in-the-making
Champ in-the-making
I need to implement Alfresco in my web application.
So First I downloaded and installed WSE 3.0. So I got WSE setting 3.0 option in my project but how to implement Alfresco here.

I also tried by using DOTCMIS.dll, here also I got some error like "DotCMIS.Exceptions.CmisRuntimeException:ConnectFailure"

Can any one guide me. It's very important for me.