You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by "Michael J. Hudson" <mh...@blueprinttech.com> on 2001/08/18 00:16:08 UTC

Returning a slightly different data object

Ok... here's my dillema.

Upon the Java object providing the SOAP service, I could
1) create a method that takes one XML string as a parameter into my
class
2) create a method that takes on or more data objects parameters into my
class

Now... doing #2 is cool because both sides are dealing completely
with data objects and there is no XML parsing needed or going on.
However, #1 is better if one thinks that additional elements might
be added and passed back and forth.  With an XML document, the server
can always parse it and ignore what it doesn't need, and only get
what it needs.  And thus... the XML document can change and have
additional elements added to it... yet, neither the sender or receiver
need to change any code.

So... the big question is... what if I REALLY want to do #2.  I did
a quick test just to see what would happen, if I added just one field
called 'info' to the object being passed back and forth.  The sender
code added the field... so the receiver code isn't necessarily aware
of it.  And it spit out:

  Fault String = Unable to retrieve PropertyDescriptor for property
'info' of class 'class test.parameters.orderID'.

SOoooo... is there anyway to get SOAP to ignore PropertyDescriptor's
that
it can't retrieve.  So... if the sender ends up sending an object with
more fields than its aware of... then the reciever just fills out IT'S 
object with just the fields that it IS aware of.  Thus... it would see
that 'info' field... look at it's object, realize it's not there to
set, and just ignore it, and go on to the next field to set.

Is that possible?  I'm guessing there really is no clean easy way to do
it, but MAN... it would awesome, if someone did know a way!

Thanks!

-----------------
Michael J. Hudson
Software/Framework Engineer
mhudson@blueprinttech.com

cell-phone: 703.362.8039
voice-mail: 703.827.0638 ext. 4786
fax: 703.734.0987

Blueprint Technologies
"Great software starts with great architecture"
http://www.blueprinttech.com