Common API Examples
Title: | registerDomain method under DomOrder class of Domains kit |
Description: | The registerDomain method accepts complex variable/parameters whose usage cannot be easily illustrated using HTML forms. Hence, this feature cannot emulated from within your Reseller Control Panel through the Settings -> API -> Emulate API Calls -> Domains API Kit Emulator interface. |
Solution: | An example of XML sent and received for this method is provided below for reference. |
Example XML: | XML Sent:
<?xml version="1.0" encoding="UTF-8"?> XML Received: <?xml version="1.0" encoding="UTF-8"?> |
Common API Errors and their Solution
Title: | Sending Integers as numbers rather than as strings |
Description: | Due to the limitations of Java, we cannot accept integers (e.g. 1) as numbers in a hash, rather they must be sent to us as strings (i.e. "1"). This is a recurrent problem when using the PHP Kit since PHP puts in Integers as plain numbers (in a hash). |
Solution: | Ensure that you're sending in numbers as strings |
Example XML: | XML Sent:
POST /anacreon/servlet/rpcrouter HTTP/1.0 User-Agent: NuSOAP/0.6.7 (1.7) Host: www.myorderbox.com Content-Type: text/xml; charset=ISO-8859-1 SOAPAction: "" Content-Length: 1543 <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:impl="com.logicboxes.foundation.sfnb.order.DomOrder" xmlns:apachesoap="http://xml.apache.org/xml-soap"><SOAP-ENV:Body><impl:regis terDomain xmlns:impl="com.logicboxes.foundation.sfnb.order.DomOrder"><userName xsi:type="xsd:string">xxxxx@zzz.com</userName><password xsi:type="xsd:string">xxxxx4</password><role xsi:type="xsd:string">reseller</role><langpref xsi:type="xsd:string">en</langpref><parentid xsi:type="xsd:int">1</parentid><domainHash xsi:type="apachesoap:Map"><item><key xsi:type="xsd:string">fbc-elroy.com</key><value xsi:type="xsd:int">1</value></item></domainHash><ns xsi:type="apachesoap:Vector"><item xsi:type="xsd:string">ns11.zzz.com</item><item xsi:type="xsd:string">ns12.zzz.com</item></ns><registrantContactId xsi:type="xsd:int">1548641</registrantContactId><adminContactId xsi:type="xsd:int">1548641</adminContactId><techContactId xsi:type="xsd:int">1548641</techContactId><billingContactId xsi:type="xsd:int">1548641</billingContactId><customerId xsi:type="xsd:int">321841</customerId><invoiceOption xsi:type="xsd:string">NoInvoice</invoiceOption></impl:registerDomain></SOAP- ENV:Body></SOAP-ENV:Envelope> XML Received: HTTP/1.0 500 Internal Server Error Server: Resin/3.0.s041002 Content-Type: text/xml; charset=utf-8 Date: Fri, 10 Jun 2005 16:40:04 GMT <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>com.logicboxes.error.LogicBoxesException#~#com.logicboxes.util. Util#~#java.lang.Integer#~#error#~#</faultstring> <detail/> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> |
Title: | Incorrect Parent ID |
Description: | An incorrect parent id is passed when trying to connect to the server |
Solution: | Pass the correct parent id. You might be passing the one for demo while connecting to the live environment, or vice-versa. |
Example XML: | Error Received:
Error Code: 2, SOAP raised an error. Error Details: |
Title: | Maximum Number of Connections to the Registry Exceeded |
Description: | When too many users send commands to the same Registry using a particular Registrar's connections, then an error would be displayed |
Solution: | This is a temporary issue and you need to simply try after sometime. Since the Registry provides each Registrar with a set number of connections, when these get exhausted an exception is thrown. |
Example XML: | Error Received:
01-jul-2005 16:43:31 org.apache.axis.client.Call invoke |
Title: | Error received when making https calls using the .NET API Kit |
Description: | You may receive an error when trying to make an https call using our .NET API Kit since your .NET API Client needs to set a system security property to allow the system to accept SSL certificates. |
Solution: | You need to add a class in your project (or the .NET Examples that we provide) having the following lines of code: Imports System.Security.Cryptography.X509Certificates
Public Class TrustAllCertificatePolicy Implements System.Net.ICertificatePolicy Public Sub New() End Sub Public Function CheckValidationResult(ByVal srvPoint As System.Net.ServicePoint, ByVal certificate As System.Security.Cryptography.X509Certificates.X509Certificate, ByVal request As System.Net.WebRequest, ByVal certificateProblem As Integer) As Boolean Implements System.Net.ICertificatePolicy.CheckValidationResult Return True End Function End Class
Also the user needs to include the following line of code before making the any function call to the https URL: System.Net.ServicePointManager.CertificatePolicy = New TrustAllCertificatePolicy We would suggest that you include the above line in the NetAPI.vb class constructor. After performing all the above steps, you would be able to make the https calls using the .NET API Kit without any error. |
Example XML: | Error Received
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. |