or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

addressing-support.mdclient-services.mddatabinding-system.mddeveloper-utilities.mdindex.mdmessage-processing.mdpolicy-framework.mdserver-endpoints.mdtransport-integration.md
tile.json

tessl/maven-com-sun-xml-ws--jaxws-rt

Jakarta XML Web Services (JAX-WS) runtime implementation providing comprehensive SOAP web service capabilities

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/com.sun.xml.ws/jaxws-rt@3.0.x

To install, run

npx @tessl/cli install tessl/maven-com-sun-xml-ws--jaxws-rt@3.0.0

index.mddocs/

JAX-WS Runtime (jaxws-rt)

JAX-WS Runtime (jaxws-rt) is a comprehensive implementation of Jakarta XML Web Services providing complete SOAP web service capabilities for Java applications. It serves as the reference implementation of the Jakarta Web Services specifications, offering high-performance enterprise web service functionality with support for SOAP message processing, WS-Policy, WS-Addressing, and multiple transport protocols.

Package Information

  • Package Name: com.sun.xml.ws:jaxws-rt
  • Package Type: Maven
  • Language: Java
  • Installation: Add to your Maven pom.xml:
<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>3.0.2</version>
</dependency>

Core Imports

// Core JAX-WS API (included as transitive dependency)
import jakarta.xml.ws.Service;
import jakarta.xml.ws.WebServiceFeature;
import jakarta.xml.ws.spi.Provider;

// JAX-WS RI specific APIs
import com.sun.xml.ws.api.WSBinding;
import com.sun.xml.ws.api.server.WSEndpoint;
import com.sun.xml.ws.api.client.ServiceInterceptor;

Module system import (Java 9+):

module myapp {
    requires com.sun.xml.ws;
}

Basic Usage

Client-side Web Service Consumption

import jakarta.xml.ws.Service;
import jakarta.xml.ws.WebServiceFeature;
import com.sun.xml.ws.developer.JAXWSProperties;

// Create service from WSDL
URL wsdlLocation = new URL("http://localhost:8080/MyService?wsdl");
QName serviceName = new QName("http://example.com/", "MyService");
Service service = Service.create(wsdlLocation, serviceName);

// Get port with features
MyServiceInterface port = service.getPort(MyServiceInterface.class);

// Configure request context
Map<String, Object> requestContext = ((BindingProvider) port).getRequestContext();
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/MyService");

// Make web service call
String result = port.myOperation("parameter");

Server-side Web Service Publishing

import jakarta.xml.ws.Endpoint;
import com.sun.xml.ws.api.server.WSEndpoint;

// Simple endpoint publishing
@WebService
public class MyServiceImpl {
    @WebMethod
    public String myOperation(String input) {
        return "Processed: " + input;
    }
}

// Publish endpoint
Endpoint endpoint = Endpoint.publish("http://localhost:8080/MyService", new MyServiceImpl());

Architecture

JAX-WS Runtime is built around several key architectural components:

  • Message Pipeline: Extensible tube/pipe architecture for processing SOAP messages with pluggable handlers
  • Databinding System: Flexible XML-to-Java binding supporting JAXB and custom databinding providers
  • Transport Layer: Pluggable transport system supporting HTTP, HTTPS, JMS, and custom protocols
  • Policy Framework: WS-Policy implementation for declarative configuration of web service capabilities
  • Feature System: WebServiceFeature-based extensibility for adding cross-cutting concerns
  • Service Provider Interfaces (SPIs): Extensive extension points for customizing behavior at all layers

The runtime aggregates five core modules: rt (core runtime), policy (WS-Policy), rt-fi (Fast Infoset), httpspi-servlet (HTTP SPI), and servlet (servlet container integration).

Capabilities

Core Message Processing

Central message processing APIs providing SOAP message abstraction, pipeline processing, and attachment handling. Forms the foundation for all web service communication.

// Message abstraction
package com.sun.xml.ws.api.message;
public abstract class Message {
    public abstract boolean hasPayload();
    public abstract Source readPayloadAsSource();
    public abstract SOAPMessage readAsSOAPMessage() throws SOAPException;
    public abstract void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException;
}

// Message container with metadata
public final class Packet {
    public Message getMessage();
    public void setMessage(Message msg);
    public Map<String, Object> asMap();
    public <T> T getSatellite(Class<T> satelliteClass);
}

// Pipeline processing
package com.sun.xml.ws.api.pipe;
public interface Tube {
    NextAction processRequest(Packet request);
    NextAction processResponse(Packet response);
    void preDestroy();
}

