springboot整合webservice修改cxf自动生成wsdl的soap:address location

近期系统中的webservice接口要上线

通过http://localhost:8080/webServices/testService?wsdl走网关访问时,返回的<soap:address location>是真实业务服务的ip:port。因为我们只能暴露网关的ip和端口,需要将真实服务的ip和端口隐藏起来。

    @Bean
    public Endpoint messagePoint() throws IOException {
        EndpointImpl endpoint = new EndpointImpl(this.springBus(), this.testService);
        endpoint.setPublishedEndpointUrl("http://yourdomain.com/yourServicePath");
        endpoint.publish("/testService");
        return endpoint;
    }

这时候我们在创建Endpoint的时候,可以通过配置setPublishedEndpointUrl()展示wsdl文件中<soap:address location>发布地址。

效果如下:

<wsdl:service name="testService">
<wsdl:port binding="tns:testServiceSoapBinding" name="TestServiceImplPort">
<soap:address location="http://yourdomain.com/yourServicePath"/>
</wsdl:port>
</wsdl:service>

相关推荐

  1. Mybatis与Springboot整合

    2023-12-08 19:26:02       52 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2023-12-08 19:26:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2023-12-08 19:26:02       100 阅读
  3. 在Django里面运行非项目文件

    2023-12-08 19:26:02       82 阅读
  4. Python语言-面向对象

    2023-12-08 19:26:02       91 阅读

热门阅读

  1. 软件测试——集成测试

    2023-12-08 19:26:02       60 阅读
  2. 基于libcurl使用c语言实现http客户端的基础框架

    2023-12-08 19:26:02       43 阅读
  3. vue代码中上传二维码图片,并识别内容

    2023-12-08 19:26:02       55 阅读
  4. 【AI】Pytorch神经网络分类初探

    2023-12-08 19:26:02       54 阅读
  5. AI发展下服务器的选择非常重要

    2023-12-08 19:26:02       47 阅读
  6. 消融实验:深度学习的关键分析工具

    2023-12-08 19:26:02       62 阅读
  7. Mysql、Oracle区分大小写?

    2023-12-08 19:26:02       59 阅读