SOAP Web Service Tutorials - Herong's Tutorial Examples - Version 5.02, by Dr. Herong Yang
SAAJ API and Default Implementation in JDK 1.6.0
This section provides a tutorial example to test the SAAJ API and the default SAAJ implementation included in JDK 1.6.0.
By browsing the JDK 1.6 documentation, you will notice that the SAAJ package, javax.xml.soap, is included in the javadoc. So I assume that the SAAJ API and an implementation of SAAJ API must be supported in JDK 1.6.
To test SAAJ support in JDK 1.6, I wrote this simple test program, SAAJImplementationTest.java:
/** * SAAJImplementationTest.java * Copyright (c) 2009 by Dr. Herong Yang, herongyang.com * All rights reserved */ import javax.xml.soap.*; public class SAAJImplementationTest { public static void main(String[] args) { PrintStream out = System.out; try { SOAPConnectionFactory o_Factory = SOAPConnectionFactory.newInstance(); SOAPConnection o_Connection = o_Factory.createConnection(); out.println("\n SOAPConnectionFactory class: " +o_Factory.getClass()); out.println("\n SOAPConnection class: " +o_Connection.getClass()); } catch (Exception e) { e.printStackTrace(); } } }
Here is the output of my test of running SAAJImplementationTest.java with JDK 1.6:
>java -version java version "1.6.0_06" Java(TM) SE Runtime Environment (build 1.6.0_06-b02) Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing) >javac SAAJImplementationTest.java >java SAAJImplementationTest SOAPConnectionFactory class: class com.sun.xml.internal.messaging .saaj.client.p2p.HttpSOAPConnectionFactory SOAPConnection class: class com.sun.xml.internal.messaging .saaj.client.p2p.HttpSOAPConnection
The output proces that the SAAJ API and a default implementation of SAAJ are included in JDK 1.6.0.
But how can we find out the version number of the SAAJ API and the release number of the implementation?
I found one clue in the JDK 1.6 documentation. Here is the javadoc for the get() method of the javax.xml.soap.SOAPConnection class:
public SOAPMessage get(Object to) throws SOAPException Gets a message from a specific endpoint and blocks until it receives, Parameters: to - an Object that identifies where the request should be sent. Objects of type java.lang.String and java.net.URL must be supported. Returns: the SOAPMessage object that is the response to the get message request Throws: SOAPException - if there is a SOAP error Since: SAAJ 1.3
It says that the get() method was added since SAAJ 1.3. Based on this, we can safely say that JDK 1.6 support SAAJ API 1.3.
There seems to be no easy way to find out the release number of the default implementation of SAAJ API included in JDK 1.6.0.
Last update: 2009.
Table of Contents
Introduction to SOAP (Simple Object Access Protocol)
SOAP Message Transmission and Processing
SOAP Message Exchange Patterns
Perl SOAP::Lite - SOAP Server-Client Communication Module
Perl Socket Test Program for HTTP and SOAP
Perl SOAP::Lite for GetSpeech SOAP 1.1 Web Service
Perl SOAP::Lite 0.710 for SOAP 1.2 Web Services
Perl SOAP::Lite 0.710 for WSDL
PHP SOAP Extension Client Programs
PHP SOAP Extension Server Programs
Java Socket and HttpURLConnection for SOAP
►SAAJ - SOAP with Attachments API for Java
SAAJ API 1.3 Classes and Interfaces Overview
►SAAJ API and Default Implementation in JDK 1.6.0
SAAJ API Reference Implementation 1.3.4
First SOAPConnection Test Program
Creating SOAPConnection and SOAPMessage Objects
SAAJ SOAPMessage Structure and Classes/Interfaces
Populating the SOAP Body with Request XML Elements
Don't Use xml* as namespace Prefix
addHeader() - Setting SOAPAction Header Line
Calling GetSpeech SOAP 1.1 with SAAJ
SOAPConstants.SOAP_1_2_PROTOCOL
Calling GetSpeech SOAP 1.2 with SAAJ
SoapUI - SOAP Web Service Testing Tool
WS-Security - SOAP Message Security Extension
WS-Security X.509 Certificate Token