Skip to content

Commit 1858059

Browse files
author
Michael v/d Rijt
committed
Merge pull request #2 from vitorbari/master
Added trace option
2 parents b2ff17c + 9434cce commit 1858059

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/Artisaninweb/SoapWrapper/Service.php

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class Service {
2323
*/
2424
protected $wsdl;
2525

26+
/**
27+
* @var boolean
28+
*/
29+
protected $trace;
30+
2631
/**
2732
* @var resource
2833
*/
@@ -56,6 +61,29 @@ public function getName()
5661
return $this->name;
5762
}
5863

64+
/**
65+
* Set trace option - enables tracing of request
66+
*
67+
* @param $trace
68+
* @return $this
69+
*/
70+
public function trace($trace)
71+
{
72+
$this->trace = $trace;
73+
74+
return $this;
75+
}
76+
77+
/**
78+
* Get the trace option
79+
*
80+
* @return boolean
81+
*/
82+
public function getTrace()
83+
{
84+
return $this->trace;
85+
}
86+
5987
/**
6088
* Set the wsdl of the service
6189
*
@@ -241,7 +269,11 @@ public function setSoapHeaders()
241269
*/
242270
protected function createClient()
243271
{
244-
$this->client = new SoapClient($this->getWsdl());
272+
$options = [
273+
'trace' => $this->getTrace()
274+
];
275+
276+
$this->client = new SoapClient($this->getWsdl(), $options);
245277

246278
return $this;
247279
}

0 commit comments

Comments
 (0)