Skip to content

Examples of calls for the Colectica API with generated java and C# clients

Notifications You must be signed in to change notification settings

pierreDebuisson/ColecticaSwaggerExamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colectica Swagger Examples

Java CSharp
Build Status comming soon !

NOTE : Colectica Portal with Swagger API enabled are required to use these examples.

How to generate the Swagger API

  • Download the JDK 7 or higher here
  • Download Maven here
  • locate the swagger.json file
  • locate your Colectica Portal directory
  • execute the following commands

Start the server

With command prompt

cd ColecticaPortal;
colectica.portal.exe

With bash Terminal

cd ColecticaPortal;
./colectica.portal.exe

alt tag

Generate the source code of the client library

Clone the Swagger-codegen source code

git clone https://github.com/swagger-api/swagger-codegen;
cd swagger-codegen;
mvn clean package;
java -jar swagger-codegen-cli.jar generate -i http://localhost:5000/swagger/v1/swagger.json -l java -o c:\YourTargetJavaFolder;
java -jar swagger-codegen-cli.jar generate -i http://localhost:5000/swagger/v1/swagger.json -l csharp -o c:\YourTargetCSharpFolder

Or download from maven here and run :

java -jar swagger-codegen-cli.jar generate -i http://localhost:5000/swagger/v1/swagger.json -l java -o c:\YourTargetJavaFolder;
java -jar swagger-codegen-cli.jar generate -i http://localhost:5000/swagger/v1/swagger.json -l csharp -o c:\YourTargetCSharpFolder

Build the client library

CSharp

  • Open Visual Studio
  • Create a new project .NetFramework library alt tag
  • Add the folder Colectica.RestClientV1 to the folder of the new project alt tag
  • Build the .dll file alt tag

Java

  • Open your favorite Java IDE
  • Import the Java/swagger Folder in your project alt tag
  • Export your project as a .jar file

alt tag

Use the client library

CSharp

  • Add the reference of the dll to your client project via project --> Add ---> reference

Java

  • Add the dependencies to your Java Build Path (i.e .jar) + swagger.jar (library previously built) alt tag

About

Examples of calls for the Colectica API with generated java and C# clients

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages