Skip to content

Instantly share code, notes, and snippets.

<?php
$client = new SoapClient('https://kvikbase.kvik.com:44343/webservices/KvikStores.php?wsdl');
$output = $client->get_employees_by_store( array('storeid'=>27, 'languageid'=>1));
var_dump($output);
---
Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in /Users/fangel/Sites/soap-test-riversen.php:4
Stack trace:
<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="https://kvikbase.kvik.com:44343/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="https://kvikbase.kvik.com:44343/">
<types><xsd:schema targetNamespace="https://kvikbase.kvik.com:44343/"
>
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
<xsd:complexType name="Store">
<xsd:all>
<xsd:element name="id" type="xsd:int"/>
<xsd:element name="storeName" type="xsd:string"/>
<?php
ini_set('soap.wsdl_cache_ttl', 0);
$client = new SoapClient('http://kvikbase.kvik.com:8080/webservices/KvikStores.php?wsdl');
$output = $client->get_employees_by_store( 67, 1 );
header("Content-Type: text/html;charset=UTF-8");
foreach( $output AS $emp ) {
<?php
header("Content-Type: text/plain; charset=UTF-8");
try {
// Fetch the server
$server = CNApi::getServer();
// Ask the server to handle the call
$output = $server->handleCall();
<?php
class OAuthServerTest extends PHPUnit_Framework_TestCase {
public function testRejectInvalidConsumer() {
$unknown_consumer = new OAuthConsumer('unknown', '__unused__');
$stub = $this->getMock('OAuthDataStore');
$stub->expects($this->any())
->method('lookup_consumer')
<?php
class ClassUnderTest {
private $table;
public function __construct( $table ) {
$this->table = $table;
}
public function lookup($key) {
window.onload=function(no){var oo=window.onload;return function(){if(typeof oo=='function'){oo();}no();}}(function(ifAO){return function(){var im=document.getElementsByTagName('img');for(var i=0;i<im.length;i++){if(im[i].src&&im[i].src.match(/aoimages\.s3/)){return ifAO();}}}}(function() {
// Enter whatever JS you want run when AidOnline is detected..
alert('You have AidOnline - go away please!');
// End of your own JS..
}));
<?php
/**
* A simple sample OAuth client implementation
*
* :NOTE: This is not Revision A. compliant. I haven't had the time to update it.
*
* :NOTE 2: This is adapted from a more specific-case client, and I haven't tested
* the generalization!
*
<?php
require 'OAuth.php';
$consumer = new OAuthConsumer('consumer-key', 'consumer-secret');
$token = new OAuthToken('token-key', 'token-secret'); // can be both request and access-token
// of course it needs to be an access-token to perform authorized request, but for the call to
// exchange your request-token for an access-token, this needs to be the request-token
<?php
/**
* A Client for Campus Notes' (http://getcampusnotes.com) API
*
* @requires OAuth-php (http://oauth.googlecode.com/svn/code/php/) *
* @copyright Campus Notes (C) 2009
*/
/**