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" ?>
<GetPatientsByClinicResponse>
<GetPatientsByClinicResult>
<xs:schema id="NewDataSet">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Patients" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Patients">
<xs:complexType>
<xs:sequence>
<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>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram>
<DocumentElement>
<Patients diffgr:id="Patients1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<LastName>AGNES
</LastName>
<FirstName>Roussignol
</FirstName>
<Date_x0020_of_x0020_Birth>12/12/1975
</Date_x0020_of_x0020_Birth>
<Gender>Féminin
</Gender>
<Code>999990028
</Code>
<Insurance></Insurance>
<GUID>918c557f-b788-4171-a08e-4544aa5cc6ad
</GUID>
<CLINICGUID>0b3d8635-af2d-43c9-ae72-c8bd9833d18d
</CLINICGUID>
</Patients>
<Patients diffgr:id="Patients2" msdata:rowOrder="1" diffgr:hasChanges="inserted">
<LastName>AIX
</LastName>
<FirstName>Marius
</FirstName>
<Date_x0020_of_x0020_Birth>04/09/1972
</Date_x0020_of_x0020_Birth>
<Gender>Masculin
</Gender>
<Code>9999920024
</Code>
<Insurance></Insurance>
<GUID>25257261-a09c-4f2d-a710-c5bea3888086
</GUID>
<CLINICGUID>0b3d8635-af2d-43c9-ae72-c8bd9833d18d
</CLINICGUID>
</Patients>
</DocumentElement>
</diffgr:diffgram>
</GetPatientsByClinicResult>
</GetPatientsByClinicResponse>
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 = "http://tempuri.org/";
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.
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...
Do you know how i can cast my response to this kind of object, or any other method is appreciated.
Guillaume,
can you please post WSDL here.
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 :
Where FME.Object.Patient is :
Great!
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.