Consuming Java Web Services

  • Thread starter Rich Newman via .NET 247
  • Start date
R

Rich Newman via .NET 247

We are developing a client in C# that uses Web Services writtenin Java. These typically return simple arrays of objects. Incertain cases we'd like to map these arrays to the obviousequivalent DataSet/DataTable representation so we can easilybind them to a grid, and also to simply track changes forconcurrency.

Clearly we can do this by getting the array and looping throughit, setting up the data on an appropriate DataTable. However,this is painful to write and seems inefficient - is there abetter way? In particular can we interrupt the XMLdeserialization in some way and tell it to deserialize into apredefined DataSet schema??
 
J

Jan Tielens

I'm not aware of any straight forwared solutions, but you could use the
DataSet.ReadXML method to load the raw xml from the webservice response.

I understand that there are some difficulties with databinding, custom
classes and web services, but it CAN be done. (See another recent thread in
this newsgroup)
--
Greetz,
Jan
________________________
Read my weblog: http://weblogs.asp.net/jan

"Rich Newman via .NET 247" <[email protected]> schreef in bericht
We are developing a client in C# that uses Web Services written in Java.
These typically return simple arrays of objects. In certain cases we'd like
to map these arrays to the obvious equivalent DataSet/DataTable
representation so we can easily bind them to a grid, and also to simply
track changes for concurrency.

Clearly we can do this by getting the array and looping through it, setting
up the data on an appropriate DataTable. However, this is painful to write
and seems inefficient - is there a better way? In particular can we
interrupt the XML deserialization in some way and tell it to deserialize
into a predefined DataSet schema??
 
E

enrico sabbadin @ infinito

sorry if I jump into the thread.

I understand what you suggest, but it would be more efficient to load the DS
from the response stream before it is turned into an XML Document.
I'm trying to do something similar : expose a web method with a clear
signature, but receive the input as a raw stream.
I can grab the stream using a soap extension , but than I'd like to stop the
message flow to the target method.
what's the best way to do it ?
thank you
 
J

Jan Tielens

You can take a look at the code that Christian's tool generates:
http://weblogs.asp.net/cweyer/archive/2003/11/21/39070.aspx

It gives you access to the raw xml.

--
Greetz,
Jan
________________________
Read my weblog: http://weblogs.asp.net/jan

enrico sabbadin @ infinito said:
sorry if I jump into the thread.

I understand what you suggest, but it would be more efficient to load the DS
from the response stream before it is turned into an XML Document.
I'm trying to do something similar : expose a web method with a clear
signature, but receive the input as a raw stream.
I can grab the stream using a soap extension , but than I'd like to stop the
message flow to the target method.
what's the best way to do it ?
thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top