Guillaume Rongier · Dec 2, 2020

SOAP DataSet with DiffGrams

Hi everyone,

I need to call a SOAP service using IRIS Interoperability and this SOAP service returns a Microsoft DataSet with a DiffGrams payload.

Do you know how to handle this kind of Objects ?

SOAP Payload Response :

<?xml version="1.0" ?>
        <xs:schema id="NewDataSet">
            <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Patients" msdata:UseCurrentLocale="true">
                    <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="Patients">
                                    <xs:element name="LastName" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="FirstName" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="Date_x0020_of_x0020_Birth" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="Gender" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="Code" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="Insurance" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="GUID" type="xs:string" minOccurs="0"></xs:element>
                                    <xs:element name="CLINICGUID" type="xs:string" minOccurs="0"></xs:element>
                <Patients diffgr:id="Patients1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
                <Patients diffgr:id="Patients2" msdata:rowOrder="1" diffgr:hasChanges="inserted">

From the SOAP Wizard, I get an GetPatientsByClinicResponse with one property of FME.WS.DataExchange.tns.GetPatientsByClinicResult type :

Class FME.WS.DataExchange.tns.GetPatientsByClinicResult Extends (%SerialObject, %XML.Adaptor) [ ProcedureBlock ] { Parameter ELEMENTQUALIFIED = 1; Parameter NAMESPACE = ""; Parameter XMLNAME = "GetPatientsByClinicResult"; Parameter XMLSEQUENCE = 0; Property any As list Of %XML.String(XMLNAME = "any", XMLPROJECTION = "ANY") [ SqlFieldName = _any ]; /// ERROR: Duplicate Property name in Schema. Property any1 As %XML.String(XMLNAME = "any", XMLPROJECTION = "ANY"); }

I have seen in the documentation there is some kind of %XML.DataSet to parse this type of response like things we can do with ResultSet.

Do you know how i can cast my response to this kind of object, or any other method is appreciated.

Product version: IRIS 2020.4
0 316
Discussion (3)2
Log in or sign up to continue

Hi Alexender, I'll send you the WSDL in PM.

But I guess I found a workaround :

I created a new method that parse the XML with %XML.Reader and correlate the payload with my destination class :

 set reader = ##class(%XML.Reader).%New()
 // pRequest.GetPatientsByClinicResult.any.GetAt(1) <-- Header
 // pRequest.GetPatientsByClinicResult.any.GetAt(2) <-- Payload
 do reader.OpenString(pRequest.GetPatientsByClinicResult.any.GetAt(2))
 do reader.Correlate("Patients","FME.Object.Patient")

 while reader.Next(.object,.status) {
   do pResponse.Patients.Insert(object)

Where FME.Object.Patient is :

Class FME.Object.Patient Extends (%SerialObject, %XML.Adaptor)

Property LastName As %String;

Property FirstName As %String;

Property Datex0020ofx0020Birth As %String(XMLNAME = "Date_x0020_of_x0020_Birth");

Property Gender As %String;

Property Code As %String;

Property Insurance As %String;

Property GUID As %String;

Property CLINICGUID As %String;



I think what you did is a proper way to do this, because WSDL itself does not define this type, so there is no way for IRIS to figure out it automatically.