• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

?? Sending undefined objects from Server??

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a problem, and I'm not sure that a solution exists for it. So please, if you have an idea post it!!
The idea here is that the client receives an XML file from which it parses out information and puts into a Javabean. It sends this object using SOAP to the server. The server pulls out the information, compares it to data from another XML file, then sends a object (bean) back to the client (made up of information from their XML file) using SOAP. Okay...that's the easy part!
The difficulty, if the server (a customer) adds or removes fields from their database, then the fields in the object will change. We want to have a very flexible service that won't have to be updated every time that a customer changes the information that they are sending back.
I really don't see it as something that is going to be able to be done because the beans have pre-defined get/set methods that exist for the variables in the bean. These methods are used for extracting the information from the bean when the bean is received.
Any ideas? Don't you have to have an agreement between the client and server on the XML content? There has to be a cooperation - doesn't there?
Thanks for any ideas you might have on this!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There has to be cooperation, BUT you could define the return as an XML Element and be completely general.
Bill
 
Angela Margot
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the lead Bill...now for a followup question (I've only been doing SOAP for a few weeks now) I can't seem to get the client and service to work right with the XML Element as the return object.
In the client I have this code:
Response response = call.invoke( url, "" ); // invoke the service
.....
Parameter result = response.getReturnValue(); // response was OK
Element e = (Element)result.getValue();
....
On the server side:
DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder();
....
URL url = new URL ("http://127.0.0.1:7001/soap/DataFolder/leadfile2.xml");
InputStream is = url.openStream ();
Document d = xdb.parse(is);
e = d.getDocumentElement ();
return e;//It should be returning this element
It compiles fine, but when it runs I'm getting the following error:
Fault= SOAP-ENV:Server, java.lang.ClassCastException: weblogic.apache.xerces.dom.DeferredElementNSImpl
Any ideas on what I am doing wrong here? Is it how I am trying to retrieve the element on the client side? I can't find much information on this type of manipulation out there.
Thanks,
 
reply
    Bookmark Topic Watch Topic
  • New Topic