All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.carlosthe19916.webservices.exceptions.WebServiceExceptionFactory Maven / Gradle / Ivy

There is a newer version: 1.3.4.Final
Show newest version
package io.github.carlosthe19916.webservices.exceptions;

import io.github.carlosthe19916.webservices.utils.Util;

import javax.xml.ws.soap.SOAPFaultException;
import java.util.Optional;

public class WebServiceExceptionFactory {

    private WebServiceExceptionFactory() {
        // Just static methods
    }

    public static AbstractWebServiceException createWebServiceException(SOAPFaultException e) {
        Optional errorCode = Util.getErrorCode(e);
        if (errorCode.isPresent()) {
            return new ValidationWebServiceException(e);
        } else {
            return new UnknownWebServiceException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy