cancel
Showing results for 
Search instead for 
Did you mean: 

Repository Service from .NET?

emrobi
Champ in-the-making
Champ in-the-making
I am attempting to use the repository-service.wsdl from within a Visual Studio 2003 (.Net 1.1) C# program, but get the following error:

C:\svn\research\nexus\Alfresco\Web References\Repository\Reference.map(1): Custom tool error: Unable to import WebService/Schema. Unable to import binding 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'. Unable to import operation 'query'. Element message named QueryConfiguration from namespace http://www.alfresco.org/ws/service/repository/1.0 is missing.

Here's what I've done so far:

- Downloaded and installed Alfresco 1.1.2 (with tomcat) on an Ubuntu Linux machine. Working just fine.
- Downloaded the source for Alfresco 1.1.2 onto my Windows box.
- Using the WSDL files from the source, added a Web Reference to authentication-service.wsdl. Seems to work just fine. Using the service, I can start and end a session against Alfresco on my Ubuntu Linux box.

However, when I try to add a web reference to 'repository-service.wsdl' I get the error described above.

I can successfully create web references to the other services (authoring, classification and content), but haven't tried to use them programmatically.

Any suggestions? Is anyone else using .Net with the web services?

Thanks,
Eric
12 REPLIES 12

gentyjp
Champ in-the-making
Champ in-the-making
Hi

  I have the same problem with Visual 2005 and gsoap ?

See my post about Web references.

  With gsoap I run wsdl2h against a wsdl who does an import of the types file, and it does not work. I think schema files should be available in the import location stated in the wsdl file.

    Did you manage to do something with it ?

   Thanks

   Jean-Paul

emrobi
Champ in-the-making
Champ in-the-making
I referenced the wsdl and schema files from the source – rather than a web server – and everything worked except the Respository Service. I still haven't been able to make that work.

I am currently using VS 2003, but I have VS 2005 installed and will try that in the near future.

I needed to demonstrate my application working with a content management system. I had hoped to use Alfresco, but since I am on a tight schedule no one responded to my issue, I switched to using Sharepoint and was able to make that work for my purposes.

I would rather use Alfresco than Sharepoint, so if anyone can provide any insight on how to get the Repository service to work with Visual Studio .NET, I would appreciate it.

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

Have you tried with the latest version (1.2.x) wsdl files.

I know that some the of wsdl file have been tidied up since 1.1 and maybe the repository-service.wsdl has some invalid references that did not cause problems with other languages, but do in .NET.

If you still have no luck, let me know and I'll endevour to setup a .NET client here to iron out the problem.

Thanks,
Roy

gentyjp
Champ in-the-making
Champ in-the-making
Hi

For my first problem, it appears we can't use the following URL with some WSDL tools coz some xsd files are missing.

http://www.alfresco.org/specification/ws/service/content/1.0/content-service.wsdl

If I use a local address from an installed Alfresco war file, this problem disappears.

About the repository-service.wsdl problem, here are the gsoap messages

Warning: element 'xsd:unique' at level 2 was not recognized and will be ignored
Warning: element 'xsd:selector' at level 3 was not recognized and will be ignored
Warning: element 'xsd:field' at level 3 was not recognized and will be ignored
Warning: element 'xsd:keyref' at level 2 was not recognized and will be ignored
Warning: element 'xsd:selector' at level 3 was not recognized and will be ignored
Warning: element 'xsd:field' at level 3 was not recognized and will be ignored
Warning: element 'xsd:keyref' at level 2 was not recognized and will be ignored
Warning: element 'xsd:selector' at level 3 was not recognized and will be ignored
Warning: element 'xsd:field' at level 3 was not recognized and will be ignored
Warning: element 'xsd:keyref' at level 2 was not recognized and will be ignored
Warning: element 'xsd:selector' at level 3 was not recognized and will be ignored
Warning: element 'xsd:field' at level 3 was not recognized and will be ignored
Connecting to 'http://jpgacer:8080/alfresco/wsdl/types.xsd' to retrieve relative
'types.xsd' schema… connected, receiving…
Warning: could not find header part QueryConfiguration message
   "http://www.alfresco.org/ws/service/repository/1.0':QueryConfiguration in WSDL definitions
      repository-service namespace http://www.alfresco.org/ws/service/repository/1.0
