SOAP example usage, sample request and response

Follow

Wodify_Bar_All.png

This article will walk you through everything you need to know about Wodify's SOAP API. SOAP is a standard communication protocol system that permits processes using different operating systems like Linux and Windows to communicate via HTTP and its XML.


In this article, we will cover:

 

WSDL Link

https://app.wodify.com/API/WOD_v1.asmx?wsdl


SOAP Example Usage


<!doctype HTML>
<html>  
<head> </head>  
<body>  
  <?php    
    //SOAP Method              
    class GetWOD {            
      public $APIKey;            
      public $Date;            
      public $LocationText;            
      public $ProgramText;              
     
      function __construct($apikey, $date, $locationname, $programname){
        $this->APIKey = $apikey;                
        $this->Date = $date;                
        $this->LocationText = $locationname;                
        $this->ProgramText = $programname;              
      }        
    }          
   
    $SOAPClient = new SoapClient("https://app.wodify.com/API/WOD_v1.asmx?wsdl", array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));                 
    $error = 0;        
    $soapResponse = "";        
    try {        
      //NOTE: Change the variables in the call below to the right values
      $soapResponse = $SOAPClient->GetWOD(new GetWOD('API KEY', 'DATE in YYYY-MM-DD format', 'LOCATION NAME', 'PROGRAM NAME'));        
    } catch (SoapFault $fault) { 
      $error = 1;             
      print("Sorry, GetWOD returned the following ERROR: ".$fault->faultcode."-".$fault->faultstring);         
    }          
    if ($error == 0) {    
      if (is_null($soapResponse)) {                     
        print("NULL response");                
      } else {         
        echo $soapResponse->WOD->FormattedWOD;        
      }
    }    
  ?>  
</body>  
</html>


SOAP Sample Request

 

POST /API/WOD_v1.asmx HTTP/1.1
Host: dev.wodify.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
  <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetWOD xmlns="http://www.outsystems.com">
      <APIKey>string</APIKey>
      <Date>string</Date>
      <LocationText>string</LocationText>
      <ProgramText>string</ProgramText>
    </GetWOD>
  </soap12:Body>
</soap12:Envelope>


SOAP Sample Response

 

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
  <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetWODResponse xmlns="http://www.outsystems.com">
      <WOD>
        <WodHeader>
          <Tenant_Id>int</Tenant_Id>
          <Id>int</Id>
          <Date>date</Date>
          <ShouldPublish>boolean</ShouldPublish>
          <PublishDateTime>dateTime</PublishDateTime>
          <Name>string</Name>
          <Comments>string</Comments>
          <OwnershipLevelId>int</OwnershipLevelId>
          <UserId>int</UserId>
          <ProgramId>int</ProgramId>
          <BlogPostId>string</BlogPostId>
          <IsPostUpdateRequired>boolean</IsPostUpdateRequired>
          <IsPostedToFacebook>boolean</IsPostedToFacebook>
          <HasBeenSaved>boolean</HasBeenSaved>
          <CreatedBy>int</CreatedBy>
          <CreatedOn>dateTime</CreatedOn>
          <UpdatedBy>int</UpdatedBy>
          <UpdatedOn>dateTime</UpdatedOn>
          <IsActive>boolean</IsActive>
        </WodHeader>
        <CreatedDate>date</CreatedDate>
        <UpdatedDate>string</UpdatedDate>
        <Location>
          <Tenant_Id>int</Tenant_Id>
          <Id>int</Id>
          <Name>string</Name>
          <StreetAddress1>string</StreetAddress1>
          <StreetAddress2>string</StreetAddress2>
          <City>string</City>
          <StateId>int</StateId>
          <ZipCode>string</ZipCode>
          <CountryId>int</CountryId>
          <Province>string</Province>
          <CreatedBy>int</CreatedBy>
          <CreatedOn>dateTime</CreatedOn>
          <UpdatedBy>int</UpdatedBy>
          <UpdatedOn>dateTime</UpdatedOn>
          <IsActive>boolean</IsActive>
        </Location>
        <Program>
          <Tenant_Id>int</Tenant_Id>
          <Id>int</Id>
          <Name>string</Name>
          <Description>string</Description>
          <Color>string</Color>
          <PublishExternally>boolean</PublishExternally>
          <CreatedBy>int</CreatedBy>
          <CreatedOn>dateTime</CreatedOn>
          <UpdatedBy>int</UpdatedBy>
          <UpdatedOn>dateTime</UpdatedOn>
          <Is_Active>boolean</Is_Active>
        </Program>
        <Announcements>
          <Announcement>
            <Id>int</Id>
            <Message>string</Message>
            <FromDate>date</FromDate>
            <ToDate>date</ToDate>
            <IsExternal>boolean</IsExternal>
            <CreatedBy>int</CreatedBy>
            <CreatedOn>dateTime</CreatedOn>
            <UpdatedBy>int</UpdatedBy>
            <UpdatedOn>dateTime</UpdatedOn>
            <IsActive>boolean</IsActive>
          </Announcement>
          <Announcement>
            <Id>int</Id>
            <Message>string</Message>
            <FromDate>date</FromDate>
            <ToDate>date</ToDate>
            <IsExternal>boolean</IsExternal>
            <CreatedBy>int</CreatedBy>
            <CreatedOn>dateTime</CreatedOn>
            <UpdatedBy>int</UpdatedBy>
            <UpdatedOn>dateTime</UpdatedOn>
            <IsActive>boolean</IsActive>
          </Announcement>
        </Announcements>
        <Components>
          <APIComponent>
            <Id>int</Id>
            <ComponentTypeName>string</ComponentTypeName>
            <OwnershipLevelName>string</OwnershipLevelName>
            <UserName>string</UserName>
            <Name>string</Name>
            <Description>string</Description>
            <IsBenchmark>boolean</IsBenchmark>
            <HasBeenSaved>boolean</HasBeenSaved>
            <IsNewComponentEmailSent>boolean</IsNewComponentEmailSent>
            <AllowRxPlus>boolean</AllowRxPlus>
            <Rounds>int</Rounds>
            <Comments>string</Comments>
            <RepScheme>string</RepScheme>
            <PerformanceResultTypeName>
              string
            </PerformanceResultTypeName> 
          </APIComponent>
          <APIComponent>
            <Id>int</Id>
            <ComponentTypeName>string</ComponentTypeName>
            <OwnershipLevelName>string</OwnershipLevelName>
            <UserName>string</UserName>
            <Name>string</Name>
            <Description>string</Description>
            <IsBenchmark>boolean</IsBenchmark>
            <HasBeenSaved>boolean</HasBeenSaved>
            <IsNewComponentEmailSent>boolean</IsNewComponentEmailSent>
            <AllowRxPlus>boolean</AllowRxPlus>
            <Rounds>int</Rounds>
            <Comments>string</Comments>
            <RepScheme>string</RepScheme>
            <PerformanceResultTypeName>
              string
            </PerformanceResultTypeName>
          </APIComponent>
        </Components>
      </WOD>
    </GetWODResponse>
  </soap12:Body>
</soap12:Envelope>

 

If you need any additional assistance with SOAP, feel free to reach out to us at support@wodify.com or via Priority Live Chat in your admin account (Promote only).

Comments

Check the current status of our products

View status