To create a soap client you do this:
$client = new SoapClient("https://planetwin365.com/Controls/CouponWS.asmx?wsdl");
You didn't say exactly which method you wanted to execute. There is a number of coupon related methods you can choose. You can list them out doing this:
var_dump($client->__getFunctions());
Which returns a number of operations you can perform:
GetSaldoResponse GetSaldo(GetSaldo $parameters)
GetDisbilitazioneGirocontiResponse GetDisbilitazioneGiroconti(GetDisbilitazioneGiroconti $parameters)
GetStatoCouponResponse GetStatoCoupon(GetStatoCoupon $parameters)
CouponPromozioneOKResponse CouponPromozioneOK(CouponPromozioneOK $parameters)
GetStatoCouponAsincronoResponse GetStatoCouponAsincrono(GetStatoCouponAsincrono $parameters)
GetSaldoResponse GetSaldo(GetSaldo $parameters)
GetDisbilitazioneGirocontiResponse GetDisbilitazioneGiroconti(GetDisbilitazioneGiroconti $parameters)
GetStatoCouponResponse GetStatoCoupon(GetStatoCoupon $parameters)
CouponPromozioneOKResponse CouponPromozioneOK(CouponPromozioneOK $parameters)
GetStatoCouponAsincronoResponse GetStatoCouponAsincrono(GetStatoCouponAsincrono $parameters)
Choose the one you want to call. For example, let's take a look at GetStatoCoupon()
. We can see that this method takes one parameter called $parameters
and it is a GetStatoCoupon
type structure. The method returns a GetStatoCouponResponse
.
What does the GetStatoCoupon
type look like? To find out do:
var_dump($client->__getTypes());
And we can see that GetStatoCoupon looks like:
[4]=>
string(40) "struct GetStatoCoupon {
int IDCoupon;
}"
We now have enough information to construct a basic call:
$client = new SoapClient("https://planetwin365.com/Controls/CouponWS.asmx?wsdl");
$parameters = new StdClass();
$parameters->IDCoupon = 1234;
$response = $client->GetStatoCoupon($parameters);
My call results in an error because I don't know what values can go into IDCoupon
, but hopefully this answers your question on how to create a SOAP client to get coupons.