scoop / autotask_api

Ruby API wrapper for the Autotask WebService API
MIT License
14 stars 9 forks source link

Issue with XML formatting. #8

Closed jholtom closed 9 years ago

jholtom commented 9 years ago

While running the sample code, I am presented with the following error.

D, [2015-07-06T17:53:36.391415 #53230] DEBUG -- : HTTPI GET request to webservices3.autotask.net (httpclient)
I, [2015-07-06T17:53:36.697307 #53230]  INFO -- : SOAP request: https://webservices3.autotask.net/ATServices/1.5/atws.asmx
I, [2015-07-06T17:53:36.697455 #53230]  INFO -- : SOAPAction: "http://autotask.net/ATWS/v1_5/query", Content-Type: text/xml;charset=UTF-8, Content-Length: 346
D, [2015-07-06T17:53:36.703347 #53230] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://autotask.net/ATWS/v1_5/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <tns:query xmlns="http://autotask.net/ATWS/v1_5/"/>
  </env:Body>
</env:Envelope>

D, [2015-07-06T17:53:36.703852 #53230] DEBUG -- : HTTPI POST request to webservices3.autotask.net (httpclient)
I, [2015-07-06T17:53:37.147121 #53230]  INFO -- : SOAP response (status 200)
D, [2015-07-06T17:53:37.147504 #53230] DEBUG -- : <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <queryResponse xmlns="http://autotask.net/ATWS/v1_5/">
      <queryResult>
        <ReturnCode>-1</ReturnCode>
        <EntityResults/>
        <EntityResultType/>
        <Errors>
          <ATWSError>
            <Message>Object reference not set to an instance of an object.</Message>
          </ATWSError>
          <ATWSError>
            <Message>Error reading in Query XML.</Message>
          </ATWSError>
        </Errors>
        <EntityReturnInfoResults/>
      </queryResult>
    </queryResponse>
  </soap:Body>
</soap:Envelope>

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><queryResponse xmlns="http://autotask.net/ATWS/v1_5/"><queryResult><ReturnCode>-1</ReturnCode><EntityResults /><EntityResultType /><Errors><ATWSError><Message>Object reference not set to an instance of an object.</Message></ATWSError><ATWSError><Message>Error reading in Query XML.</Message></ATWSError></Errors><EntityReturnInfoResults /></queryResult></queryResponse></soap:Body></soap:Envelope>

Cursory googling appears to say that this is an issue with the XML formatting, but as far as I can tell all of the Nokogiri XML builders spit out perfectly good requests. Thoughts?

Thanks! Jacob

scoop commented 9 years ago

Jacob,

we're on the UK system (werbservices7) and it works fine there. Could you check to see if the US version has a newer version of the API in place?

Thanks, Patrick

jholtom commented 9 years ago
~ » wget https://webservices3.autotask.net/atservices/1.5/atws.wsdl                                                                                                                            
2015-07-07 07:04:31 (1.68 MB/s) - ‘atws.wsdl’ saved [122584/122584]
~ » mv atws.wsdl atws3.wsdl                                                                                                                                                                   
~ » wget https://webservices7.autotask.net/atservices/1.5/atws.wsdl                                                                                                                           
2015-07-07 07:04:46 (303 KB/s) - ‘atws.wsdl’ saved [122584/122584]
~ » mv atws.wsdl atws7.wsdl                                                                                                                                                                    
~ » diff atws3.wsdl atws7.wsdl                                                                                                                                                                 
2386c2386
<                       <soap:address location="https://webservices3.autotask.net/ATServices/1.5/atws.asmx" />
---
>                       <soap:address location="https://webservices7.autotask.net/ATServices/1.5/atws.asmx" />

The two systems WSDL's appear identical beyond the difference in host. Autotask also provides no documentation saying there is a difference. A manual query of the API also returns the same error. I'll reach out to Autotask and see if they have anything to say about it.