簡體   English   中英

SUDS釋放身體的SOAP部分

[英]SUDS loosing SOAP part of body

我正在發送SOAP請求以更新某些實體。 當我創建(而不是更新)幾乎相同的東西時,一切正常。 我已經跟蹤了來自Client and Transport的日志記錄,最后它給了我一個線索。 看起來像這樣:

DEBUG:suds.client:sending to (https://webservices.autotask.net/ATServices/1.5/atws.asmx)
message:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://autotask.net/ATWS/v1_5/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
  <ns0:update>
    <ns0:Entities xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ns0:Entity xsi:type="ns0:Ticket">
        <ns0:id>123</ns0:id>
        <ns0:UserDefinedFields xsi:type="xsd:string"></ns0:UserDefinedFields>
        <ns0:AccountID xsi:type="xsd:string">123</ns0:AccountID>
        <ns0:AllocationCodeID xsi:type="xsd:string">123</ns0:AllocationCodeID>
        <ns0:CompletedDate xsi:type="xsd:string">2011-04-04 14:47:02</ns0:CompletedDate>
        <ns0:CreateDate xsi:type="xsd:string">2011-04-04 04:08:02.000203</ns0:CreateDate>
        <ns0:CreatorResourceID xsi:type="xsd:string">123</ns0:CreatorResourceID>
        <ns0:Description xsi:type="xsd:string"></ns0:Description>
        <ns0:DueDateTime xsi:type="xsd:string">2011-04-05 09:36:00</ns0:DueDateTime>
        <ns0:EstimatedHours xsi:type="xsd:string">0.0</ns0:EstimatedHours>
        <ns0:IssueType xsi:type="xsd:string">123</ns0:IssueType>
        <ns0:LastActivityDate xsi:type="xsd:string">2011-04-04 14:47:04.000157</ns0:LastActivityDate>
        <ns0:Priority xsi:type="xsd:string">123</ns0:Priority>
        <ns0:QueueID xsi:type="xsd:string">123</ns0:QueueID>
        <ns0:Status xsi:type="xsd:string">123</ns0:Status>
        <ns0:SubIssueType xsi:type="xsd:string">123</ns0:SubIssueType>
        <ns0:TicketNumber xsi:type="xsd:string">123</ns0:TicketNumber>
        <ns0:Title xsi:type="xsd:string">foo</ns0:Title>
        <ns0:FirstResponseDateTime xsi:type="xsd:string">2011-04-04 14:47:02.000427</ns0:FirstResponseDateTime>
        <ns0:ResolutionPlanDateTime xsi:type="xsd:string">2011-04-04 14:47:02.000427</ns0:ResolutionPlanDateTime>
        <ns0:ResolvedDateTime xsi:type="xsd:string">2011-04-04 14:47:02.000427</ns0:ResolvedDateTime>
        <ns0:Resolution xsi:type="xsd:string"></ns0:Resolution>
    </ns0:Entity>
  </ns0:Entities>
</ns0:update>
</ns1:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:headers = {'SOAPAction': u'"http://autotask.net/ATWS/v1_5/update"';, 'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.transport.http:sending:
URL:https://webservices.autotask.net/ATServices/1.5/atws.asmx
HEADERS: {'Soapaction': u'"http://autotask.net/ATWS/v1_5/update"', 'SOAPAction': u'"http://autotask.net/ATWS/v1_5/update"', 'Content-Type': 'text/xml; charset=utf-8', 'Content-type': 'text/xml; charset=utf-8', 'Authorization': 'Basic YXV0b21hdGlhQGFyY2VzLm5ldDp5dWYkOWFyN2VQaDY='}
MESSAGE:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://autotask.net/ATWS/v1_5/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<ns1:Body>
  <ns0:update>
    <Entities/>
  </ns0:update>
</ns1:Body>
</SOAP-ENV:Envelope>

並且與此我得到一個錯誤:

Object reference not set to an instance of an object.

任何人都知道,這個SOAP請求會發生什么,它會失去整個Entity主體並繼續發送空消息? suds,服務器,代碼對我有問題嗎?

感謝您對正在發生的事情的一點幫助。

我正在回答自己的問題,所以我終於可以結束它了。

如果有人感興趣,問題就解決了。 此處報告的suds.sx中有一個錯誤。 由於使用該請求編輯了SOAP請求,因此我發送的請求為空。 要更正它,我必須刪除sx部分並使用MessagePlugin對其進行更改。 如果有人有興趣-在這里寫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM