Is there an example C# project?

  • 3
  • Question
  • Updated 3 years ago
  • Answered
I'm working on a way to make Replicon easier to use for people at my company through an app written in C#. However, the only example I've found (RepliConnectLinqExample) references very obscure namespaces and doesn't compile. I'm having no luck finding a better example of how to connect to Replicon externally. I really hope there's a better set of examples or a demo app somewhere because the documentation is extremely light in this area. It seems to assume that you've already connected and that you know exactly what you're doing, which is not the case for me.

(Originally posted by bandtank)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes

Posted 4 years ago

  • 3
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi,

Thank you for using Replicon Community.

Steps on how to connect to Replicon externally are provided at the below URL:- 

Getting Started with the RepliConnect API (refer to Accessing RepliConnect via a Static URL or Accessing RepliConnect API sections.)

For a complete example of C# refer to the Example of a Complete Request using C# section on the same page. 

Feel free to contact our support team should you face issues with your C# code. 



Thanks,

Lingaraj



 

(Originally posted by Lingaraj Dharwad)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
I already tried that example project, but there's no instructions about how to actually get it to compile. I installed NewtonSoft-Json via package manager, but there are still 20+ compilation errors. Specifically, the errors seem to be related to missing classes or references, but I have no idea what to add because there's no documentation. 1) JavaScriptObject - "C#: Unknown type 'JavaScriptObject'" 2) JavaScriptArray - "C#: Unknown type 'JavaScriptArray'" 3) new JsonReader(reader) - "An instance of an abstract class can not be created." I would send this directly to support, but this kind of stuff needs to be available to the public because your example documentation is very incomplete.

(Originally posted by bandtank)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi,

Thanks for your suggestion, we will have the required changes made and make this available to everyone soon. 

Thanks,

Lingaraj



(Originally posted by Lingaraj Dharwad)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Can you post the new code to this question.

(Originally posted by tony.klotz)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Please post the new code for this question.

(Originally posted by tony.klotz)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi Tony,

Please find attached a sample program in REST method for getting a specific project details.

Kindly rename the extension from .txt to .cs.

Thanks,
Lingaraj




(Originally posted by Lingaraj Dharwad)
Photo of hussain

hussain

  • 7 Posts
  • 0 Reply Likes
Ok i will try with this Thank you Lingaraj
Photo of hussain

hussain

  • 7 Posts
  • 0 Reply Likes
Hi Lingaraj,

I tried with the code you provided but i still getting the same error 401 Unauthorize, please confirm do i need to change any thing else except username and password and company?, it seems nothing else needs to change
Photo of Lingaraj Dharwad

Lingaraj Dharwad, Product Champion

  • 1100 Posts
  • 46 Reply Likes
Please ensure you are set up with all the major roles & permissions: Billing Manager, Payroll Manager, Project Management Administrator, Cost Manager and others which are available in your account. Note that not all may be applicable to your specific instance. 

The screenshot below shows how your profile should ideally show up: 



If issue still persists, kindly contact the support team as this needs further investigation.

Regards,
Lingaraj
Photo of Dean Holden

Dean Holden

  • 1 Post
  • 0 Reply Likes
I'm looking for a C# example for CreateReportGenerationBatch .  Is there one out there somewhere?  I found the Sample_Report_Generation example very helpful, but I have some reports that timeout, so I need to run them in the background.

Thanks,
Dean
Photo of Sayantan Choudhury

Sayantan Choudhury, Tier 3 Cloud Operations Engineer

  • 7 Posts
  • 1 Reply Like
Hi Dean,

Please find the steps to Generate a report using batch as follows:

1. Use "ReportService1.svc/CreateReportGenerationBatch" service to get the ReportGenerationBatchURI.
Request JSON object sample:
{
  "reportParameters": [
    {
      "reportUri": "ReportURI",
      "filterValues": [],
      "outputFormatUri": "OutputFormatURI"
    }
  ]
}
Response JSON object sample:
{
  "d": "ReportGenerationBatchURI"
}

2. Use "BatchManagementService1.svc/ExecuteInBackground" service to execute the ReportGenerationBatchURI in background.
Request JSON object sample:
{
  "batchUri": "ReportGenerationBatchURI"
}
Response JSON object sample:
{
  "d": null
}

3. Use "BatchManagementService1.svc/GetStatus" service to get the status of the execution from the previous step.
Request JSON object sample:
{
  "batchUri": "ReportGenerationBatchURI"
}
Response JSON object sample:
{
  "d": {
    "batchUri": "ReportGenerationBatchURI",
    "creationTime": {
      "day": day,
      "hour": hour,
      "minute": minute,
      "month": month,
      "second": second,
      "year": year
    },
    "endTimestamp": {
      "day": day,
      "hour": hour,
      "minute": minute,
      "month": month,
      "second": second,
      "year": year
    },
    "executionState": "urn:replicon-service-model:batch-execution-state:succeeded",
    "items": [],
    "message": null,
    "name": "Execute",
    "overallProgress": {
      "currentProgress": number,
      "maximumProgress": number
    },
    "startTimestamp": {
      "day": day,
      "hour": hour,
      "minute": minute,
      "month": month,
      "second": second,
      "year": year
    }
  }
}
Keep repeating Step 3 at a specific interval and check the value of "executionState" from the response JSON Object until the value changes to "urn:replicon-service-model:batch-execution-state:succeeded" (check for the last sub string after ':' until the sub string is "succeeded"). Once the value is "succeeded", go to step 4. Note that if the data is huge, this might take a long time.

4. Use "ReportService1.svc/GetReportGenerationBatchResults" service to get the result of the ReportGenerationBatchURI that was created in step 1.
Request JSON object sample:
{
  "reportGenerationBatchUri":"ReportGenerationBatchURI"
}
Response JSON object sample:
{
  "d": {
    "reportGenerationResults": [
      {
        "error": null,
        "filterValues": [],
        "payload": "ReportContent",
        "reportUri": "ReportURI"
      }
    ]
  }
}
The "payload" field will contain the Report content.

NOTE: Do not use this service for regular report generation. Only use this service for pulling up large data.

Regards,
Sayantan
(Edited)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi Tony,

New code posted as an attachment on the post above.

Thanks,
Lingaraj


(Originally posted by Lingaraj Dharwad)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Can you post a javascipt example?

(Originally posted by tony.klotz)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi Tony,

We will have one of our specialists call you tomorrow. Please let us know a suitable time to contact you.

Thank You!



Replicon .

(Originally posted by Lingaraj Dharwad)