|
Vikas
DOM is quite a good thing to
solve your problem once u get the document object.
There are tutorials and articles in
the ibm.com/developerworks site or you can refer to the book Java and XML by
Brett McLaughlin , OReilly ... Thats the best book available in the market as
far as I know .
Then as Anne said you can just use a
Transformer to transform that XML doc to th one of ur required std.. Apache
Xalan can help you .
Regards
Dhanush
----- Original Message -----
Sent: Thursday, August 05, 2004 12:20
AM
Subject: RE: multiple objects without
using arrays in doc/literal
Thomas,
I agree that client is the one that needs to be
fixed. The client is being generated by Siebel tools and they say the
problem would be fixed in their next version and upgrading the version is
not an option right now cause it would break lot of other things. So we are
trying to hack our way through this, if possible. I can't believe how those
guys released that tool, it is full of bugs.
But anyways, I haven't
worked with DOM directly. Could someone provide an example or point to a
resource which could give me more
information.
Thanks Vikas
-----Original Message----- From:
THOMAS, JAI [AG-Contractor/1000] [mailto:[EMAIL PROTECTED] Sent:
Wednesday, August 04, 2004 11:21 AM To: '[EMAIL PROTECTED]' Subject:
RE: multiple objects without using arrays in
doc/literal
Vikas, Since you are using doc/lit, you should be able
to get the DOM object and get hold of 'arrayOfaddresses'
nodes. Now my question would be, why do you want to change the server
behavior (which is neater) just so a buggy client can work? I would
rather fix the client to send correct xml doc.
Jai
-----Original Message----- From: Vikas Phonsa
[mailto:[EMAIL PROTECTED] Sent: Wednesday, August 04, 2004 12:33 PM To:
'[EMAIL PROTECTED]' Subject:
multiple objects without using arrays in doc/literal
Hi
Everybody,
I am developing a doc/literal style web service and the
implementation java class has only one method:
Public String
insertOrUpdate(Contact contact).
And the contact object has an array of
addresses. So the SOAP message should look like
this:
<contact>
<arrayOfaddresses> <address> <street>addr1</street> </address> <address> <street>addr2</street> </address> </arrayOfaddresses>
</contact>
There
is an internal application (Siebel) which is supposed to send me
SOAP messages in the above format. But the tools that are being used to
generate the Client on Siebel aren't working right, they fail to create an
array and send me
this:
<contact>
<arrayOfaddresses> <address> <street>addr1</street> </address> </arrayOfaddresses>
<arrayOfaddresses> <address> <street>addr2</street> </address> </arrayOfaddresses>
</contact>
So
basically instead of getting an array or addresses I would be
getting multiple address elements associated with a contact. In case of an
array I could easily iterate through it to get addresses. But in this case
I don't know how many addresses would be sent.
I would appreciate
any thoughts or suggestions on how I could iterate through multiple
addresses elements that would be sent.
How could this situation be
mapped to a java classes.
Thanks in
advance Vikas
********************************************************* Disclaimer:
This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.
********************************************************* Visit us at http://www.mahindrabt.com
|
|