Как запретить неточный URL по сравнению с конфигом cxf jaxws: адрес сервера? - PullRequest
0 голосов
/ 29 ноября 2018

Как запретить неточный URL по сравнению с cxf jaxws: адрес сервера?

В моем коде 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

...