Soap WSDL in php
Ik heb wat moeite om een php script werkend te krijgen.
Ik ben sinds kort publisher en kreeg te horen dat ik
webservice moet gebruiken om aan extra info te komen.
Nu heb ik wel wat verstand van php maar niet zo veel
van SOAP en WSDL.
Dit is wat ik tot nu toe heb geschreven:
Quote:
details zijn er uit ge-edit.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
details zijn er uit ge-edit.
En dit is de webservice:
Quote:
Name: optionalInfo
Binding: GozingWebServicesBinding
Endpoint: http://network.thinkaction.com/api/soap_affiliate.php
SoapAction: http://network.thinkaction.com/api/soap_affiliate.php/optionalInfo
Style: rpc
Input:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: optionalInfoRequest
parts:
client: xsd:string
add_code: xsd:string
password: xsd:string
start_date: xsd:string
end_date: xsd:string
program_id: xsd:int
opt_info: xsd:string
Output:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: optionalInfoResponse
parts:
return: xsd:string
Namespace: http://soapinterop.org/
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: Optional Information - Retrieve the leads and sales information for your sub-affiliates
Required fields - client, add_code, password
Optional fields - start_date, end_date, program_id, opt_info
Name: recordHostedLead
Binding: GozingWebServicesBinding
Endpoint: http://network.thinkaction.com/api/soap_affiliate.php
SoapAction: http://network.thinkaction.com/api/soap_affiliate.php/recordHostedLead
Style: rpc
Input:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: recordHostedLeadRequest
parts:
client: xsd:string
add_code: xsd:string
password: xsd:string
lead: xsd:string
Output:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: recordHostedLeadResponse
parts:
return: xsd:int
Namespace: http://soapinterop.org/
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: Record Hosted Form Lead
Required fields - Client, Password, Lead. The Lead string format is available on the affiliate interface
Binding: GozingWebServicesBinding
Endpoint: http://network.thinkaction.com/api/soap_affiliate.php
SoapAction: http://network.thinkaction.com/api/soap_affiliate.php/optionalInfo
Style: rpc
Input:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: optionalInfoRequest
parts:
client: xsd:string
add_code: xsd:string
password: xsd:string
start_date: xsd:string
end_date: xsd:string
program_id: xsd:int
opt_info: xsd:string
Output:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: optionalInfoResponse
parts:
return: xsd:string
Namespace: http://soapinterop.org/
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: Optional Information - Retrieve the leads and sales information for your sub-affiliates
Required fields - client, add_code, password
Optional fields - start_date, end_date, program_id, opt_info
Name: recordHostedLead
Binding: GozingWebServicesBinding
Endpoint: http://network.thinkaction.com/api/soap_affiliate.php
SoapAction: http://network.thinkaction.com/api/soap_affiliate.php/recordHostedLead
Style: rpc
Input:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: recordHostedLeadRequest
parts:
client: xsd:string
add_code: xsd:string
password: xsd:string
lead: xsd:string
Output:
use: encoded
namespace: http://soapinterop.org/
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: recordHostedLeadResponse
parts:
return: xsd:int
Namespace: http://soapinterop.org/
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: Record Hosted Form Lead
Required fields - Client, Password, Lead. The Lead string format is available on the affiliate interface
En toen...
SOrry vergeten er bij te zetten.
Wat moet het doen en krijg je errors zoja kun je het posten
het werkt zo dat de client, add_code en password worden verzonden naar de api en hij iets returnt. De errors zijn "Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/admin/bucketsurvey.com/por.php on line 5".
je mist komma's in je array
Als je meerdere dingen doet doe je : dit , dit , dit . Achter al die stukjes in de array moet een komma behalve bij de laatste
Quote:
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
<?php
$url = "http://network.thinkaction.com/api/soap_affiliate.php?wsdl";
$client = new SoapClient("$url");
$result = $client->optionalInfo(array('client' => '000000', 'add_code' => 'CD00000', password' => '000000000000000'));
echo ('$results');
?>
$url = "http://network.thinkaction.com/api/soap_affiliate.php?wsdl";
$client = new SoapClient("$url");
$result = $client->optionalInfo(array('client' => '000000', 'add_code' => 'CD00000', password' => '000000000000000'));
echo ('$results');
?>
ik heb het veranderd in dit maar hij laat dezelfde fout zien. De start_date, end_date en program_id zijn niet nodig om te runnen
Toevoeging op 22/03/2011 22:51:42:
Haal de quotes eens weg op r4 / om de echo ( geen quotes om vars
Gewijzigd op 22/03/2011 22:52:24 door Jordi Kroon
Quote:
Ik krijg deze error:
Notice: Array to string conversion in /home/admin/bucketsurvey.com/por.php on line 5
Fatal error: Uncaught SoapFault exception: [Invalid Login] (null) in /home/admin/bucketsurvey.com/por.php:5 Stack trace: #0 [internal function]: SoapClient->__call('optionalInfo', Array) #1 /home/admin/bucketsurvey.com/por.php(5): SoapClient->optionalInfo(Array) #2 {main} thrown in /home/admin/bucketsurvey.com/por.php on line 5
Code (php)
Ik krijg deze error:
Notice: Array to string conversion in /home/admin/bucketsurvey.com/por.php on line 5
Fatal error: Uncaught SoapFault exception: [Invalid Login] (null) in /home/admin/bucketsurvey.com/por.php:5 Stack trace: #0 [internal function]: SoapClient->__call('optionalInfo', Array) #1 /home/admin/bucketsurvey.com/por.php(5): SoapClient->optionalInfo(Array) #2 {main} thrown in /home/admin/bucketsurvey.com/por.php on line 5
Toevoeging op 23/03/2011 17:52:55:
Quote:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?php
require_once('nusoap.php');
$c = new soapclient('http://network.thinkaction.com/api/soap_affiliate.php?wsdl');
$result = $c->__call('optionalInfo', array('client'=> '*****','add_code' => '***','password'=> '*****'));
echo $result;
?>
require_once('nusoap.php');
$c = new soapclient('http://network.thinkaction.com/api/soap_affiliate.php?wsdl');
$result = $c->__call('optionalInfo', array('client'=> '*****','add_code' => '***','password'=> '*****'));
echo $result;
?>
de respond die ik krijg is:
weet iemand waardoor ik niet meer info krijg??