2017-10-26 17 views
1

要件はSOAP WSDL URLであり、エンドポイントURLは互いに異なる必要があります。私はApache CamelとApache CXFを使用しています。私の青写真ですが、ポート8043でリクエストすると、そこにwsdlがありません.Wsdlが9143に変更されました。Apache CamelでSOAP WebサービスのエンドポイントURLとWSDL URLを変更する方法

URLにWSDLを公開する必要があります。http://0.0.0.0:8043/Services/Interface/FSServices/FSServices.serviceagent?wsdl

エンドポイントURLは次のように:http://0.0.0.0:9143/Services/Interface/FSServices/FSServices.serviceagent/PortTypeEndpoint1/

<cxf:cxfEndpoint 
     address="http://0.0.0.0:8043/Services/Interface/FSServices/FSServices.serviceagent" 
     id="fsEndpoint" serviceClass="pk.com.herman.fs.operation.PortType"> 
     <cxf:properties> 
      <entry key="publishedEndpointUrl" value="http://0.0.0.0:9143/Services/Interface/FSServices/FSServices.serviceagent/PortTypeEndpoint1/"/> 
     </cxf:properties> 
    </cxf:cxfEndpoint> 
+0

したがって、両方のポート番号を変更してください。そこには2つのIPアドレスがあります。 – Namphibian

答えて

0

奇妙な要件。これを行うには、WSDLGetInterceptorインターセプタを無効にするインターセプタを追加します。

インターセプタ

<bean id="removeWSDLinterceptor" 
    class="my.package.RemoveWSDLInterceptor" /> 

<cxf:cxfEndpoint address="http://0.0.0.0:8043/Services/Interface/FSServices/FSServices.serviceagent" 
    id="fsEndpoint" serviceClass="pk.com.herman.fs.operation.PortType"> 
    <cxf:inInterceptors> 
     <ref bean="removeWSDLinterceptor" /> 
    </cxf:inInterceptors> 
</cxf:cxfEndpoint> 

を追加しインターセプタ

public class RemoveWSDLInterceptor extends AbstractPhaseInterceptor<Message> 
{ 

public RemoveWSDLInterceptor() { 

    super(Phase.RECEIVE); 
} 

public void handleMessage(Message message) { 
    WSDLGetInterceptor getWSDLInterceptor = null; 
    InterceptorChain chain = message.getInterceptorChain(); 

    for(Iterator<Interceptor<? extends Message>> iter = chain.iterator(); iter.hasNext();) { 
     Interceptor getWSDLInterceptor = iter.next(); 
     if (interceptor instanceof WSDLGetInterceptor) { 
      getWSDLInterceptor = (WSDLGetInterceptor) interceptor; 
     } 
    } 
    chain.remove(getWSDLInterceptor); 
} 

public void handleFault(Message messageParam) { 
} 
} 

そして、あなたは静的WSDLを返すために、小さな桟橋のルートを追加することができます。

<route> 
     <from uri="jetty://http://0.0.0.0:9143" /> 
     <to uri="language:constant:resource:file:/path/to/your/wsdlfile.wsdl"/> 
</route> 
関連する問題