Web-services and complex objectparameters
Author: roger.wallin@abilita.fi (rogerw)
Hi,
Uniface 9.4.01.02 (R103 0707_1).
Using web-services, there seem to be very popular to return "objects" of "complex types" as a parameter of the web-service.
If Uniface is able to map this as a simple occurrence or entity (=many occurrences) it does so. Importing the wsdl makes Uniface create a model and the entity with fields, Uniface also creates the signatures of the service-functions using occurrence- or entityparameters.
Because of the complex world :-( there seem to be even more popular to build web-services returning "objects" of "complex types within complex types", ie. usually typical master-child situations. Importing wsdl describing this kind of situation doesn't create any entities and the signatures created are using string-parameters instead of occurrence- or entityparameters.
Perhaps it's meant that these complex objects should be handled by xmlstreams/strings in Uniface, using eg. xmlload, xmlsave or sax to handle these further.
Unfortunately Uniface seems to add a lot of unnecessary namespace declarations to the xmlstream returned by the web-service object-parameter??
Any advice about using these kind of web-services with Uniface appreciated, ie. web-services taking or returning parameters containing objects of "complex types within complex types" (Uniface: master entity - child entity).
Regards RogerW.
Example of typical WSDL-part:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Models" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://schemas.datacontract.org/2004/07/Models">
<xs:complexType name="Master">
<xs:sequence>
<xs:element name="MasterID" type="xs:string" />
<xs:element minOccurs="0" name="Details" nillable="true" type="tns:ArrayOfDetail"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Master" nillable="true" type="tns:Master"/> ;Making an instance
<xs:complexType name="ArrayOfDetail">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Detail" nillable="true" type="tns:Detail"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfDetail" nillable="true" type="tns:ArrayOfDetail"/>
<xs:complexType name="Detail">
<xs:sequence>
<xs:element name="DetailID" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="Detail" nillable="true" type="tns:Detail"/>
</xs:schema>




