mule4 - 如何在 Mule 4 中使用安全的 SOAP Web 服务
问题描述
您好我有一个安全的 SOAP 网络服务。我可以使用凭据成功地从 Soap UI 中点击。当我尝试在任何点工作室中配置 Web 服务时,我收到一条警告说无法获取元数据。但是,如果运行应用程序,我在尝试连接到 Web 服务时会出错。
Message : Error trying to acquire a new connection:null
我认为我为服务设置凭据的方式不正确。在 Soap UI 中,我将其设置为屏幕截图所示。如何在 Studio 中设置?我在工作室尝试了安全选项卡,但没有运气。
解决方案
我假设您正在使用 Web 服务使用者连接器来使用外部 SOAP Web 服务。屏幕截图显示 SOAP UI 正在使用 HTTP 基本身份验证。要重现这一点,您需要将 Web 服务使用者配置为指向配置 HTTP 身份验证的 HTTP 请求者配置,如官方文档中所述:https ://docs.mulesoft.com/web-service-consumer-connector/ 1.5/web-service-consumer-configure#setting-a-custom-http-transport-configuration
例子:
<http:request-config name="basic-auth">
<http:request-connection host="www.someplace.com" port="8182" protocol="HTTP">
<http:authentication>
<http:basic-authentication username="alejandro.garcia" password="nariz"/>
</http:authentication>
</http:request-connection>
</http:request-config>
<wsc:config name="with-custom-transport">
<wsc:connection wsdlLocation="http://www.host.com?WSDL" service="Service" port="Port">
<wsc:custom-transport-configuration>
<wsc:http-transport-configuration requesterConfig="basic-auth"/>
</wsc:custom-transport-configuration>
</wsc:connection>
</wsc:config>
推荐阅读
- dart - Flutter: Future Builder fetch multiple data
- unity3d - 如何从不同的场景访问对象的组件?
- symfony - 无法使用 symfony ldap 连接到 ldap 服务器
- nhibernate - NHibernate 设置获取策略
- angular - 入口组件的 Angular 注册表
- regex - sed 删除第三个下划线之后的所有文本(包括第三个下划线)
- php - 运行 cron 作业时出现网关超时错误
- swift - ActivityViewController 弹出窗口不在屏幕顶部
- html - 我无法使用自动策略在 Chrome 上静音
- java - springboot同步方法