2016-11-16 9 views
0

JBoss EAP 5.1から6.4.7に移行するSOAP Webサービスがあり、Webサービスの1つが絶対に返す何も200(JBoss 5で)。私たちが6に移行したとき、それはまだ動作し、何も返しませんが、代わりに202を返し、それはクライアントを壊すでしょう。私たちはクライアントを支配しません。私はcloseメソッドでSOAPHandlerを試しましたが、SOAPメッセージが戻って来ないので、ハンドラをトリガーするものは何もないので、私の推測と同様に呼び出されないので、何もしません。JBoss 6 EAP - 空の応答を202から200に返すSOAPサービスのHTTP応答ステータスコードを無効にする

また、Webメソッドとmodifで直接コンテキストにアクセスしようとしましたが、何もしませんでした。

MessageContext ctx = wsContext.getMessageContext(); HttpServletResponseレスポンス=(HttpServletResponse)ctx.get(MessageContext.SERVLET_RESPONSE); response.setStatus(HttpServletResponse.SC_OK);

マニュアルに何も見つかりませんでした。

いずれの方向も非常に高く評価されています。これは役に立つでしょうケース誰に

@WebService(name = "ForecastServicePortType", targetNamespace = "http://www.company.com/forecastservice/wsdl") 
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) 
@XmlSeeAlso({ 
    ObjectFactory.class 
}) 
public interface ForecastServicePortType { 


    /** 
    * 
    * @param parameters 
    * @throws RemoteException 
    */ 
    @WebMethod(action = "http://www.company.com/forecast/sendForecast") 
    public void sendForecast(
     @WebParam(name = "SendForecast", targetNamespace = "http://www.company.com/forecastservice", partName = "parameters") 
     SendForecastType parameters) throws RemoteException; 

} 



@WebService(name = "ForecastServicePortTypeImpl", serviceName = "ForecastServicePortType", endpointInterface = "com.company.forecastservice.wsdl.ForecastServicePortType", wsdlLocation = "/WEB-INF/wsdl/ForecastServicePortType.wsdl") 
@HandlerChain(file = "/META-INF/handlers.xml") 
public class ForecastServicePortTypeImpl implements ForecastServicePortType { 
... 

} 

答えて

0

:ここ

ポートとその実装ヘッドがどのように見えるかです:ここでは

は、ポートとその実装のように見えるがどのようです。ここに解決策があります。

Apache CXFはデフォルトで非同期要求を使用し、注釈@OneWayが存在しない場合でも、存在していたとしても動作します。インターセプターは、以下のように作成する必要があることを無効にするために、そう

import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory; 
import org.apache.cxf.binding.soap.SoapMessage; 
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; 
import org.apache.cxf.interceptor.Fault; 
import org.apache.cxf.phase.Phase; 

import java.util.Arrays; 

public class DisableOneWayInterceptor extends AbstractSoapInterceptor { 
    private static final Log LOG = LogFactory.getLog(DisableOneWayInterceptor.class); 

    public DisableOneWayInterceptor(){ 
     super(Phase.PRE_LOGICAL); 
     addBefore(Arrays.asList(org.apache.cxf.interceptor.OneWayProcessorInterceptor.class.getName())); 
    } 

    @Override 
    public void handleMessage(SoapMessage soapMessage) throws Fault { 
     if(LOG.isDebugEnabled()) 
     LOG.debug("OneWay behavior disabled"); 

     soapMessage.getExchange().setOneWay(false); 
    } 
} 

そして、以下のように(@WebServiceと注釈付き)WebServiceクラスで呼び出さ:

@org.apache.cxf.interceptor.InInterceptors (interceptors = {"com.mycompany.interceptors.DisableOneWayInterceptor" }) 
関連する問題