如何在ApacheCamel中更改SOAP Web服务端点URL和WSDL URL

如何在ApacheCamel中更改SOAP Web服务端点URL和WSDL URL,soap,apache-camel,cxf,Soap,Apache Camel,Cxf,要求是SOAP WSDL Url和端点Url必须彼此不同。我使用ApacheCamel,下面的ApacheCXF是我的蓝图,但当我在端口8043请求时,那里没有wsdl,当我将其更改为9143时,wsdl就在那里 需要在url上公开wsdl: 端点URL应为: 奇怪的要求。您可以通过添加一个拦截器来禁用WSDLGetInterceptor拦截器 添加拦截器 <bean id="removeWSDLinterceptor" class="my.package.RemoveWSDLIn

要求是SOAP WSDL Url和端点Url必须彼此不同。我使用ApacheCamel,下面的ApacheCXF是我的蓝图,但当我在端口8043请求时,那里没有wsdl,当我将其更改为9143时,wsdl就在那里

需要在url上公开wsdl:

端点URL应为:


奇怪的要求。您可以通过添加一个拦截器来禁用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) {
}
}
公共类RemoveWSDLInterceptor扩展AbstractPhaseInterceptor
{
public RemoveWSDLInterceptor(){
超级(相位接收);
}
公共无效handleMessage(消息消息){
WSDLGetInterceptor getWSDLInterceptor=null;
InterceptorChain=message.getInterceptorChain();

对于(迭代器奇怪的需求。您可以通过添加一个拦截器来禁用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) {
}
}
公共类RemoveWSDLInterceptor扩展AbstractPhaseInterceptor
{
public RemoveWSDLInterceptor(){
超级(相位接收);
}
公共无效handleMessage(消息消息){
WSDLGetInterceptor getWSDLInterceptor=null;
InterceptorChain=message.getInterceptorChain();

for(迭代器)更改两个端口号。其中有两个IP地址。因此,更改两个端口号。其中有两个IP地址。