Warning: could not find header part QueryConfiguration message
   "http://www.alfresco.org/ws/service/repository/1.0':QueryConfiguration in WSDL definitions
      repository-service namespace http://www.alfresco.org/ws/service/repository/1.0
Warning: could not find header part QueryConfiguration message
   "http://www.alfresco.org/ws/service/repository/1.0':QueryConfiguration in WSDL definitions
      repository-service namespace http://www.alfresco.org/ws/service/repository/1.0
Warning: could not find header part QueryConfiguration message
   "http://www.alfresco.org/ws/service/repository/1.0':QueryConfiguration in WSDL definitions
      repository-service namespace http://www.alfresco.org/ws/service/repository/1.0
Error in SOAP Header part definition: input part '?' missing?
Error in SOAP Header part definition: input part '?' missing?
Error in SOAP Header part definition: input part '?' missing?
Error in SOAP Header part definition: input part '?' missing?

To obtain this, you just have to uncompress the gsoap archive and point wsdl2h on a local WSDL definition.

.\wsdl2h -o repositoryservice.h http://myhost:8080/alfresco/wsdl/repository-service.wsdl

On Visual 2005 I have the same message as Emrobi.

  I think that if you manage to have gsoap working, Visual should not be far from ok.
  If it can save you some time by not installing Visual, just test with gsoap and send me the corrected files, I transmit you my tests with Visual.

   Jean-Paul

emrobi
Champ in-the-making
Champ in-the-making
Per Roys suggestion, I downloaded the latest source code (1.2.x RC2) and tried the WSDL files from it. I have also switched my development environment to VisualStudio 2005.

When attempting to add a Web Reference to the Repository-service.wsdl, I get the following error:

"Custom tool error: Unable to import WebService/Schema. Unable to import binding 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'. Unable to import operation 'query'. Element message named QueryConfiguration from namespace http://www.alfresco.org/ws/service/repository/1.0 is missing."


If I run "WSDL.EXE repository-service.wsdl" from the command-line, I get the following output:

Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Warning: This web reference does not conform to WS-I Basic Profile v1.1.
R2716: A document-literal binding in a DESCRIPTION MUST NOT have the namespace attribute specified on contained soapbind:body, soapbind:header, soapbind:headerfault and soapbind:fault elements.
  -  soapbind:fault 'RepositoryFault' on operation 'createStore' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'getStores' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'query' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'queryChildren' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'queryParents' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'queryAssociated' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'fetchMore' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'update' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'describe' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  -  soapbind:fault 'RepositoryFault' on operation 'get' on portType 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.

For more details on the WS-I Basic Profile v1.1, see the specification at http://www.ws-i.org/Profiles/BasicProfile-1.1.html.

Error: Unable to import binding 'RepositoryServiceSoapBinding' from namespace 'http://www.alfresco.org/ws/service/repository/1.0'.
  - Unable to import operation 'createStore'.
  - The datatype 'http://www.alfresco.org/ws/model/content/1.0Smiley FrustratedtoreEnum' is missing.

Eric

pmarreddy
Champ in-the-making
Champ in-the-making
hi,

i am not sure it will work but worked for me just try to remove these statements from the binding part all teh statements which says

<wsdl:documentation>xxxxxx.</wsdl:documentation> i think it should work. i know documentation should not give an error but some how it is giving .

thanks prasanth

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

I've installed VS2005 and produced a simple browse example that uses the repository and content web services.

I was able to reproduce the issue you saw with the repository service and it is now fixed (it was because of a mistake in the WSDL that no other language picked up!).

The .NET sample code has been checked-in and will be available in the source bundle of the next release (in projects/extensions/dotNet2) or from SVN now.

We intend to extend this further to provide an Alfresco assembly that contains the web references and a number of helper classes making Alfresco .NET development easier (you'll see the beginings of this in the next release).

If you can't wait until the next release (should be within the next week) drop me a line and I can tell you what to change in the WSDL and in the server config to get things working.

Cheers,
Roy

gentyjp
Champ in-the-making
Champ in-the-making
Thanks Roy !!!

   The .NET accessibility package is definitly a good idea and surelly will be appreciated by a lot of us.

   For my own application, frontal web site will use the PHP Library and heavy production tools will use the .NET package.

     Thanks again

   Jean-Paul

emrobi
Champ in-the-making
Champ in-the-making
I've built the latest from Subvesion and it's working just fine with my .NET app under VS 2005.

The sample code was a great help as well.   Thanks.