SUDS 失去身体的肥皂部分

发布于 2024-11-02 09:10:06 字数 3874 浏览 0 评论 0原文

我正在发送 SOAP 请求来更新某些实体。当我创建(而不是更新)几乎相同的东西时,一切正常。我跟踪了客户端和传输的日志记录,最后它给了我一个线索。它看起来像这样:

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 请求会发生什么,它会丢失整个实体主体并继续处理空消息吗?是肥皂水、服务器、代码、我的问题吗?

感谢您为理解正在发生的事情提供的任何帮助。

I'm sending a SOAP request to update some entity. When I create (instead of update) nearly same thing, everything works fine. I've tracked logging from Client and Transport and finally it gave me a clue. It looks like this:

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>

And with this I get an error:

Object reference not set to an instance of an object.

Anyone has any idea, what happens with this SOAP request, that it looses it's whole Entity body and proceed an empty message? Is it a problem with suds, server, code, me?

Thanks for any little help in understing what's happening.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最冷一天 2024-11-09 09:10:06

我正在回答我自己的问题,所以我终于可以关闭它了。

如果有人感兴趣,问题就解决了。 此处报告了 suds.sx 中存在一个错误。由于 SOAP 请求是用此编辑的,所以我发送的请求是空的。为了纠正它,我必须删除 sx 部分并使用 MessagePlugin 进行更改。如果有人感兴趣 - 写在这里。

I'm answering my own question, so I can finally close it.

If anyone will be interested, the problem was solved. There is a bug in suds.sx reported here. As the SOAP request was edited with this one, the request which I sent was empty. To correct it, I had to delete the sx part and change it with a MessagePlugin. If anyone will be interested - write here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文