Demo


Have a look at the examples below for inspiration on how to use the TDC connections.


 Aspect, Rim, Ratio Search

This is a basic implementation of a tire search by Rim, Size and Aspect Ratio page.

Demo
 Tire Size Search

This is a basic implementation of a tire search by size page.

Demo
 Search by Product Code

This is a basic implementation of a tire search by product code page.

Demo






Code Snippets

The following code snippets should help you get started with using the web services. Feel free to copy and amend as required.


<?php

// Get width, aspect and rim info from form data
$width = $_POST["width"];
$aspect = $_POST["aspect"];
$rim = $_POST["rim"];

// Replace youraccesskey, yourgrouptoken and yourconnectionID by your credentials given to you when you signed up for tiredataconnect
$input_xml = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
    <GetTires xmlns="http://ws.tirewire.com/connectionscenter/productsservice">
    <options>
        <AccessKey>youraccesskey</AccessKey>
        <GroupToken>yourgrouptoken</GroupToken>
        <ConnectionID>yourconnectionID</ConnectionID>
        <Width>'.$width.'</Width>
        <Aspect>'.$aspect.'</Aspect>
        <Rim>'.$rim.'</Rim>
    </options>
    </GetTires>
</soap:Body>
</soap:Envelope>';

//set headers
$headers = array("Content-type: text/xml;charset\"=utf-8\"",
           "Accept: text/xml",
           "Cache-Control: no-cache",
           "Pragma: no-cache",
           "SOAPAction: http://ws.tirewire.com/connectionscenter/productsservice/GetTires", 
           "Content-length: ".strlen($input_xml)
           );

$url = 'http://ws.tirewire.com/connectionscenter/productsservice.asmx';

try{
    //use curl for soap request
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $input_xml);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                                    
    $data = curl_exec($ch);

    curl_close($ch);

    $response1 = str_replace("<soap:Body>","",$data);
    $response2 = str_replace("</soap:Body>","",$response1);

    $parser = simplexml_load_string($response2);

    //loop through result
    if ( !empty( $parser->GetTiresResponse->GetTiresResult->Tires->Tire ) ) {
        foreach($parser->GetTiresResponse->GetTiresResult->Tires->Tire as $items)
        {
            echo "<img src= https://tireweb.tirelibrary.com/images/Products/".(string) $items->PatternID . ".jpg><br>";
            echo (string) $items->ProductCode . "<br>";
            echo (string) $items->Name . "<br>";
            echo (string) $items->BuyPrice . "<br>";
            echo (string) $items->SellPrice . "<br>";
            echo (string) $items->Quantity . "<br>";
            echo (string) $items->Make . "<br>";
            echo (string) $items->Pattern . "<br>";
            echo "<img src= " .(string) $items->TireMake->ImageURL . "><br>";		
        }
    }
    else{
        echo "<h5>No Tires of this size in Dataset</h5>";
    }
                                    
}

catch(Exception $e){
    echo "Error!";
    echo $e -> getMessage();
    }

?> 
                            

from suds.client import Client
client = Client('http://ws.tirewire.com/connectionscenter/productsservice.asmx?wsdl', retxml=True)
request_data = client.factory.create('tns:GetTiresOptions')

# put your own credentials here
request_data.AccessKey ="youraccesskey"
request_data.GroupToken = "yourgrouptoken"
request_data.ConnectionID ="yourconnectionid"

request_data.TireSize="tiresize"
result = client.service.GetTires(request_data)

from bs4 import BeautifulSoup

soup = BeautifulSoup(result, 'xml')

tires = []

for tire in soup.find_all('Tire'):
    t = {
        'ProductCode': tire.ProductCode.string,
        'Name': tire.Name.string,
        'BuyPrice': tire.BuyPrice.string,
        'Quantity': tire.Quantity.string,
        'Make': tire.Make.string,
        'Pattern': tire.Pattern.string,
        'Image': "<img src = https://tireweb.tirelibrary.com/images/Products/" + tire.PatternID.string + ".jpg>",
        'MakeImage': '<img src= ' + tire.TireMake.ImageURL.string + '>'
        }
    tires.append(t)

    print(tires)
  
                            

require 'savon'

# Create a client to talk to our webservices
client = Savon.client(wsdl: 'http://ws.tirewire.com/connectionscenter/productsservice.asmx?wsdl',
                      endpoint: 'http://ws.tirewire.com/connectionscenter/productsservice.asmx')

client.operations

# make a request using your credentials
response = client.call(:get_tires, 
                       :message => { 'options' => { 'AccessKey'=> 'youraccesskey' , 'GroupToken' => 'yourgrouptoken', 'ConnectionID' => 'yourconnectionid' , 'TireSize' => 'tiresize'}})

print response.to_xml       

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Add service reference from wsdl file
using ConsoleApp1.ServiceReference1;

namespace ConsoleApp1
{
    class Example
    {
        static void Main(string[] args)
        {
            ServiceReference1.ConnectionsCenterProductsServiceSoapClient client = new ConnectionsCenterProductsServiceSoapClient();
            GetTiresOptions options = new GetTiresOptions();

            //enter your credentials
            options.AccessKey = "youraccesskey";
            options.GroupToken = "yourgrouptoken";
            options.ConnectionID = yourconnectionid;

            options.TireSize = "2056515";
            var response = client.GetTires(options);
            Console.WriteLine(response);
            
        }
    }
}
Check out the Tirewire docs for more in-depth help on how to use the webservices.