GetJobHistoryResponse 元素
所需的 GetJobHistoryResponse 元素返回已完成作业的摘要。
使用情况
<wscn:GetJobHistoryResponse>
child elements
</wscn:GetJobHistoryResponse>
属性
没有属性。
子元素
元素 |
---|
JobHistory |
父元素
没有父元素。
注解
WSD 扫描服务必须支持 GetJobHistoryResponse 操作元素。
客户端可以调用 GetJobHistoryRequest 来确定以前完成的作业的作业相关变量的值。 WSD 扫描服务必须使用 GetJobHistoryResponse 操作元素进行响应,该操作元素包含客户端请求的信息或相应的错误代码。
WSD 扫描服务维护的作业历史记录量特定于实现。
示例
下面的代码示例演示如何不返回作业历史记录以响应客户端的作业历史记录请求。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="https://schemas.xmlsoap.org/ws/2003/03/addressing"
xmlns:wscn="https://schemas.microsoft.com/windows/2006/01/wdp/scan"
soap:encodingStyle='https://www.w3.org/2002/12/soap-encoding' >
<soap:Header>
<wsa:To>
https://schemas.xmlsoap.org/ws/2003/03/addressing/role/anonymous
</wsa:To>
<wsa:Action>
https://schemas.microsoft.com/windows/2006/01/wdp/scan/GetJobHistory
</wsa:Action>
<wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
<wsa:RelatesTo>uuid:MsgIdOfTheGetJobHistoryRequest</wsa:RelatesTo>
</soap:Header>
<soap:Body>
<wscn:GetJobHistoryResponse>
<wscn:JobHistory />
</wscn:GetJobHistoryResponse >
</soap:Body>
</soap:Envelope>
下面的代码示例返回最后两个已完成作业的作业和关联数据的列表。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="https://schemas.xmlsoap.org/ws/2003/03/addressing"
xmlns:wscn="https://schemas.microsoft.com/windows/2006/01/wdp/scan"
soap:encodingStyle='https://www.w3.org/2002/12/soap-encoding' >
<soap:Header>
<wsa:To>
https://schemas.xmlsoap.org/ws/2003/03/addressing/role/anonymous
</wsa:To>
<wsa:Action>
https://schemas.microsoft.com/windows/2006/01/wdp/scan/GetJobHistory
</wsa:Action>
<wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
<wsa:RelatesTo>uuid:MsgIdOfTheGetJobHistoryRequest</wsa:RelatesTo>
</soap:Header>
<soap:Body>
<wscn:GetJobHistoryResponse>
<wscn:JobHistory>
<wscn:JobSummary>
<wscn:JobId>1</wscn:JobId>
<wscn:JobName>SampleJob 1</wscn:JobName>
<wscn:JobOriginatingUserName>Joe.Smith</wscn:JobOriginatingUserName>
<wscn:JobState>Completed</wscn:JobState>
<wscn:JobStateReasons>
<wscn:JobStateReason>None</wscn:JobStateReason>
</wscn:JobStateReasons>
<wscn:ScansCompleted>4</wscn:ScansCompleted>
</wscn:JobSummary>
<wscn:JobSummary>
<wscn:JobId>2</wscn:JobId>
<wscn:JobName>Sample Job 2</wscn:JobName>
<wscn:JobOriginatingUserName>JaneRogers</wscn:JobOriginatingUserName>
<wscn:JobState>Canceled</wscn:JobState>
<wscn:JobStateReasons>
<wscn:JobStateReason>JobCanceledAtDevice</wscn:JobStateReason>
</wscn:JobStateReasons>
<wscn:ScansCompleted>1</wscn:ScansCompleted>
</wscn:JobSummary>
</wscn:JobHistory>
</wscn:GetJobHistoryResponse >
</soap:Body>
</soap:Envelope>