2016-08-05 5 views
1

のSOAPMessageの中で、私はSOAP Webサービスに取り組んでおり、私がしようとしています。この方法ではBindingOperationInfoはCXF

のhandleMessage(SOAPMessageのメッセージ)

をオーバーライドするCXFのAbstractSoapInterceptorからクラスを拡張していますnullでありますBindingOperationInfoを取得しますが、NULLです。私はcxfバージョン3.1.5を使用していますが、cxfバージョン2.7.5を使用している場合、BindingOperationInfoは操作名の値を持つことになります。

BindingOperationInfoはコードからnullを取得している

public class SoInterceptor extends AbstractWsHeaderInterceptor { 

public SoInterceptor() throws JAXBException { 
    super(); 
} 

@Override 
public void handleMessage(SoapMessage message) throws Fault { 
    Exchange exchange = message.getExchange(); 
    BindingOperationInfo boi = exchange.getBindingOperationInfo(); 
    org.apache.cxf.endpoint.Endpoint endpoint = exchange.getEndpoint(); 
    org.apache.cxf.service.Service service =endpoint.getService(); 

}} 

、以下のクラスを見つけてください。もし私が何かを見逃してしまったら、私に知らせてください。

答えて

0

あなたはこの代わりに

//Get the endpoint 
Endpoint endpoint = message.getExchange().get(Endpoint.class); 

//Get the service called 
Service service = message.getExchange().get(Service.class); 

//Get the details of the operation 
OperationResourceInfo operation = message.getExchange().get(OperationResourceInfo.class); 
を使用することができます