与cxf jaxws:服务器地址的配置相比,如何避免不正确的url?

时间:2018-11-29 16:40:16

标签: java spring cxf jax-ws

与cxf jaxws:服务器地址相比,如何取消不正确的url?

在我的代码中,可以正确调用ws http://localhost:8080/web_bank_transaction,但是也可以访问我不想要的不准确的unl“ http://localhost:8080/web_bank_transactionXXXanyThingElse ...”,以及如何将其定轨

这是一个代码示例:

我的pom.xml片段: <cxf.version>2.2.3</cxf.version> <spring.version>3.2.3.RELEASE</spring.version>

服务器代码:

  <!-- Import Apache CXF Bean Definition -->
    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>


    <bean id="BankTransaction" class="ws.BankTransactionIMplementation"></bean>

    <jaxws:server id="WebBankTransaction"
                  serviceClass="ws.BankTransaction"
                  address="/web_bank_transaction">
        <jaxws:serviceBean>
            <ref bean="BankTransaction"/> 
        </jaxws:serviceBean>
    </jaxws:server>

BankTransactionIMplementation.java:

package ws;

import javax.jws.WebService;

@WebService(targetNamespace = "http://ws/")
public class BankTransactionIMplementation implements BankTransaction {
    @Override
    public String getAesSeed(String sid) {
        return ("method getAesSeed return sid = [" + sid + "]");
    }
  }

肥皂测试

http://localhost:8080/web_bank_transaction没问题

enter image description here

但是http://localhost:8080/web_bank_transactionXXXXabc也可以 enter image description here

0 个答案:

没有答案