Code Samples
C# (Tested)
private string getProductSellable()
{
ASCIIEncoding encoding = new ASCIIEncoding();
string SampleXml = @"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"">
<s:Body xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<GetProductSellableRequest xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/"">
<wsVersion xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/"">1.0.0</wsVersion>
<id xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/"">Token1</id>
<password xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/"">Token1</password>
<productId xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/"">Token1</productId>
<partId xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/"">token1</partId>
<isSellable xmlns=""http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/"">true</isSellable>
</GetProductSellableRequest>
</s:Body>
</s:Envelope>";
try
{
byte[] data = encoding.GetBytes(SampleXml);
string url = "https://api.proactiveclothing.com/services/Product.svc";
HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
webrequest.Method = "POST";
webrequest.Headers.Add("SOAPAction", "getProductSellable");
webrequest.ContentType = "text/xml";
webrequest.ContentLength = data.Length;
using (Stream newStream = webrequest.GetRequestStream())
{
newStream.Write(data, 0, data.Length);
using (WebResponse response = webrequest.GetResponse())
using (Stream responseStream = response.GetResponseStream())
{
StreamReader sr = new StreamReader(responseStream);
string s = sr.ReadToEnd();
return s;
}
}
}
catch (WebException webex)
{
return webex.Message;
}
}
PHP (Tested)
<?php
try {
$client = new SoapClient("https://api.proactiveclothing.com/wsdl/ProductDataService.wsdl");
class parms {
function parms($username, $password) {
$this->wsVersion = 1;
$this->id = $username;
$this->password = $password;
$this->productId = 0;
$this->partId = 0;
$this->isSellable = false;
}
}
$p = new parms("api@xx.co.za", "xxx");
$params = array($p);
$response =$client->__soapCall("getProductSellable",$params);
echo "PASS";
echo json_encode($response);
} catch(SoapFault $fault) {
//echo(var_dump($response));
echo "FAIL";
echo $fault;
}
?>
Web API Url's (End points)
Product Data Service
End Point: https://api.proactiveclothing.com/services/Product.svc
WSDL: https://api.proactiveclothing.com/wsdl/ProductDataService.wsdl
Version: 1.0.0
Operation: getProductSellable
Purpose: Fetch full range of products
Request Body: (Change id and Password)
<GetProductSellableRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/">
<wsVersion xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</wsVersion>
<id xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</id>
<password xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</password>
<productId xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</productId>
<partId xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</partId>
<isSellable xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Toekn1</isSellable>
</GetProductSellableRequest>
Product Data Service
End Point: https://api.proactiveclothing.com/services/Product.svc
WSDL: https://api.proactiveclothing.com/wsdl/ProductDataService.wsdl
Version: 1.0.0
Operation: getProduct
Purpose: Fetch single product by productId
Request Body: (Change id, password and productId)
<GetProductRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/">
<wsVersion xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</wsVersion>
<id xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</id>
<password xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</password>
<localizationCountry xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">l1</localizationCountry>
<localizationLanguage xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">l1</localizationLanguage>
<productId xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</productId>
<partId xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">Token1</partId>
<colorName>Token1</colorName>
<ApparelSizeArray>
<ApparelSize xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">
<apparelStyle>Unisex</apparelStyle>
<labelSize>OSFA</labelSize>
<customSize>customSize1</customSize>
</ApparelSize>
<ApparelSize xmlns="http://www.proactiveclothing.com/WSDL/ProductDataService/1.0.0/SharedObjects/">
<apparelStyle>Youth</apparelStyle>
<labelSize>6XS</labelSize>
<customSize>customSize2</customSize>
</ApparelSize>
</ApparelSizeArray>
</GetProductRequest>
Media Content Service
End Point: https://api.proactiveclothing.com/services/Media.svc
WSDL: https://api.proactiveclothing.com/wsdl/MediaContentService.wsdl
Version: 1.0.0
Operation: getMediaContent
Purpose: Fetch images per product
Request Body: (Change id, password and productId)
<GetMediaContentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/">
<wsVersion xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">Token1</wsVersion>
<id xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">Token1</id>
<password xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">Token1</password>
<cultureName xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">cultureName1</cultureName>
<mediaType xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">Image</mediaType>
<productId xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">Token1</productId>
<partId xmlns="http://www.proactiveclothing.com/WSDL/MediaService/1.0.0/SharedObjects/">Token1</partId>
<classType>1</classType>
</GetMediaContentRequest>
Pricing and Configuration Service
End Point: https://api.proactiveclothing.com/services/PricingAndConfiguration.svc
WSDL: https://api.proactiveclothing.com/wsdl/PricingAndConfiguration.wsdl
Version: 1.0.0
Operation: getConfigurationAndPricing
Purpose: Fetch pricing per product
Request Body: (Change id, password and productId)
**All prices provided are standard prices excluding any discounts (to view Partnership Program details and terms, please click here)
**On sale and products marked while stocks last do not qualify for a discount. Certain products may also be excluded (please refer to our Partnership Program terms and conditions link above).
<GetConfigurationAndPricingRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/">
<wsVersion xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</wsVersion>
<id xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</id>
<password xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</password>
<productId xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</productId>
<currency xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">AFA</currency>
<fobId xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</fobId>
<priceType xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">LIST</priceType>
<localizationCountry xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">l1</localizationCountry>
<localizationLanguage xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">l1</localizationLanguage>
<configurationType xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">DECORATED</configurationType>
</GetConfigurationAndPricingRequest>
Pricing and Configuration Service
End Point: https://api.proactiveclothing.com/services/PricingAndConfiguration.svc
WSDL: https://api.proactiveclothing.com/wsdl/PricingAndConfiguration.wsdl
Version: 1.0.0
Operation: getDecorationColors
Purpose: Fetch colours per product
Request Body: (Change id, password and productId)
<GetDecorationColorsRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/">
<wsVersion xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</wsVersion>
<id xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</id>
<password xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</password>
<locationId xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">1</locationId>
<productId xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">Token1</productId>
<decorationId xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">1</decorationId>
<localizationCountry xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">l1</localizationCountry>
<localizationLanguage xmlns="http://www.proactiveclothing.com/WSDL/PricingAndConfiguration/1.0.0/SharedObjects/">l1</localizationLanguage>
</GetDecorationColorsRequest>
Inventory Service
End Point: https://api.proactiveclothing.com/services/Inventory.svc
WSDL: https://api.proactiveclothing.com/wsdl/InventoryService.wsdl
Version: 1.0.0
Operation: getInventoryLevels
Purpose: Fetch stock levels per product
Request Body: (Change id, password and productId)
<Request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.proactiveclothing.com/WSDL/InventoryService/1.0.0/">
<wsVersion>Token1</wsVersion>
<id>Token1</id>
<password>Token1</password>
<productID>Token1</productID>
<productIDtype>productIDtype1</productIDtype>
</Request>
All Product Data in 1 Method Call.
Web Page: https://mass-supply.co.za/products-xml
Purpose: Fetch a single xml feed with all products and related data.
Sample Code in C#: (Change username and password in the SampleXML variable)
**All prices provided are standard prices excluding any discounts (to view Partnership Program details and terms, please click here)
**On Sale and End of Range products are not subjected to any discounts
private string getProductDataXML()
{
ASCIIEncoding encoding = new ASCIIEncoding();
string SampleXml = @"<Credentials>
<username>email@domain.com</username>
<password>xxxxxxx</password>
</Credentials>";
try
{
byte[] data = encoding.GetBytes(SampleXml);
string url = "https://mass-supply.co.za/products-xml";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
byte[] bytes;
bytes = System.Text.Encoding.ASCII.GetBytes(SampleXml);
request.ContentType = "text/xml; encoding='utf-8'";
request.ContentLength = bytes.Length;
request.Method = "POST";
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
HttpWebResponse response;
response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
Stream responseStream = response.GetResponseStream();
string responseStr = new StreamReader(responseStream).ReadToEnd();
return responseStr;
}
return null;
}
catch (WebException webex)
{
return webex.ToString();
}
}