Complex Nested Web services - Need an example PLEASE!!!
Author: martind@motorvia.co.za (Martind)
We need to be able to handle a nested tag as per example below. The forum suppresses the indentation and less than & great than signs....Replace them with curly brackets. The nested fields indentation has been forced below with "...." {?xml version = "1.0" ?} {Sender xmlns="urn:xxx/xxxx/xxxx/v1.0"} {Name}ABC{/Name} {/Sender} {Receiver xmlns="urn:xxx/xxxx/xxxx/v1.0"} {Name}CBA{/Name} {/Receiver} {CreationDateTime xmlns="urn:xxx/xxxx/xxxx/v1.0"}2013-10-23T07:18:38.462-04:00{/CreationDateTime} {MessageItem xmlns="urn:xxx/xxxx/xxxx/v1.0"} {Type}GateIn{/Type} {Vehicle} {Vin}1234567890123456M{/Vin} {Make}ABCD{/Make} {Model}25{/Model} {CurrentLocation} ......{Code}NOLOCATION{/Code} {/CurrentLocation} {NextShipToLocation} ..... {Code}DEF{/Code} {/NextShipToLocation} {Info} ....{Key}gateInTime{/Key} ....{Unit}Datetime{/Unit} ....{Value}2013-10-23T07:18:35.274-04:00{/Value} {/Info} {/Vehicle} {/MessageItem} Structs , SOAP PRE and POST request , are new to us. We need to send and receive 4 types of message. The XML tags remain constant for each message type. Unfortunately the provider of the web service is unable to flatten/un-nest fields in the webservice. What is the simplest and easiest way to handle nested web services? Thank you Martin
Hello Martin The best solution is using structs. In the latest Uniface 9.6 library they are documented very well including samples. Programming in Uniface -> Proc Language -> Structs and Programming in Uniface -> Proc Language ->Transforming Complex Data Using Structs Also in the Uniface library Integrating With Other Technologies -> Web Services where all subjects related to webservices are handled. The latest library version can be downloaded from Frontline or viewed online in Frontline: http://frontline.compuware.com/apps/docs/Search.aspx?prodcd=UF There is also a presentation on structs on youtube: http://www.youtube.com/unifacesme Hope this is enough to get you started. Regards Peter
Author: PBeugel (peter.beugel@uniface.com)
Complex Nested Web services - Need an example PLEASE!!!
Author: martind@motorvia.co.za (Martind)
We need to be able to handle a nested tag as per example below. The forum suppresses the indentation and less than & great than signs....Replace them with curly brackets. The nested fields indentation has been forced below with "...." {?xml version = "1.0" ?} {Sender xmlns="urn:xxx/xxxx/xxxx/v1.0"} {Name}ABC{/Name} {/Sender} {Receiver xmlns="urn:xxx/xxxx/xxxx/v1.0"} {Name}CBA{/Name} {/Receiver} {CreationDateTime xmlns="urn:xxx/xxxx/xxxx/v1.0"}2013-10-23T07:18:38.462-04:00{/CreationDateTime} {MessageItem xmlns="urn:xxx/xxxx/xxxx/v1.0"} {Type}GateIn{/Type} {Vehicle} {Vin}1234567890123456M{/Vin} {Make}ABCD{/Make} {Model}25{/Model} {CurrentLocation} ......{Code}NOLOCATION{/Code} {/CurrentLocation} {NextShipToLocation} ..... {Code}DEF{/Code} {/NextShipToLocation} {Info} ....{Key}gateInTime{/Key} ....{Unit}Datetime{/Unit} ....{Value}2013-10-23T07:18:35.274-04:00{/Value} {/Info} {/Vehicle} {/MessageItem} Structs , SOAP PRE and POST request , are new to us. We need to send and receive 4 types of message. The XML tags remain constant for each message type. Unfortunately the provider of the web service is unable to flatten/un-nest fields in the webservice. What is the simplest and easiest way to handle nested web services? Thank you Martin
Hi Martin, Another option is to check your Helpfile for "UXMLWRITER" and "Generating Customized XML" Perhaps someone with much more experience than I have on struct can transfer your example above into a sequence of STRUCT commands where a structtoXML at the end will convert it into an XML string. But as a last defense: if it comes to the very basics, an XML is just a simple string and you can apply all string features to build the XML you need. There are some special formats to handle date/time and you have to convert less, greater, etc to ampersand...; entities, but this is quite an easy task.
Author: ulrich-merkel (ulrichmerkel@web.de)