|
Apache CXF example source code file (AbstractJAXWSMethodInvoker.java)
The Apache CXF AbstractJAXWSMethodInvoker.java source code/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.cxf.jaxws; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.activation.DataHandler; import javax.xml.ws.handler.MessageContext; import javax.xml.ws.handler.MessageContext.Scope; import javax.xml.ws.soap.SOAPFaultException; import org.apache.cxf.attachment.AttachmentImpl; import org.apache.cxf.binding.soap.SoapFault; import org.apache.cxf.binding.soap.SoapMessage; import org.apache.cxf.endpoint.Endpoint; import org.apache.cxf.headers.Header; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.jaxws.context.WrappedMessageContext; import org.apache.cxf.message.Attachment; import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageImpl; import org.apache.cxf.service.invoker.Factory; import org.apache.cxf.service.invoker.FactoryInvoker; import org.apache.cxf.service.invoker.SingletonFactory; public abstract class AbstractJAXWSMethodInvoker extends FactoryInvoker { public AbstractJAXWSMethodInvoker(final Object bean) { super(new SingletonFactory(bean)); } public AbstractJAXWSMethodInvoker(Factory factory) { super(factory); } protected SOAPFaultException findSoapFaultException(Throwable ex) { if (ex instanceof SOAPFaultException) { return (SOAPFaultException)ex; } if (ex.getCause() != null) { return findSoapFaultException(ex.getCause()); } return null; } @Override protected Fault createFault(Throwable ex, Method m, List<Object> params, boolean checked) { //map the JAX-WS faults SOAPFaultException sfe = findSoapFaultException(ex); if (sfe != null) { SoapFault fault = new SoapFault(sfe.getFault().getFaultString(), ex, sfe.getFault().getFaultCodeAsQName()); fault.setRole(sfe.getFault().getFaultActor()); if (sfe.getFault().hasDetail()) { fault.setDetail(sfe.getFault().getDetail()); } return fault; } return super.createFault(ex, m, params, checked); } protected Map<String, Object> removeHandlerProperties(WrappedMessageContext ctx) { Map<String, Scope> scopes = CastUtils.cast((Map)ctx.get(WrappedMessageContext.SCOPES)); Map<String, Object> handlerScopedStuff = new HashMap Other Apache CXF examples (source code examples)Here is a short list of links related to this Apache CXF AbstractJAXWSMethodInvoker.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.