Skip to main content
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

Uniface 9: WS call-out and occurrence data type

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

15 replies

Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Gianni: I've seen it because it referred in the Web Services chapter, my reply was to better explain. However, I don't think it's possible to define a variable that maps an entity.

rogerw said Hi, if you just have to move around an "simple" occurrence or entity it will probably work. The problem with Uniface and web-services is usually complex data-types. C#, Java etc. languages handles these by objects and serialization/deserialization. Uniface have tried to manage these problems by structs. Everyone who has used Uniface structs know that they are quite difficult to program. Especially then, you would really want some intelliSense behaviour into Uniface. 

Hi RogerW, bingo: 286 complex type + 100 simple type + xsd defined in data stream = funny and pessimistic coding days... Thanks Regards Claudio


Author: Claudio (claudio.palladini@cortislentini.it)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Hi, if you just have to move around an "simple" occurrence or entity it will probably work. The problem with Uniface and web-services is usually complex data-types. C#, Java etc. languages handles these by objects and serialization/deserialization. Uniface have tried to manage these problems by structs. Everyone who has used Uniface structs know that they are quite difficult to program. Especially then, you would really want some intelliSense behaviour into Uniface. Regards RogerW.


Author: rogerw (roger.wallin@abilita.fi)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Claudio said Hello, thanks, I've already read that chapter, before my OT. What I mean is the capability to DIRECTLY use entity/occurrence w/o any conversion and between procedures/functions and not only related to WS. Something like this (in Java):

... Kind Regards Claudio  

Hi Claudio, Entity and Occurrence parameters can be widely used into Proc Language since U7 (about 20 years!). Uniface Library includes current params/endparams block syntax: ********** ********** ********** ********** ********** ********** params Define the parameter block for an operation, entry, or global Proc. params DataType ParamName : Direction {DataType} FieldName.EntityName{.ModelName} : Direction {DataType} $ComponentVarName$ : Direction {byRef} | {byVal} struct ParamName : Direction entity EntityName{.ModelName} : Direction occurrence EntityName{.ModelName} : Direction xmlstream [DTD:DTDName] ParamName : Direction endparams ********** ********** ********** ********** ********** ********** Another subject are User-Defined functions. Again from current Uniface Library: ********** ********** ********** ********** ********** ********** User-Defined Functions In Uniface, it is possible to create user-defined functions that can be used in the Proc language just as any other function. To define your own function, define an entry with a return type. On the first line after entry, use the returns statement to define the return type. ********** ********** ********** ********** ********** ********** Just click on links provided to go directly to the online version of Uniface Library (Thanks Arjen for the tip!) Hope it helps... Gianni


Author: gianni (gianni.sandigliano@unifacesolutions.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Hello, thanks, I've already read that chapter, before my OT. What I mean is the capability to DIRECTLY use entity/occurrence w/o any conversion and between procedures/functions and not only related to WS. Something like this (in Java):

public MyEntity myFunction(MyEntity c){   MyEntity a;   a = c;   return a; } Kind Regards Claudio


Author: Claudio (claudio.palladini@cortislentini.it)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

And here is the link to the text Gianni is referring to.


Author: Arjen van Vliet (arjen.van.vliet@uniface.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Claudio said
diseli said Hello Claudio, Changing the parameter from Occurrence to string should work. In that case v_xml would contain the XML returned for the parameter Loginresult. Kind regards, Daniel  
Thanks, I suspected it. a little OT, it's in the roadmap of Uniface development to provide the possibility to define and use entity or occurrence variables? Kind Regards Claudio  

Ciao Claudio, Nice to see you solved...about your request for more functionalities: it's already there! ...as reported into the Uniface Library; this is the beginning of the related chapter:  ********** ********** ********** ********** ********** ********** Generating Complex Parameters for Web Services When importing a WSDL, a parameter containing complex data is defined as a string data type. As the developer, you need to provide the complex data as a well-formed XML string. To help in this task, you can use the /gen switch to generate example XML and/or entities. The XML example created by /gen describes what is required for the parameter, so you do not need to be an expert in deciphering WSDL files. However, some knowledge of XML schemas is required. For example, the allowed value content of a schema data type is not described in the XML example. Contents of types derived from those schema types are described, in terms of the schema facets. For more information, see XML Parameter Template. To create the XML strings for web service IN parameters you can take any of the following approaches: Use the XML template purely as documentation for what must be provided. Modify the XML template and use it as a hard-coded string. Use the XML template in combination with Uniface Structs to generate the required parameter. What needs to be generated depends on how the parameter will be inserted into the envelope. For more information, see Complex Nested Parameters.   ********** ********** ********** ********** ********** ********** First times to consume external Web Services is a little bit tricky to use all Uniface available functionalities and a little experience is helping to avoid possible pitfalls.The critical part is to use /gen when importing it to avoid the manual generation of entities; my suggestion is to use a temporary "Application Model" for those entities to avoid mistakes and garbage into existing applmodels. Sometimes is still needed to use string data type taking charge of parsing the received XML into our program but number of times this is happening is decreasing with improvements in new Uniface versions (it is always better to use last Uniface version!); in this last context structs are helping a lot to easily recognize XML streams manually managing received data. Hope it helps. Gianni


Author: gianni (gianni.sandigliano@unifacesolutions.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

diseli said Hello Claudio, Changing the parameter from Occurrence to string should work. In that case v_xml would contain the XML returned for the parameter Loginresult. Kind regards, Daniel  

Thanks, I suspected it. a little OT, it's in the roadmap of Uniface development to provide the possibility to define and use entity or occurrence variables? Kind Regards Claduio


Author: Claudio (claudio.palladini@cortislentini.it)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Hello Claudio, Changing the parameter from Occurrence to string should work. In that case v_xml would contain the XML returned for the parameter Loginresult. Kind regards, Daniel


Author: diseli (daniel.iseli@uniface.com)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

diseli said Hello Claudio, This would only work if you would define the OUT parameter Loginresult as string (instead of as an Occurrence parameter). Hope this helps. Kind regards, Daniel  

Thanks, but Uniface "have decided" to import the WSDL parameter as occurrence type. Changing it, could cause interface not working? I suppose I just need to test it.. Thanks Kind Regards Claudio


Author: Claudio (claudio.palladini@cortislentini.it)
Jan Cees Boogaard
Rocketeer
Nov 19, 2018 11:38 AM UTC

WS call-out and occurrence data type

Author: claudio.palladini@cortislentini.it (Claudio)

Hello, I've imported a WSDL with Uniface (9.6.05.01 - 0519_1) and now I've my SOAP signature like this:

PARAMETER IN OUT DATA TYPE
Loginresult   X Occurrence
Username X   String
Password X   String

  The call-out work "quite" fine, but result in some unwanted behaviuors: 1) It add an occurrence in the focused entity, where my calling button is placed, with contents of the "loginresult" out parameter. 2) The variable passed to parameter "loginresult" it's EVER empty. My question is: what's the correct way to handle this kind of parameters?   Thanks all Claudio

Hello Claudio, This would only work if you would define the OUT parameter Loginresult as string (instead of as an Occurrence parameter). Hope this helps. Kind regards, Daniel


Author: diseli (daniel.iseli@uniface.com)