Message Processing

Server-side Endpoint Management

Server-side web service endpoint creation, lifecycle management, and request processing with support for various deployment scenarios.

// Root server processing object
package com.sun.xml.ws.api.server;
public abstract class WSEndpoint<T> {
    public static <T> WSEndpoint<T> create(Class<T> implType, boolean processHandlerAnnotation, 
                                         Invoker invoker, QName serviceName, QName portName, 
                                         Container container, WSBinding binding, 
                                         SDDocumentSource primaryWsdl, Collection<? extends SDDocumentSource> metadata, 
                                         EntityResolver resolver, boolean isTransportSynchronous);
    public abstract Codec createCodec();
    public abstract ServiceDefinition getServiceDefinition();
    public abstract SEIModel getSEIModel();
}

// Transport adapter
public abstract class Adapter<TK> {
    public abstract ToolkitAdapter<TK> getToolkit();
    public abstract void handle(TK toolkit) throws IOException;
}

// Container abstraction  
public abstract class Container {
    public abstract <T> T getSPI(Class<T> spiType);
}

Server Endpoints

Client-side Service Access

Client-side APIs for consuming web services with support for dynamic proxies, dispatch clients, and service interception.

// Service interception
package com.sun.xml.ws.api.client;
public interface ServiceInterceptor {
    List<WebServiceFeature> preCreateBinding(WSPortInfo portInfo, List<WebServiceFeature> features);
    void postCreateProxy(WSBindingProvider bindingProvider, Class<?> serviceEndpointInterface);
}

// Extended binding provider
package com.sun.xml.ws.developer;
public interface WSBindingProvider extends BindingProvider {
    void setAddress(String address);
    WSEndpointReference getWSEndpointReference();
    WSPortInfo getPortInfo();
}

Client Services

Policy Framework

WS-Policy implementation providing declarative configuration of web service capabilities, policy attachment, and assertion processing.

// Core policy representation
package com.sun.xml.ws.policy;
public final class Policy implements Iterable<AssertionSet> {
    public static Policy createPolicy(PolicySourceModel model) throws PolicyException;
    public boolean isEmpty();
    public Iterator<AssertionSet> iterator();
    public Policy normalize(boolean isClientAssertion);
}

// Policy assertions
public abstract class PolicyAssertion {
    public abstract QName getName();
    public abstract AssertionData getData();
    public abstract boolean isOptional();
    public abstract boolean isPrivate();
}

// Policy map for storage
public final class PolicyMap {
    public Policy getEndpointEffectivePolicy(PolicyMapKey key) throws PolicyException;
    public Policy getOperationEffectivePolicy(PolicyMapKey key) throws PolicyException;
    public Policy getPortEffectivePolicy(PolicyMapKey key) throws PolicyException;
}

Policy Framework

Transport Integration

HTTP transport implementation and servlet container integration with support for various hosting scenarios.

// HTTP transport
package com.sun.xml.ws.transport.http;
public final class HttpAdapter extends Adapter<HttpConnection> {
    public static HttpAdapter createAlone(WSEndpoint<?> endpoint, Map<String, String> urlPattern);
    public void handle(HttpConnection connection) throws IOException;
}

// Servlet integration
package com.sun.xml.ws.transport.http.servlet;
public final class WSServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) 
        throws ServletException, IOException;
    protected void doPost(HttpServletRequest request, HttpServletResponse response) 
        throws ServletException, IOException;
}

Transport Integration

Databinding System

XML-to-Java databinding with JAXB integration and support for custom databinding providers.

// Core databinding interface
package com.oracle.webservices.api.databinding;
public interface Databinding {
    EndpointCallBridge createCallBridge(JavaCallInfo callInfo);
    ClientCallBridge createCallBridge(JavaCallInfo callInfo);
    void generateWSDL(WSDLGenInfo wsdlGenInfo);
}

// Databinding factory
public abstract class DatabindingFactory {
    public static DatabindingFactory newInstance();
    public abstract Databinding createDatabinding(DatabindingConfig config);
}

// SPI for custom providers
package com.sun.xml.ws.spi.db;
public interface DatabindingProvider {
    boolean isFor(String databindingMode);
    void init(Map<String, Object> properties);
    Databinding create(DatabindingConfig config);
}

Databinding System

Developer Utilities

Advanced developer APIs providing fine-grained control over JAX-WS behavior, streaming, validation, and custom features.

