cancel
Showing results for 
Search instead for 
Did you mean: 

Access Control WSDL does not work in .Net

deane
Champ on-the-rise
Champ on-the-rise
I purchased the "Alfresco 3 Web Services" book. I downloaded the samples and am attempting to compile the Alfresco library for .Net.

I have a problem, which, I've learned, a lot of other people have too.  It seems to be a general problem with the WSDL file for the Access Control service.  (I don't think it has anything to do with the book or these code samples specifically.)

When trying to update the AccessControlWebService in Visual Studio, I get this error:

The custom tool 'MSDiscoCodeGenerator' failed.  Unable to import binding 'AccessControlServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/accesscontrol/1.0'.

Updating from this WSDL is what generates the class file.  Without this class file, I cannot build the project.

This is the only one of the nine WSDLs in the project that won't update and generate a class file.  The other eight work just fine.

I thought maybe it was a Visual Studio problem, but it won't update from the command line either.

I've Googled and prowled these forums for hours, and found that lots of other people have the problem as well.  In fact, this topic is the same problem:

Problem with Access Control Web Service

Someone created the thread, and a bunch of other people chimed in with "has anyone found a solution?"

Later in the thread, Piergiorgio Lucidi himself (author of the aforementioned book) chimes in with a code snippet that he says is the corrected WSDL file.  However, one message under that says it didn't work, and, indeed, it didn't work for me either.  The update fails with the exact same error.

The thread is unresolved.

I have RTFMed up, down, and sideways on this.  I've whittled it down to the fact that perhaps this WSDL just isn't compatible with .Net for some reason.  (I'm not aware this is even possible – a WSDL is a WSDl is a WSDL…right?)

So, this is a final plea.  Does anyone know what the problem is here?

Deane
6 REPLIES 6

pmonks
Star Contributor
Star Contributor
Just out of interest, any specific reason you're not using CMIS [1], either the SOAP binding [2] or (preferably) the REST binding [3]?  There are CMIS client libraries for various languages available from the Apache Chemistry project [4], including a .NET client library [5] (which appears to be a work-in-progress - YMMV).

The "CML" Web Services you're referring to here date from pre-Alfresco v1.0 and have been superceded for quite some time - first by custom Web Scripts [6] (Alfresco v2.1 - 2007 timeframe), then by CMIS (Alfresco v3.3 - 2010 timeframe), with custom Web Scripts for anything that the CMIS specification doesn't cover (Workflow, Records Management, Transfer, etc.).  I have no idea why a reasonably recent book such as "Alfresco 3 Web Services" recommends a superceded API such as that one…

FWIW one possible explanation for the specific issue you're seeing is that Apache Axis 1.x (which Alfresco uses for providing the CML Web Services) can produce WSDLs that, while valid, cannot be handled correctly by .NET.  I ran into this issue in a big way in a past life (which had nothing to do with Alfresco), but the specifics have been lost in the haze of time.  In that case the solution was to ditch Axis and use something else, which also happens to be what Alfresco does when handling the SOAP CMIS binding (we use the more modern Apache CXF library for the CMIS Web Services binding).

Cheers,
Peter

[1] http://wiki.alfresco.com/wiki/CMIS
[2] http://wiki.alfresco.com/wiki/CMIS#Web_Services_Binding
[3] http://wiki.alfresco.com/wiki/CMIS#RESTful_AtomPub_Binding
[4] http://chemistry.apache.org/
[5] http://chemistry.apache.org/dotnet/dotcmis.html
[6] http://wiki.alfresco.com/wiki/Web_Scripts

mrogers
Star Contributor
Star Contributor
These "old" web services are low priority however I spent some time last year trying to understand the issues.

There was a long standing problem with the Dictionary service WSDL that I applied a community fix.    But I can find nothing reported about the Access Control Web Service.

I also asked our test team to check out the web services with regard to .Net since there are a couple of Visual Studio issues reported and their response so far is that they are O.K. but there are some "documentation issues."  

If there is an Alfresco issue please make sure its in JIRA (issues.alfresco.com) and if anyone can help diagnose this particular ".Net" issue then that will help as well.

deane
Champ on-the-rise
Champ on-the-rise
Thanks guys.

So, I'm going to reiterate the key takeaway for people who come along later (and they will…): the old SOAP services are no good and there are now better options.

Weird that the book devotes the first chapter to something that "predates Alfresco 1.0."

pmonks
Star Contributor
Star Contributor
Weird that the book devotes the first chapter to something that "predates Alfresco 1.0."

You can say that again.  :?

ugocei
Champ in-the-making
Champ in-the-making
As the other author of the aforementioned book, let me please clarify some points that were raised in this thread. Unfortunately I can't be of much help with your problem, as I know pretty much nothing about .Net.

First, I agree with Peter when he says that people should move to more modern APIs like CMIS. That said, however, I find it a bit unfair for him to criticize the book for dedicating pages to a "superceded" API.

Actually, if you look up "Web Services" on the Alfresco Wiki (the foremost resource for many developers) you will find this page: http://wiki.alfresco.com/wiki/Alfresco_Content_Management_Web_Services. I couldn't find any hint on it, and on pages linked form it, about a deprecation of the Web Services APIs. I am sure I would be able to find some clues, if I searched hard enough, but they are hardly evident.

If you download the Alfresco SDK, you will find a client library and some sample of the usage of Web Services APIs. I would suggest that Alfresco start offering the WS toolkit as a separate download only, with a prominent notice about it being deprecated and recommended only for legacy projects.

Finally, please consider that when we started writing the book, Alfresco 3.3 had not yet been released, so there were exactly zero CMIS 1.0-compliant implementations available. The publishers of the book hadn't even heard of CMIS and it was me, personally, who pushed for the inclusion of a whole section on CMIS, which in the end made up a third of the book. I did this because I was confident that, by the time the book hit the shelves, Alfresco 3.3 would have been released and that it would have included a usable, bug-free implemetation of CMIS 1.0. All of the samples about CMIS that you can find in the later chapters were revised to work against Alfresco 3.3 in the last few days before committing the final revision.

This just to set the record straight Smiley Happy

  Ugo

pmonks
Star Contributor
Star Contributor
To clarify one point, the Alfresco SOAP API is not "deprecated" - it is still maintained and supported.  There are, however, better alternatives (Web Scripts, REST & CMIS) - those APIs have superceded the original SOAP API.