These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
Need help limiting API Asset list dump.
https://api.eveonline.com/char/AssetList.xml.aspx?keyID=123456&vCode=ABCDEF123456&characterID=123456
EVEWalletAware - an offline wallet manager.
Public Function ewaGetXML(ByVal sURL As String, Optional ByVal sParams As String = vbNullString) As String'------------------------------------------------------------------------------'Purpose : Retrieves a XML file from a web service (web server)''Prereq. : Reference to MS XML (6.0), set in menu Extras -> References'Parameter: sURL - URL to query, i.e. https://api.eveonline.com/server/ServerStatus.xml.aspx' sParams - Parameters to be passed to the web service' i.e. keyID=MyAPIKeyID&vCode=MyVCode=&characterID=12345'Returns : Contents of XML'Note : -'' Author: Hel O'Ween 07.06.2014' Source: -' Changed: -'------------------------------------------------------------------------------Dim oHTTP As MSXML2.ServerXMLHTTPDim bolResult As BooleanDim sHTTPStatus As String, sResult As StringDim lAPIResult As Long, sAPIText As String, lRetry As LongOn Error GoTo GetXMLErrHandler' Create instance of MS XML parserSet oHTTP = New MSXML2.ServerXMLHTTP ' ** Timeouts' Set timeouts (in milliseconds) if needed, default timeouts are:' - ResolveTo: 0' - ConnectTo: 60000' - SendTo: 300000' - ReceiveTo: 4800000oHTTP.setTimeouts eHTTPTimeouts.ResolveTo, eHTTPTimeouts.ConnectTo, eHTTPTimeouts.SentTo, eHTTPTimeouts.ReceiveTo ' Prepare the HTTP POST commandoHTTP.Open "POST", sURL, True' ** Proxy' Configure web proxy, if necessary' specify the proxy server either via its host name or IP address'oHTTP.setProxy SXH_PROXY_SET_PROXY, my.proxy.tld' In case the proxy needs authentification ...'oHTTP.setProxyCredentials MyUsername, MyPassword' ** Misc. HTTP headers' * The folowing part sets HTTP headers.' Be polite and let the server know the name of your tooloHTTP.setRequestHeader "USER-AGENT", "MyTool"' Required header for letting the server know we're using the HTTP POST' method to query for information and that we're passing parameters to the' serveroHTTP.setRequestHeader "CONTENT-TYPE", "application/x-www-form-urlencoded"oHTTP.setRequestHeader "CONTENT-LENGTH", CStr(Len(sParams))' Info headers. CCP requests that you provide contact information via X-headers' in order to contact you in case you're tool runs 'amok' on their servers.' They might otherwise just ban your IP address from the API serversoHTTP.setRequestHeader "X-Developer-Contact", "myemail@mydomain.test"' Duplicate the tool informationoHTTP.setRequestHeader "X-Application-Info", "MyTool" ' Add the necessary parameters for the query' i.e. keyID=MyAPIKeyID&vCode=MyVCode=&characterID=12345oHTTP.send sParams' Asynchronous sending of request to the web serviceDo While oHTTP.readyState < eHTTPReadyState.Loaded DoEvents ' Count retries so we don't end up in an endless loop lRetry = lRetry + 1 ' Keep waiting for the server's answer oHTTP.waitForResponse eHTTPTimeouts.ConnectTo If lRetry > 5 Then Exit Do End If LooplRetry = 0Do While oHTTP.readyState < eHTTPReadyState.Completed DoEvents ' Count retries so we don't end up in an endless loop lRetry = lRetry + 1 ' Keep waiting for the server's answer oHTTP.waitForResponse eHTTPTimeouts.ReceiveTo If lRetry > 5 Then Exit Do End If Loop' Remember the web server's status answersHTTPStatus = CStr(oHTTP.Status) & vbNewLine & oHTTP.statusText' We received a OK - 200?If oHTTP.Status = 200 Then sResult = oHTTP.responseXML.XML ' We receive a response, but is there content? If Len(sResult) Then bolResult = True Else bolResult = False End If Else ' Even though the server returned a status other than OK - 200, it still might ' send an XML response, see https://forums.eveonline.com/default.aspx?g=posts&t=287747&find=unread sResult = oHTTP.responseXML.XML If Len(sResult) Then bolResult = True Else bolResult = False End IfEnd If'------------------GetXMLErrExit:Set oHTTP = NothingIf bolResult = True Then ewaGetXML = sResultElse ewaGetXML = "No results returned"End IfOn Error GoTo 0Exit Function'------------------GetXMLErrHandler:' ** Do some logging/error reporting herebolResult = FalseResume GetXMLErrExitEnd Function'==============================================================================