Has anyone used java clients that access your .NET webservices? If so, did you return any datasets, or were there any major problems?
We are creating .NET webservices to expose our business layer, and would like interop between the two specs (.NET/Java).
Thanks. ![]()
-
-
A wild guess: They are standarized and work well together. right?
-
Hello:
I use C# client that access Java Web Services, and Java clients that access C# Web Services.
Data types are not a problem, if you return integers, strings, doubles, etc... works well.
But if you want yo use SOAP in order to send files (images, Word documents,...) yo must install the Web Service Enhancement 2.0 from MSDN Web Service center.
This is because Microsoft use DIME specification but SUN use MIME in order to send binary files. (Today, i think, only Microsoft use DIME, but i'm not sure)
Maybe you will find troubles with the Web Service namespace. If you use http://tempuri.org, there's no problem, if you change it in a Java WS, maybe your C# client will have troubles. -
I am not going to be transfering any files. I was just wondering if returning datasets would be ok. What is the equivalent of a dataset in java?
-
Using a DataSet is definitely a no-no if you are considering Web services interoperability. A quick statement for interop is to make sure you design your Web services Schema-First rather than Implementation-First. Look here for more information, articles, and sample code on WS interop.
http://msdn.microsoft.com/webservices/building/interop/ -
Hello:
The DataSet .NET equivalent in Java is the ResultSet.
But you can not use a DataSet as return parameter of a web service. The DataSet is not a valid web service data type.
What you can do is the following:
Your web service receive the request, do some things with the database, an obtain a DataSet. Convert your DataSet in an String array (string[files] or string[files,rows]). Return the string array
Then the web service can return a "DataSet", but the receiver can only read data, he can not use the DataSet as an object.
-
I reply to my selft:
It´s not string[files] or string[files, rows], What i want to say is:
string[rows] or string[rows. columns]
Sorry.
-
Thank you for your great responses. I have read articles on interop and I figured datasets would be ify. Just wanted to hear real life stories. Thanks

-
We've used data-over-http and data-over-smtp but it always boils down to converting typed data to some kind of massive string. The typical thing is to transform a data set like
Parts:
Qty SKU Description
3 AB29 steering wheel
4 DJ39 accelerator
6 DDJ2 ignition
to an XML string like
<parts>
<part sku="AB29" qty="3" description="steering wheel" />
<part sku="DJ39" qty="4" description="accelerator" />
<part sku="DDJ2" qty="6" description="ignition" />
</parts>
If you define an XML schema saying "valid packets consist of a single <parts> element containing one or more <part> elements, each of which has sku, qty, and description attributes" then it doesn't really matter what client you use - as long as it understands XML schemas in general, and what to do with your schema in particular. -
Hello:
Maybe you can return your dataset as a xml document.
You can use these methods from DataSet class.
<string> GetXml()
<string> GetXmlSchema()
The problem is that in Java you can not create a new ResultSet, because the ResultSet is an interface.
What you can do is use the Xml API of your database (Oracle and SQL Server have this API, i don't known if other RDBMS has it) in order to "create" a Java ResultSet like object.
It's hard to interop J2EE and .NET
Bye
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.