Once you have activated and configured the web API, you can access it as follows:


The web service contains a single method called 'Execute' with two parameters:

  • strMethod
  • strParametersXML

The function itself is below, together with guidance on usage in the XML comments.

'''Execute Kartris method
'''<param name="strMethod">Name of the method that you want to execute (fully
'''qualified name, case-sensitive) e.g. CKartrisBLL.WebShopURL </param>
'''<param name="strParametersXML">XML parameter array for the specified method</param>
'''<returns>XML Serialized Object</returns>
Public Function Execute(ByVal strMethod As String, ByVal strParametersXML As String) As String

In order for the API calls to be authenticated, the web API secret key value must be passed as the 'Authorization' HTTP Header in the request. The service can be accessed through a standard SOAP request.

e.g. (VBScript)

set xmlhttp = WScript.CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlhttp.Open "POST", "[YourWebShopURLHere]Protected/KartrisWebAPI.svc", False
xmlhttp.setRequestHeader "Authorization", [YourSecretKeyHere]
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.setRequestHeader "SOAPAction", "http://tempuri.org/IKartrisWebAPI/Execute"
xmlhttp.send requestDoc.xml

...where requestDoc.xml is the generated SOAP request. An example of which is shown below:

<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>
  <Execute xmlns='http://tempuri.org/'> 
    &lt;?xml version="1.0" encoding="utf-8" ?&gt;
    &lt;Parameter Name="numTaxID" Type="Byte"&gt;

The method will serialize the output data and return it as an XML string. The sample request above will return a standard SOAP response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <ExecuteResponse xmlns="http://tempuri.org/">
    &lt;?xml version="1.0" encoding="utf-16"?&gt;

Extracted data (HTMLDecoded value):

<?xml version="1.0" encoding="utf-8" ?>

Which can then be XML deserialized in .NET as a "Double" variable with a value of 20. 

Powered by tomeCMS