我正在尝试调用Workday Recruiting Web服务的Put_Background_Check操作。我在SoapUI中打开了WSDL文件并成功发送了以下XML ...
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wd="urn:com.workday/bsvc">
<env:Body>
<wd:Put_Background_Check_Request
xmlns:wd="urn:com.workday/bsvc"
wd:version="v26.2">
<wd:Business_Process_Parameters>
<wd:Run_Now>true</wd:Run_Now>
</wd:Business_Process_Parameters>
<wd:Background_Check_Data>
<wd:Event_Reference>
<wd:ID wd:type="Background_Check_ID">BACKGROUND_CHECK_EVENT-6-96</wd:ID>
</wd:Event_Reference>
<wd:Background_Check_Status_Data>
<wd:Status_Date>2016-12-16</wd:Status_Date>
<wd:Status_Reference>
<wd:ID wd:type="Background_Check_Status_ID">Background_Check_Status_Pending</wd:ID>
</wd:Status_Reference>
</wd:Background_Check_Status_Data>
<wd:Package_Reference_Data>
<wd:Package_Reference>
<wd:ID wd:type="Background_Check_Package_ID">BACKGROUND_CHECK_PACKAGE_QR1SQ</wd:ID>
</wd:Package_Reference>
<wd:Status_Reference>
<wd:ID wd:type="Background_Check_Status_ID">Background_Check_Status_Pending</wd:ID>
</wd:Status_Reference>
</wd:Package_Reference_Data>
</wd:Background_Check_Data>
</wd:Put_Background_Check_Request>
</env:Body>
</env:Envelope>
我收到以下回复......
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<wd:Put_Background_Check_Response wd:version="v26.2" xmlns:wd="urn:com.workday/bsvc">
<wd:Event_Reference wd:Descriptor="Background Check for Job Application: Elizabeth Taylor - R0000039 Diversity Report Test (Open)">
<wd:ID wd:type="WID">ee6477431cb2100ca61ac0100d041523</wd:ID>
<wd:ID wd:type="Background_Check_ID">BACKGROUND_CHECK_EVENT-6-96</wd:ID>
</wd:Event_Reference>
</wd:Put_Background_Check_Response>
</env:Body>
</env:Envelope>
网址为 https://wd3-impl-services1.workday.com/ccx/service/TENANT/Recruiting/v27.1 。身份验证方法是基本身份验证,用户名@ tenant和密码。 HTTP日志如下所示......
问题在于,当我尝试在Postman(或cURL或Python请求)中使用相同的标头重新创建相同的POST请求时,我收到无效的用户名或密码错误。 SoapUI在这里做些什么特别的事吗?这种情况下的答复如下......
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wd="urn:com.workday/bsvc">
<faultcode>SOAP-ENV:Client.authenticationError</faultcode>
<faultstring>invalid username or password</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
答案 0 :(得分:1)
在这种情况下,SoapUI会修改传出的XML。它在<env:Body>
元素之前添加了以下块,然后将其作为POST请求发送出去。
<env:Header>
<wsse:Security
env:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-86F2FCCEFFBB80C4CD14820998755791">
<wsse:Username>username@tenant</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">asdfwrqwarqwr1+oA==
</wsse:Nonce>
<wsu:Created>2016-12-18T22:24:30.575Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</env:Header>
所以我已经将其添加到原始XML中,并从请求中删除了Basic Auth标头,它可以正常工作。