// JAX-WS RI properties
package com.sun.xml.ws.developer;
public final class JAXWSProperties {
    public static final String CONTENT_NEGOTIATION_PROPERTY = "com.sun.xml.ws.client.ContentNegotiation";
    public static final String MTOM_THRESHOLOD_VALUE = "com.sun.xml.ws.common.MtomThresholdValue";
    public static final String HTTP_EXCHANGE = "com.sun.xml.ws.http.exchange";
}

// Extended binding provider
public interface WSBindingProvider extends BindingProvider {
    void setAddress(String address);
    WSEndpointReference getWSEndpointReference();
    WSPortInfo getPortInfo();
}

// Streaming attachment feature
@WebServiceFeature.ID("http://java.sun.com/xml/ns/jaxws/")
public final class StreamingAttachmentFeature extends WebServiceFeature {
    public StreamingAttachmentFeature(String dir, boolean parseEagerly, long memoryThreshold);
    public String getDir();
    public boolean isParseEagerly();
    public long getMemoryThreshold();
}

Developer Utilities

Addressing Support

WS-Addressing implementation supporting both W3C and Member Submission specifications for message addressing and correlation.

// Addressing version support
package com.sun.xml.ws.api.addressing;
public enum AddressingVersion {
    W3C("http://www.w3.org/2005/08/addressing"),
    MEMBER("http://schemas.xmlsoap.org/ws/2004/08/addressing");
    
    public String getNsUri();
    public QName getWsdlExtensionAttribute();
    public String getPrefix();
}

// Endpoint reference
public final class WSEndpointReference {
    public WSEndpointReference(Source eprInfoset, AddressingVersion version);
    public Source asSource(String localName);
    public WSEndpointReference createWithAddress(String address);
}

Addressing Support

Types

Core Types

// Binding representation
package com.sun.xml.ws.api;
public interface WSBinding extends Binding {
    SOAPVersion getSOAPVersion();
    AddressingVersion getAddressingVersion();
    boolean isFeatureEnabled(Class<? extends WebServiceFeature> feature);
    <F extends WebServiceFeature> F getFeature(Class<F> featureType);
}

// SOAP version constants
public enum SOAPVersion {
    SOAP_11("http://schemas.xmlsoap.org/soap/", "1.1"),
    SOAP_12("http://www.w3.org/2003/05/soap-envelope", "1.2");
    
    public String getHttpContentType();
    public String getHttpBindingId();
    public QName getFaultCodeClientLocalName();
}

// Attachment representation
package com.sun.xml.ws.api.message;
public interface Attachment {
    String getContentId();
    String getContentType();
    byte[] asByteArray();
    DataHandler asDataHandler();
    Source asSource();
    InputStream asInputStream();
}

Exception Types

// Policy exceptions
package com.sun.xml.ws.policy;
public class PolicyException extends Exception {
    public PolicyException(String message);
    public PolicyException(String message, Throwable cause);
}

// Web service exceptions
package com.sun.xml.ws.util.exception;
public abstract class JAXWSExceptionBase extends WebServiceException implements Localizable {
    protected JAXWSExceptionBase(String key, Object... args);
    protected JAXWSExceptionBase(Throwable throwable);
}

Service Provider Interfaces (SPIs)

JAX-WS Runtime provides extensive customization through Service Provider Interfaces:

Core Extension Points

// Custom binding types
package com.sun.xml.ws.api;
public abstract class BindingIDFactory {
    public abstract BindingID parse(String lexical) throws WebServiceException;
}

// Custom transport implementations  
package com.sun.xml.ws.api.pipe;
public abstract class TransportTubeFactory {
    public abstract Tube doCreate(ClientTubeAssemblerContext context);
}

// Custom tubeline assembly
public abstract class TubelineAssemblerFactory {
    public abstract TubelineAssembler doCreate(BindingID bindingId);
}

// Custom policy assertions
package com.sun.xml.ws.policy.spi;
public interface PolicyAssertionCreator {
    String[] getSupportedDomainNamespaceURIs();
    PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> nestedPolicy);
}

Standard Implementations

The runtime provides standard implementations for:

  • jakarta.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl
  • DatabindingProvider: com.sun.xml.ws.db.DatabindingProviderImpl
  • BindingContextFactory: com.sun.xml.ws.db.glassfish.JAXBRIContextFactory
  • LoggingProvider: com.sun.xml.ws.policy.jaxws.XmlWsLoggingProvider