如何在服务调用中排除 Rampart 模块



我们有一个轴 2 服务,它调用 2 另一个服务。对于一个服务呼叫,我们需要城墙安全。因此,我们在 axis2 中对其进行了配置.xml .但是在其他服务调用中,我想排除 rampart,因为该调用不需要安全性。但是由于只有 1 个 axis2.xml这是常见的,因此它在两个调用中都包含 rampart。我怎样才能排除这个.

您可以在服务级别甚至操作级别添加Rampart模块,例如

<service name="name of the service" scope="name of the scope" class="full qualifide name the service lifecycle class"   targetNamespace="target namespase for the service">
    <Description> The description of the service  </Description>  
    <module ref="rampart" />
    <operation name="echoString" mep="operation MEP"> 
        <actionMapping>Mapping to action</actionMapping>
         <module ref="rampart" />
        <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </operation>
</service>

轴 2 配置http://axis.apache.org/axis2/java/core/docs/axis2config.html#Service_Configuration

对于客户端

REPOSITORY_PATH应该有一个名为"modules"的文件夹,而 rampart mar 应该在这个文件夹中。

ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(REPOSITORY_PATH, null);
SimpleServiceStub stub = new SimpleServiceStub(ctx, "http://sbswsvm1426ou:9091/axis2/services/SimpleService?wsdl");
stub._getServiceClient().engageModule("rampart");

最新更新