11
11
/**
12
12
* @author: Stavarengo
13
13
* @author: davidalves1
14
- * @author: RodrigoJob (eConector)
14
+ * @author: rodrigojob (eConector)
15
15
*/
16
16
class Config extends DefaultStdClass
17
17
{
@@ -33,7 +33,7 @@ class Config extends DefaultStdClass
33
33
* WSDL_CACHE_BOTH = memória e disco
34
34
* WSDL_CACHE_NONE = nenhum
35
35
*/
36
- const WSDL_CACHE = WSDL_CACHE_BOTH ;
36
+ const WSDL_CACHE = WSDL_CACHE_MEMORY ;
37
37
38
38
/**
39
39
* Indica que estamos no ambiente de desenvolvimento.
@@ -51,8 +51,6 @@ class Config extends DefaultStdClass
51
51
const WSDL_PI_PRODUCTION = 'https://cws.correios.com.br/pedidoInformacaoWS/pedidoInformacaoService/pedidoInformacaoWS?wsdl ' ;
52
52
const WSDL_PI_DEVELOPMENT = 'https://apphom.correios.com.br/pedidoInformacaoWS/pedidoInformacaoService/pedidoInformacaoWS?wsdl ' ;
53
53
54
- // const WSDL_REVERSA_PRODUCTION = 'http://webservicescol.correios.com.br/ScolWeb/WebServiceScol?wsdl';
55
- // const WSDL_REVERSA_DEVELOPMENT = 'http://webservicescolhomologacao.correios.com.br/ScolWeb/WebServiceScol?wsdl';
56
54
57
55
/**
58
56
* Endereço para o WSDL AtendeCliente.
@@ -79,12 +77,7 @@ class Config extends DefaultStdClass
79
77
/**
80
78
* @var string
81
79
*/
82
- protected $ wsdlLogisticaReversa = self ::WSDL_LOGISTICA_REVERSA_DEVELOPMENT ;
83
-
84
- /**
85
- * @var string
86
- */
87
- protected $ wsdlPI = self ::WSDL_PI_DEVELOPMENT ;
80
+ protected $ wsdlLogisticaReversa = self ::WSDL_REVERSA_DEVELOPMENT ;
88
81
89
82
/**
90
83
* @var int
@@ -94,7 +87,7 @@ class Config extends DefaultStdClass
94
87
/**
95
88
* @var string
96
89
*/
97
- protected $ xml_encode = self ::XML_ENCODE_ISO ;
90
+ protected $ xml_encode = self ::XML_ENCODE_UTF ;
98
91
99
92
/**
100
93
* @var bool
@@ -173,15 +166,6 @@ public function getWsdlCache()
173
166
return (int ) $ this ->wsdlCache ;
174
167
}
175
168
176
- /**
177
- * @return int
178
- */
179
- public function setWsdlCache ($ wsdlCache )
180
- {
181
- $ this ->wsdlCache = $ wsdlCache ;
182
- return $ this ;
183
- }
184
-
185
169
/**
186
170
* @return int
187
171
*/
@@ -239,8 +223,10 @@ public function setEnv($env, $updateWsdlUrl = true)
239
223
if ($ updateWsdlUrl ) {
240
224
if ($ env == self ::ENV_DEVELOPMENT ) {
241
225
$ this ->setWsdlAtendeCliente (self ::WSDL_ATENDE_CLIENTE_DEVELOPMENT );
226
+ $ this ->setWsdlLogisticaReversa (self ::WSDL_REVERSA_DEVELOPMENT );
242
227
} else {
243
228
$ this ->setWsdlAtendeCliente (self ::WSDL_ATENDE_CLIENTE_PRODUCTION );
229
+ $ this ->setWsdlLogisticaReversa (self ::WSDL_REVERSA_PRODUCTION );
244
230
}
245
231
}
246
232
@@ -289,6 +275,25 @@ public function getWsdlReversa()
289
275
break ;
290
276
}
291
277
}
278
+
279
+ /**
280
+ * @return string
281
+ */
282
+ public function getWsdlLogisticaReversa ()
283
+ {
284
+ return $ this ->wsdlLogisticaReversa ;
285
+ }
286
+
287
+ /**
288
+ * @param string $wsdlLogisticaReversa
289
+ * @return $this
290
+ */
291
+ public function setWsdlLogisticaReversa ($ wsdlLogisticaReversa )
292
+ {
293
+ $ this ->wsdlLogisticaReversa = $ wsdlLogisticaReversa ;
294
+
295
+ return $ this ;
296
+ }
292
297
293
298
/**
294
299
* @param string $wsdlAtendeCliente
@@ -359,42 +364,15 @@ public function getWsdlAgenciaWS()
359
364
return $ this ->wsdlAgenciaWS ;
360
365
}
361
366
362
- /**
363
- * @param $wsdlPI
364
- * @return $this;
365
- */
366
- public function setWsdlPI ($ wsdlPI )
367
- {
368
- $ this ->wsdlPI = $ wsdlPI ;
369
-
370
- return $ this ;
371
- }
372
-
373
- /**
374
- * @return string
375
- */
376
367
public function getWsdlPI ()
377
368
{
378
- return $ this ->wsdlPI ;
379
- }
380
-
381
- /**
382
- * @return string
383
- */
384
- public function getWsdlLogisticaReversa ()
385
- {
386
- return $ this ->wsdlLogisticaReversa ;
387
- }
388
-
389
- /**
390
- * @param string $wsdlLogisticaReversa
391
- * @return $this
392
- */
393
- public function setWsdlLogisticaReversa ($ wsdlLogisticaReversa )
394
- {
395
- $ this ->wsdlLogisticaReversa = $ wsdlLogisticaReversa ;
396
-
397
- return $ this ;
369
+ switch ($ this ->env ) {
370
+ case self ::ENV_PRODUCTION :
371
+ return self ::WSDL_PI_PRODUCTION ;
372
+ case self ::ENV_DEVELOPMENT :
373
+ default :
374
+ return self ::WSDL_PI_DEVELOPMENT ;
375
+ }
398
376
}
399
377
400
378
0 commit comments