gpt4 book ai didi

curl - Workday 请求在 SoapUI 中有效,但在 Postman 中无效

转载 作者:行者123 更新时间:2023-12-05 01:04:46 25 4
gpt4 key购买 nike

我正在尝试调用 Put_Background_Check Workday Recruiting Web 服务的运行。我已经在 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 .身份验证方法是使用用户名@租户和密码的基本身份验证。 HTTP 日志如下所示...
SoapUI HTTP log

问题是,当我尝试在 Postman(或 cURL 或 Python 请求)中重新创建具有相同 header 的相同 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>

最佳答案

在这种情况下,SoapUI 会修改传出的 XML。它在 <env:Body> 之前添加以下 block 在它作为 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 header ,并且它可以正常工作。

关于curl - Workday 请求在 SoapUI 中有效,但在 Postman 中无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41208219/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com