I seem to have a very strange bug where one of my elements in the SOAP request is being renamed from 'string' to 'item' after a period of time.
I have generated my RPC driver from wsdl2ruby, and I access it using the following, from my Rails application.
postitem_api = PostItemSoap?.new
postitem_api.optionsprotocol.http.basic_auth? << ['http://removed', username, password]
get_items_array_of_string = ArrayOfString?.new
get_items_array_of_string << post_id.to_s
get_items_request = GetItems?.new(get_items_array_of_string)
postitem_api.return_response_as_xml = true
#postitem_api.wiredump_dev = STDERR
doc = Hpricot(postitem_api.getItems(get_items_request))
This usually generates:
POST /ngws/svc/PostItem.asmx HTTP/1.1
SOAPAction: "http://services.newsgator.com/ngws/svc/PostItem.asmx/GetItems"
Content-Type: text/xml; charset=utf-8
User-Agent: SOAP4R/1.5.8 (/187, ruby 1.8.6 (2007-06-07) [universal-darwin9.0])
Date: Mon, 12 Nov 2007 14:09:03 GMT
Content-Length: 409
Host: removed
<?xml version="1.0" encoding="utf-8" ?>
<n1:Envelope xmlns:n1="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<n1:Body>
<GetItems? xmlns="http://services.newsgator.com/ngws/svc/PostItem.asmx">
<postIds>
<string>19266</string>
</postIds>
</GetItems>
</n1:Body>
</n1:Envelope>
But it sometimes seems to generate the following, for no obvious reason at all. And it then gets stuck using item instead of string until I restart the Rails application.
POST /ngws/svc/PostItem.asmx HTTP/1.1
SOAPAction: "http://services.newsgator.com/ngws/svc/PostItem.asmx/GetItems"
Content-Type: text/xml; charset=utf-8
User-Agent: SOAP4R/1.5.8 (/187, ruby 1.8.6 (2007-06-07) [universal-darwin9.0])
Date: Mon, 12 Nov 2007 14:16:30 GMT
Content-Length: 405
Host: removed
<?xml version="1.0" encoding="utf-8" ?>
<n1:Envelope xmlns:n1="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<n1:Body>
<GetItems? xmlns="http://services.newsgator.com/ngws/svc/PostItem.asmx">
<postIds>
<item>18357</item>
</postIds>
</GetItems>
</n1:Body>
</n1:Envelope>