使用Workday API更新员工电话分机遇500错误求助
Workday API更新电话分机问题排查与配置指南
一、XML请求体问题排查
你的XML存在几个关键问题,直接导致500错误:
- Envelope标签结构错误:xmlns命名空间属性必须嵌入
<soapenv:Envelope>标签内,不能单独换行书写,当前写法会破坏XML的合法性,Workday无法解析。 - 缺少电话类型标识:更新分机时必须指定
Phone_Type_Reference(比如办公电话),否则Workday不知道要关联哪条电话记录进行更新。 - 电话号码信息不完整:仅传Extension可能无法匹配到已有电话记录,建议补充
Complete_Phone_Number字段,确保能准确定位目标电话。
修正后的XML示例:
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <!-- xmlns:cus="urn:com.workday/tenants/super/data/custom" --> <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1"> <wsse:UsernameToken> <wsse:Username>ISU_Get_Worker_Photo@mycompany_preview</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PasswordTextxx</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body> <bsvc:Change_Work_Contact_Information_Request bsvc:version="v40.0"> <bsvc:Business_Process_Parameters> <bsvc:Auto_Complete>true</bsvc:Auto_Complete> <bsvc:Run_Now>true</bsvc:Run_Now> </bsvc:Business_Process_Parameters> <bsvc:Change_Work_Contact_Information_Data> <bsvc:Event_Effective_Date>2023-10-20</bsvc:Event_Effective_Date> <bsvc:Person_Reference> <bsvc:ID bsvc:type="Employee_ID">5534</bsvc:ID> </bsvc:Person_Reference> <bsvc:Person_Contact_Information_Data> <bsvc:Person_Phone_Information_Data bsvc:Replace_All="false"> <bsvc:Phone_Information_Data bsvc:Delete="false"> <bsvc:Phone_Type_Reference> <bsvc:ID bsvc:type="Phone_Type_ID">WORK</bsvc:ID> </bsvc:Phone_Type_Reference> <bsvc:Phone_Data bsvc:Formatted_Phone="1 866-282-5797"> <bsvc:Complete_Phone_Number>18662825797</bsvc:Complete_Phone_Number> <bsvc:Extension>5555</bsvc:Extension> </bsvc:Phone_Data> </bsvc:Phone_Information_Data> </bsvc:Person_Phone_Information_Data> </bsvc:Person_Contact_Information_Data> </bsvc:Change_Work_Contact_Information_Data> </bsvc:Change_Work_Contact_Information_Request> </soapenv:Body> </soapenv:Envelope>
二、Workday端配置步骤
启用目标端点
进入Workday后台,路径:Integration > Web Services > Service Configuration,找到Human_Resources服务下的Change_Work_Contact_Information端点,确认其在测试环境已启用。分配用户权限
给认证用户ISU_Get_Worker_Photo@mycompany_preview添加以下权限:- 维护员工联系信息(Maintain Employee Contact Information)
- 若涉及临时员工,需补充维护临时员工联系信息(Maintain Contingent Worker Contact Information)
- 启动"Change Work Contact Information"业务流程的权限
业务流程配置
进入Business Process > Business Process Configuration,找到Change Work Contact Information流程,确认:- 允许API触发该流程
- 开启
Auto_Complete选项(与请求参数保持一致)
三、临时员工的ID类型说明
和Photo API逻辑完全一致:
- 正式员工使用
type="Employee_ID" - 临时员工必须替换为
type="Contingent_Worker_ID",否则Workday无法定位到对应的临时员工记录。
内容的提问来源于stack exchange,提问作者jb62
相关产品推荐
相关产品推荐

