This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Soap without the java objects

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
hired gun
Posts: 250
MS IE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok. That cleared it. Thanks.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic