Jump to content
  • 0

A sample PHP code using SelectDataRaw API


nkamalan

Question

Here is a sample PHP code using Caspio SelectDataRaw API (Caspio web services API)

---------------------------------------------------------------------------------------------------------------

<?php

//Caspio Bridge WS API WSDL file

$wsdl = "http://b2.caspio.com/ws/api.asmx?wsdl";

//Caspio Bridge table with sample data

$tableName = "table1";

//two columns from table1

$columnName = "field1,field2";

//Caspio Bridge account name

$name = "youraccountname";

//Web service profile

$profile = "yourprofilename";

//Web service profile password

$password = "password";

//create PHP SOAP object

$client = new SOAPClient($wsdl);

// webservice profile

$arr = array();

$arr["AccountID"] = $name;

$arr["Profile"] = $profile;

$arr["Password"] = $password;

$arr["ObjectName"] = $tableName;

$arr["IsView"] = false;

$arr["FieldList"] = $columnName ;

$arr["Criteria"] = "";

$arr["OrderBy"] = "";

$arr["FieldDelimiter"] = "";

$arr["StringDelimiter"] = "";

//create general searh criteria

$resultRecords1 = $client->__call("SelectDataRaw", $arr);

function getData($records) {

if (gettype($records) == "array") {

foreach ($records as $record) {

echo trim($record)."\n" ;

}

}

}

getData($resultRecords1) ;

?>

--------------------------------------------------------------------------------------------------------------

Make sure to replace the red words and WSDL URL in this line of the code:

//Caspio Bridge WS API WSDL file

$wsdl = "http://b2.caspio.com/ws/api.asmx?wsdl";

You can get the WSDL URL from your Caspio Bridge account. To do so, go to Users section, highlight the Profile you have created and click on Properties icon. There you can find all the information about the profile including profile name, password and WSDL URL.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...