VoidWarranty

VoidWarranty Input

  • <?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>
      • <VoidWarranty xmlns="http://www.consumerpriorityservice.com/services/">
        • <VoidWarrantyRequest>
          • <Authentication>
            • <DealerId>int</DealerId>
            • <SubAccountId>int</SubAccountId>
            • <ApiKey>string</ApiKey>
          • </Authentication>
          • <WarrantySerial>string</WarrantySerial>
        • </VoidWarrantyRequest>
      • </VoidWarranty>
    • </soap:Body>
  • </soap:Envelope>


Argument Type Details
Authentication ApiAuthenticationType
Authentication.DealerId Int Your Dealer ID
Authentication.SubAccountId Int (optional) Your SubAccount ID
Authentication.ApiKey String Your API Key
WarrantySerial String Warranty # to be cancelled

VoidWarranty Output

  • <?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>
      • <VoidWarrantyResponse xmlns="http://www.consumerpriorityservice.com/services/">
        • <VoidWarrantyResult>
          • <Ack>string</Ack>
          • <Errors>
            • <ErrorsType>
              • <ErrorID>int</ErrorID>
              • <ErrorMessage>string</ErrorMessage>
            • </ErrorsType>
          • </Errors>
        • </VoidWarrantyResult>
      • </VoidWarrantyResponse>
    • </soap:Body>
  • </soap:Envelope>


Argument Type Details
Ack String success / fail
Errors ErrorsType
Errors.ErrorID Int Error Number
Errors.ErrorMessage String Detailed error message

Classic ASP Sample

const SoapServer = "https://www.consumerpriorityservice.com/services/api.asmx?wsdl"

set xmldom = server.CreateObject("Microsoft.XMLDOM")
set xmlhttp = server.CreateObject("Microsoft.XMLHTTP")

xmlhttp.open "POST", SoapServer, false
xmlhttp.setRequestHeader "Man", POST & " " & SoapServer & " HTTP/1.1"
xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
xmlhttp.setRequestHeader "SOAPAction", "http://www.consumerpriorityservice.com/services/VoidWarranty"

StrSoap = StrSoap & "<?xml version=""1.0"" encoding=""utf-8""?>"
StrSoap = StrSoap & "<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/"">"
StrSoap = StrSoap & "<soap:Body>"
StrSoap = StrSoap & "<VoidWarranty xmlns=""http://www.consumerpriorityservice.com/services/"">"
StrSoap = StrSoap & "<VoidWarrantyRequest>"
StrSoap = StrSoap & "<WarrantySerial>XXXXXX</WarrantySerial>"
StrSoap = StrSoap & "<Authentication>"
StrSoap = StrSoap & "<DealerId>DEALERID</DealerId>"
StrSoap = StrSoap & "<SubAccountId>SUBACCOUNTID</SubAccountId>"
StrSoap = StrSoap & "<ApiKey>APIKEY</ApiKey>"
StrSoap = StrSoap & "</Authentication>"
StrSoap = StrSoap & "</VoidWarrantyRequest>"
StrSoap = StrSoap & "</VoidWarranty>"
StrSoap = StrSoap & "</soap:Body>"
StrSoap = StrSoap & "</soap:Envelope>"

xmlhttp.send(StrSoap)	
	
if xmlhttp.Status = 200 then	
Set xmldom = xmlhttp.responseXML
'NO SERVER ERROR
'CHECK FOR API ERROR
Response.write(xmlhttp.responseText)
Else
'SERVER ERROR
Response.Write(xmlhttp.responseText)
End if

set xmlhttp = nothing
set xmldom = nothing
    

.NET Sample

Create a Web Reference named "cpsapi" with URL https://www.consumerpriorityservice.com/services/api.asmx

Dim voidRequest As New cpsapi.VoidWarrantyRequestType
voidRequest.Authentication = New cpsapi.AuthenticationType
voidRequest.Authentication.DealerId = DEALERID
voidRequest.Authentication.ApiKey = "DEALERKEY"
voidRequest.WarrantySerial = "XXXXXX"

Dim m4 As New cpsapi.CpsServices

Dim response4 As cpsapi.VoidWarrantyResponseType
response4 = m4.VoidWarranty(voidRequest)
If response4.Ack = "success" Then
    Response.Write("SUCCESS VOIDWARRANTY")    
Else
    For i As Integer = 0 To response4.Errors.GetUpperBound(0)
        Response.Write("VOIDWARRANTY ERROR: " & response4.Errors(i).ErrorMessage)
    Next
End If    
    

PHP Sample


<?php
    require_once('nusoap/lib/nusoap.php');
    $soapaction = "http://www.consumerpriorityservice.com/services/VoidWarranty";
    $wsdl = "https://www.consumerpriorityservice.com/services/api.asmx";
    $namespace = "http://www.consumerpriorityservice.com/services/";
	
    $xml = '<VoidWarranty xmlns=""http://www.consumerpriorityservice.com/services/"">
        <VoidWarrantyRequest>
        <WarrantySerial>XXXXXX</WarrantySerial>
        <Authentication>
        <DealerId>DEALERID</DealerId>
        <SubAccountId>SUBACCOUNTID</SubAccountId>
        <ApiKey>APIKEY</ApiKey>
        </Authentication>
        </VoidWarrantyRequest>
        </VoidWarranty>';

    $client = new nusoap_client($wsdl);
    $err = $client->getError();
    if ($err) {
	    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    }
    $client->soap_defencoding = 'UTF-8';
    $mysoapmsg = $client->serializeEnvelope($xml);
	
    echo str_replace("><","><br/>",htmlspecialchars($client->serializeEnvelope($xml)));

    $result = $client->send($mysoapmsg, $soapaction);
	
    echo '<h2>Request</h2><pre>' . str_replace("><","><br/><",htmlspecialchars($client->request, ENT_QUOTES)) . '</pre>';
    echo '<h2>Response</h2><pre>' . str_replace("><","><br/><",htmlspecialchars($client->response, ENT_QUOTES)) . '</pre>';
    echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
?>