001/*
002 * Copyright 2002-2012 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.remoting.jaxws;
018
019import javax.xml.namespace.QName;
020import javax.xml.soap.SOAPFault;
021import javax.xml.ws.soap.SOAPFaultException;
022
023import org.springframework.remoting.soap.SoapFaultException;
024
025/**
026 * Spring SoapFaultException adapter for the JAX-WS
027 * {@link javax.xml.ws.soap.SOAPFaultException} class.
028 *
029 * @author Juergen Hoeller
030 * @since 2.5
031 */
032@SuppressWarnings("serial")
033public class JaxWsSoapFaultException extends SoapFaultException {
034
035        /**
036         * Constructor for JaxWsSoapFaultException.
037         * @param original the original JAX-WS SOAPFaultException to wrap
038         */
039        public JaxWsSoapFaultException(SOAPFaultException original) {
040                super(original.getMessage(), original);
041        }
042
043        /**
044         * Return the wrapped JAX-WS SOAPFault.
045         */
046        public final SOAPFault getFault() {
047                return ((SOAPFaultException) getCause()).getFault();
048        }
049
050
051        @Override
052        public String getFaultCode() {
053                return getFault().getFaultCode();
054        }
055
056        @Override
057        public QName getFaultCodeAsQName() {
058                return getFault().getFaultCodeAsQName();
059        }
060
061        @Override
062        public String getFaultString() {
063                return getFault().getFaultString();
064        }
065
066        @Override
067        public String getFaultActor() {
068                return getFault().getFaultActor();
069        }
070
071}