0

I created web service in C# .net with input parameter : DataSet

in other side, i need to use this web service from progress OpenEdge 4GL 10.1 (not 10.2)

the problem is Dataset in OpenEdge cant match with DataSet in .net. always return 0 in the result

I'm C# programmer, so dont have deep knowledge in porgress. I did research in progress forum, but not a good result.

any help ? thanks in advance.

*codes*****

//web service : C# .net

[webmethod]

public int getResult(DataSet ds)
{

  DataTable tbl = ds.Tables["datas"];

  int result=0;

  foreach (DataRow dr in tbl.Rows){ //only 1 record = 1 row

     result = Convert.toInt32(dr["field1"]); }

  return result;
}

//progress OpenEdge 10.1

--- create and fill temp-table : field1 = 30 and only 1 record

--- create dataset and bind to temp-table

--- connect to web service

--- call webmethod :

define variable result as integer no-undo.

RUN getResult IN hPortType(INPUT dataset,OUTPUT result).

message result view-as alert-box info button ok. ---> RESULT ALWAYS 0

/****/

anyone know how to "bridge" dataset in progress openedge to .net dataset ?

note: this web service works well if called from .net

John Saunders
  • 160,644
  • 26
  • 247
  • 397
jasperdmx
  • 13
  • 3
  • Could you post what you've attempted so far? That is, your C# code. It is very difficult to ascertain what the problem could be without knowing what you've done. – jrd1 Oct 12 '12 at 02:13

2 Answers2

0

It's a bad practice to use DataSet or any other type specific to .NET to send to or receive from a web service. There's not reason that anything other than .NET would understand such types.

Same thing, BTW, relates to Java. Certain versions of Axis web services basically assumed they were being consumed by Java code, and used types specific to Java without defining them. Didn't work well.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • correct John, however : it's the request from the "TOP" :-) i did mentioned this, but he still insisted :-( I knew uncommon using dataset in web service, but because he purely do all his programming in progress openedge, and progress openedge use dataset and temp-table so much, that's why he already get used to it. – jasperdmx Oct 12 '12 at 03:03
  • Yeah, but what kind of "DataSet" is it? Is it a .NET DataSet or a Progress DataSet? – John Saunders Oct 12 '12 at 04:52
0

for webservices should you use the XML. that's standardized method of communication.

http://en.wikipedia.org/wiki/Web_service

firhang
  • 244
  • 2
  • 11
  • His web service was certainly using XML – John Saunders Oct 12 '12 at 22:02
  • 1
    Thanks for the reply.i ended up with 're-negotition' with the boss :-) 1. the dataset from progress Openedge converted to string XML (in progress they called longchar --> like long string) --> dataset:WRITE-XML("LONGCHAR",variableName,?,?,?,?). 2. the web service will receive as string xml, and converted back to .net dataset using XmlDocument, XmlNodeReader and dataset.ReadXml() Thanks for all the thought guys ! *thumbs up* – jasperdmx Oct 15 '12 at 04:40