File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Soap without the java objects

 
George Harris
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently we are using Axis to receive soap requests. Axis then converts the soap xml into java objects. My question is, is there any way to get the Dom(xml) object from Axis? I want to use Soap so I can publish the wsdl, but I don't want the overhead of the java objects. Should I just create my own servlet and bypass Axis?
 
Philip Shanks
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see a possible clue in the Axis User's Guide. Here is an excerpt from the section "Newbie Tips: Finding Your Way Around":
org.apache.axis.SOAPEnvelope
As you can see, starting with the MessageContext lets you work your way down through the API, discovering all the information available to you about a single request/response exchange. A MessageContext has two Messages, which each have a SOAPPart that contains a SOAPEnvelope. The SOAPEnvelope, in turn, holds a full representation of the SOAP Envelope that is sent over the wire. From here you can get and set the contents of the SOAP Header and the SOAP Body. See the Javadocs for a full list of the properties available.
 
George Harris
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To clarify my question. Is it possible to use something like Axis, Cape Clear or any of the other soap applications without having to deserialize the xml on the server side. On the client side, I was able to use org.apache.axis.Message to access the soap parts, but the server classes were all new objects (no access to the dom tree).
I just finished reading the article Why use Soap and I think this might be the correct solution. No soap just HTTP + XML. But are you still able to publish a WSDL if you don't use soap?
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We had the exact same requirement and here's the apporach we took:
Publish our services in AXIS via the "message-style" service that AXIS offers.
Basically you hand-write the WSDL, which contains the schema definitions of the message parts, and you publish this as a document/literal type of webservice.
Within AXIS, you specify the style of the webservice as "message", and point it to your custom WSDL:

The method signature looks like:

Here the entire contents of the <SOAP-BODY> is handed to your method as a DOM Document object.
AXIS allows 4 method signatures for message-style service(read the document for that).
Using this approach we accomplish the following things:
1) Pass around XML messages within SOAP without the overhead of XML/Java Object data-binding.
2) Indicate to the end-user the schema of the input and output XML messages that you expect.
Note that for message-style webservices, AXIS hands you the entire SOAP-Body, it does not convert them to Java objects, neither does it do any schema validation (it's up to you to do that)
Hope that helps.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Junaid Bhatra:

2) Indicate to the end-user the schema of the input and output XML messages that you expect.

Junaid, how exactly is the input/output schemas communicated to the client in this approach?
 
John Hembree
hired gun
Ranch Hand
Posts: 250
MS IE Oracle Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by George Harris:
article Why use Soap

This is a pretty good read, thanks for posting it. I've seen it implemented like this at one of the companies that I have worked with in the past. It works really good for them.
 
Junaid Bhatra
Ranch Hand
Posts: 213
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's an example:

Here tns:MAXWORKORDER refers to a concrete element in your schema definition within the <types> section of your WSDL.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. That cleared it. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic