c# example res/json web API ?

Within this forum we want to offer discussions all around our .NET based Map control including all .Net-language specific questions concerning calls of the xServer-API. Attention: xServer-relevant concepts can be found in further forums such as xRoute or xTour.
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: c# example res/json web API ?

Post by Oliver Heilig »

Hello Stefan,

this seems to be a problem of the latest autorest version, we will check this. But you can also use my sample for xServer 2.19. The generated code contains methods for all services, for example

xServer.CalculateRoute
xServer.SearchLocations

Oli
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
stefan.rotaru
Posts: 7
Joined: Sat Mar 13, 2021 2:03 pm

Re: c# example res/json web API ?

Post by stefan.rotaru »

Hello Oliver,

Thank you for the response.
Can you please give me the link where I can find the generated code for the services in xServer 2.19?

Thank you.
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: c# example res/json web API ?

Post by Oliver Heilig »

Hello Stefan,

you can find the generated code in the attachment at https://xserver.ptvgroup.com/forum/view ... =733#p3634

But i think i have found the problem: The latest version uses a new beta C#-generator which seems to cause this problem.

https://github.com/Azure/autorest.csharp

You can use the old (working) generator by adding a --legacy parameter. Honestly this whole Swagger/OpenAPI stuff is still in its infancy, but you should give it another try.

Oli
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
stefan.rotaru
Posts: 7
Joined: Sat Mar 13, 2021 2:03 pm

Re: c# example res/json web API ?

Post by stefan.rotaru »

Works with --legacy parameter, thanks.
User avatar
Oliver Heilig
Posts: 154
Joined: Tue May 13, 2014 12:10 pm
Location: Karlsruhe, Germany
Contact:

Re: c# example res/json web API ?

Post by Oliver Heilig »

For your information:

Since the installation and usage of the autorest generator tool can be quite troublesome in some environments, we now also provide a download of the generated source code as part of the xServer C# client bundle.

Oli
Oliver Heilig
Chief Developer Logistic Services
PTV GROUP - Germany

https://github.com/oliverheilig/
Post Reply