Interface to ELSTER | Uniface 9 | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
Interface to ELSTER
20 Sep 2018
5:39 pm
Avatar
istiller
Member
Forum Posts: 299
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi freaks

We have to implement a interface to the german tax office software “ELSTER”.

Does anyone allready did this?
If yes, with or without a wrapper around the ELSTER API?

I’m trying to avoid another software between our software and ELSTER.

ELSTER does provide  “simple” C/C++ API but some of the parameters a C-structs and handles
My question is, how to implement this by pure UnifAce?

Every marketing guy from UnifAce allways tell us, how easy it is to use UnifAce, so there must be a simple solution in UnifAce 🙂

Ingo

25 Sep 2018
4:50 pm
Avatar
Mike Taylor
Admin
Forum Posts: 38
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Ingo,

A C struct is defined as an entity in Uniface and passed as an occurence. If an array of structs is required then it is passed as an entity. Be careful of C’s requirement for a null terminated strings. More information is availble in the documentation: Integrating with Other Technologies > C, C++, and Other 3GLs > Call-Out to 3GL > Activate Using Occurrence and Entity Parameters 

A handle in C does not have a clearly defined datatype as it just a method of identifying a single item (https://en.wikipedia.org/wiki/Handle_(computing) ) for these you will have to match the base type.

Regards,

Mike

26 Sep 2018
7:23 am
Avatar
istiller
Member
Forum Posts: 299
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

ThanX Mike Laugh

26 Sep 2018
10:18 am
Avatar
Arjen van Vliet
Member
Forum Posts: 184
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline
02 Nov 2018
4:06 pm
Avatar
istiller
Member
Forum Posts: 299
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Arjen van Vliet said

Mike Taylor said
Integrating with Other Technologies > C, C++, and Other 3GLs > Call-Out to 3GL > Activate Using Occurrence and Entity Parameters 
  

Integrating with Other Technologies > C, C++, and Other 3GLs > Call-Out to 3GL > Activate Using Occurrence and Entity Parameters  

next problem 🙂

I did solve the char* problem in a struct
Thanks to Arthur at the U.B.G, this is the solution in short :      activate $INST_SHLWAPI$.”STRDUPA”(v_STRHND,v_STR)

But now I’m facing another interesting challenge: How to transfer the NULL-Pointer?

Say, there is a declaration like    int fct(struct_t* apointer)
In Uniface you have to create a signature with one parameter which as an occurence e.g “STRUCT_T”
Now you call this by
activate v_INST.”OPER”(“STRUCT_T”)
Super, I can transfer a struct to a DLL

But wait, as the manual of the functions state, this parameter is optional and should be NULL sometimes
  activate v_INST.”OPER”(0)

 *grumble*  I got error -54

Define the parameter in signature as numeric/long solves the problem with NULL-pointer
But now it’s not possible to pass the struct anymore

But I need both versions

My workaround for the moment will be a few signatures, one version with occurence and one with numeric (for each such parameter)

Anyone a better idea?

@UnifAce:
  Such simple things is allways missing in UnifAce.
  We are developing for the real world not for mobiles in the desert (As heard on U.B.G in Kassel/Germany)

 

Gruß Ingo

02 Nov 2018
5:10 pm
Avatar
diseli
Admin
Forum Posts: 1045
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Ingo,

What’s wrong with the simple solution to create two operations? I’ve faced a similar problem in the past where a function requires different input or returns different results (string, numeric, structure, …). I simply created an operation for each scenario and it works just fine. Don’t really understand what is not simple about this.

It would of course be nice if it would be possible to specify different data types for a parameter in a signature or even define a signature dynamically at runtime. But alas, signatures definitions are quite static and in some scenarios you need “redundant” definitions to achieve the desired result. You’re facing a similar problem with COM Call-Out signature where a method returns different objects depending on the context. In this case you also need to create a separate operation for each object that could be returned. Could we come up with more elegant solutions? Sure. Is it really necessary? No, IMO the current functionality is sufficient enough for almost all use cases.

Instead of grumbling I’ve simply created a little tool that allows me to duplicate an operation of a signature. Simple. Smile

Don’t overthink it, just do it. Wink

Daniel

PS Have a nice weekend…

03 Nov 2018
9:00 pm
Avatar
istiller
Member
Forum Posts: 299
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

diseli said
Hi Ingo,

It would of course be nice if it would be possible to specify different data types for a parameter in a signature or even define a signature dynamically at runtime. But
Instead of grumbling I’ve simply created a little tool that allows me to duplicate an operation of a signature. Simple. Smile

PS Have a nice weekend…  

Hi Daniel

The first thing – after I analysing the problem und thinking about a workaround – was to build such program to duplicate signatures 😉

About the different types of parameters:
    There parameter(s) in question are pointers to a structure. And this pointers could be the NULL-pointer, not a different type.
    That the same “problem” with strings in UnifAce: An empty string is a different thing then a NULL-string
    On strings, UnifAce replace an empty string by NULL, but on entity-parameter this is not true 🙁

 About copiing the operations:
   As there is not only one struct parameter but some of them, if have to create 2^n operation, where n is the number of struct-parameters
   Not onyl, that one have to create this operations, you also have to find reasonable names for them

So, on 9.7.07 we got this kind of parameter (“”->NULL-pointer)
Or ? 🙂

Ingo
PS: also a nice (tail-)weekend

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online:
32 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1890

Iain Sharp: 680

Theo Neeskens: 371

gianni: 357

Adrian Gosbell: 318

istiller: 299

rogerw: 272

Knut: 229

lalitpct: 197

Arjen van Vliet: 184

Member Stats:

Guest Posters: 3

Members: 10982

Moderators: 0

Admins: 6

Forum Stats:

Groups: 1

Forums: 62

Topics: 2323

Posts: 10052

Newest Members:

greentipodent1976, NicolasHib, gipipufen1981, Alfredvax, Lesterpioto, crystalst3, otogsa12, Ramonmaw, harolddz1, Lariskawo

Administrators: admin: 23, diseli: 1045, Nico Peereboom: 84, richiet: 406, Mike Taylor: 38, JanCees: 39