You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Joe Shevland <js...@ozemail.com.au> on 2003/01/12 03:13:31 UTC

Sending DataSet equivalent from Java and dateTime conv

Hi,

Sorry if these ones have been covered before but I couldn't find any
references to them in the lists.

We're implementing SOAP services using Axis 1.1b/Tomcat 4.1, with one of the
consuming clients being a VB.NET client. Mostly everything is working OK, as
the VB client is building proxy classes for the complex objects etc, however
there's one issue with xsd:dateTime support, and one feature I was wondering
if anyone had implemented.

i) a JavaBean the Axis server serializes to send to the client contains a
java.util.Calendar attribute, which is serialized correctly (described as
xsd:dateTime in the WSDL) and goes across the wire as a valid XML date
format. *But* the generated proxy class on the VB side (e.g. CaseBean) only
uses a System.xyx.Date type for this attribute, with the result being its
only storing the date information, and not time, TZ etc. Is there something
I need to tweak in the WSDL here? I've tried casting it to DateTime etc with
no luck.

ii) the VB.NET developer is used to working with the DataSet class in
ADO.NET, and he's vehement that the SOAP service should just be able to send
an XML serialized DataSet across the wire to his client code. I've commented
that the DataSet is an ADO.NET specific thing and that he should be taking
the objects/object-arrays and building his own DataSet if he needs one... I
suspect I'll have to at least attempt this anyway though, has anyone done
something similar? The actual XML from the service response looks OK in
terms of building a DataSet from its readXML() method (can I get the raw XML
on the client instead of the objects being marshalled? Message service?),
and I can generate the XSD schemas easily enough, but is there a way
(Handler?) to embed the XSD schema in the response (not so important as the
client can obtain that later) and have the service return a
DataSet-compatible response (more important)? The example(*) DataSets I've
seen serialized to XML seem reasonably trivial and don't contain too many
odd looking features (isDataSet attribute and XSD schema). Alternatively any
ammo saying this approach is madness and the DataSet should be built back up
on the client is OK too ;)

Cheers,

Joe Shevland
E-Wise Solutions Pty Ltd

---
* Example of the kind of response the VB.NET client could use as a DataSet
(I think):

<abcResponse xmlns="http://tempuri.org/">
  <abcResult>
    <xsd:schema id="NewDataSet" targetNamespace="" xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
      <xsd:element name="NewDataSet" msdata:IsDataSet="true">
      <xsd:complexType>
      <xsd:choice maxOccurs="unbounded">
      <xsd:element name="some_table">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="some_field" type="xsd:int" minOccurs="0" />
      <xsd:element name="some_field2" type="xsd:string" minOccurs="0" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:choice>
      </xsd:complexType>
      </xsd:element>
    </xsd:schema>
    ...something like:
    <some_table id="#">
      <some_field>1</some_field>
      <some_field2>test</some_field2>
    </some_table>
  </abcResult>
</abcResponse>