0
我想創建一個http適配器來使用SOAP獲取我的用戶信息,我不知道如何設置我的基本授權,如我使用soapUI工具設置。IBM MobileFirst - 如何在HTTP適配器中使用SOAP設置基本授權?
不添加基本授權(用戶名+密碼),我無法訪問此Web服務。我如何繼續?
SoapAdapter.xml
<displayName>SoapAdapter</displayName>
<description>SoapAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>https</protocol>
<domain>www-304.ibm.com</domain>
<port>443</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>300000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
<!-- Following properties used by adapter's key manager for choosing specific certificate from key store
<sslCertificateAlias></sslCertificateAlias>
<sslCertificatePassword></sslCertificatePassword>
-->
</connectionPolicy>
</connectivity>
SoapAdapter-impl.js
function getUserPro() {
var request =
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://www.ibm.com/tools/wse/ws/">
<soapenv:Header/>
<soapenv:Body>
<ws:ws_getUserCustomerOperation>
<ws:RequestedUserDetails>
<userid>my-email-address</userid>
<group>Customer</group>
</ws:RequestedUserDetails>
</ws:ws_getUserCustomerOperation>
</soapenv:Body>
</soapenv:Envelope>;
var input = {
method : 'post',
returnedContentType : 'xml',
headers:{'Content-Type':'text/xml','Authorization':'Basic ' + ('my-email-address:*******')},
path : '/easytools/runtime/uat/protect/***/Customer/webservices/ws_addProductToCartCustomer.wss?',
body: {
content : request.toString(),
contentType : 'text/xml; charset=utf-8'
}
};
return WL.Server.invokeHttp(input);
}