Kbase P127222: A ProDataSet sent to a .NET Web Service which expects a .NET DataSet arrives empty
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/30/2007 |
|
Status: Unverified
FACT(s) (Environment):
OpenEdge 10.1x
All Supported Operating Systems
SYMPTOM(s):
A .NET Web Service receives an empty DataSet from an OpenEdge client
Data for a .NET DataSet input parameter is not received by a .NET Web Service
A ProDataSet does not contain data when received by a .NET Web Service
The .NET Web Service expects a DataSet as input parameter
Sending a serialized ProSataSet as a LONGCHAR variable by using the WRITE-XML() method
The .NET DataSet only contains the schema when received
CAUSE:
.NET expects DataSets to be serialized in their proprietary Diffgram format across the Web Services interface. This causes an interoperability problem since only .NET can use the Diffgram format. Since the data is not coming from OpenEdge as a Diffgram, the .NET Web Service does not recognize it.
FIX:
.NET is more forgiving with its ReadXml API, and can accept an OpenEdge ProDataSet XML Document and read it into a .NET DataSet. So one solution is for the .NET Web service to receive the raw XML from OpenEdge and use the ReadXml API.
- OR -
Replace the ProDataSet specific elements and namespaces by .NET specific elements and namespaces before sending the serialized ProDataSet, for example:
PROCEDURE pConvertToDiffgram :
DEFINE INPUT-OUTPUT PARAM LongChar$p AS LONGCHAR NO-UNDO.
DEFINE VARIABLE LongChar$v AS LONGCHAR VIEW-AS EDITOR SIZE 35 BY 3 SCROLLBAR-VERTICAL LARGE.
ASSIGN LongChar$v = LongChar$p.
LongChar$v = REPLACE (LongChar$v, 'version="1.0"', 'version="1.0" standalone="yes"').
LongChar$v = REPLACE (LongChar$v,
'<prods:datasetChanges xmlns:prods="urn:schemas-progress-com:xml-dataset-changes:0001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' + CHR(10),
'<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">' + CHR(10)).
LongChar$v = REPLACE (LongChar$v, ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"', ' ').
LongChar$v = REPLACE (LongChar$v, '</prods:datasetChanges>' + CHR(10), '</diffgr:diffgram>' + CHR(10)).
LongChar$p = REPLACE (LongChar$v,'prods:id=','diffgr:id=').
END PROCEDURE.