Thursday, May 9, 2013

Wild West Domain (WWD) API Integration for php - Process Request

Wild West Domain (WWD) API Integration for php

I am now just completed the 7 steps for the wild west domain (API) certification and I faced a lot of issues and spent too much time for completing it. Anyway I think it is the best to not check the below codes because when we try to do it our self, we will get a good idea about the working of it.. But in some places there is very much helpless and lose full control. In that time, I think you may use this..

The following are the tutorials: 

From the following link, we will get all available methods using in API

Process Request

function ProcessRequest(){

$cltrid = guid();

$dsc_header = array("POST /wswwdapi/wapi.asmx HTTP/1.1",
"Content-Type: text/xml; charset=utf-8",
"SOAPAction: \"\""

$dsc_msg = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
    <ProcessRequest xmlns="">
      <sRequestXML>'.htmlspecialchars('<wapi clTRID="'.$cltrid.'" account="sdfasdf"
<script cmd="reset"/>

$ch = curl_init("");
if ($ch == FALSE) {
echo "Connecting to createsend failed\n";
curl_setopt($ch,CURLOPT_HTTPHEADER, $dsc_header);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $dsc_msg);
curl_setopt($ch,CURLOPT_VERBOSE, 0);

$result = curl_exec($ch);
echo "Return XML:\n$result\n";


function guid(){
if (function_exists('com_create_guid')){
return com_create_guid();
mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr(45);// "-"
$uuid = chr(123)// "{"
.substr($charid, 0, 8).$hyphen
.substr($charid, 8, 4).$hyphen
.substr($charid,12, 4).$hyphen
.substr($charid,16, 4).$hyphen
.chr(125);// "}"
return $uuid;

No comments:

Post a Comment