WC_Correios_Soap_Client

WC_Correios_Soap_Client class.

Defined (1)

The class is defined in the following location(s).

/includes/class-wc-correios-soap-client.php  
  1. class WC_Correios_Soap_Client extends SoapClient { 
  2.  
  3. /** 
  4. * SoapClient construct. 
  5. * @param mixed $wsdl WSDL URL. 
  6. */ 
  7. public function __construct( $wsdl ) { 
  8. parent::__construct( $wsdl, array( 
  9. 'cache_wsdl' => WSDL_CACHE_NONE,  
  10. 'encoding' => 'UTF-8',  
  11. 'exceptions' => true,  
  12. 'stream_context' => $this->get_custom_stream_context(),  
  13. ); 
  14.  
  15. /** 
  16. * Get a custom stream context to improve performance. 
  17. * @return resource Of type stream-context. 
  18. */ 
  19. private function get_custom_stream_context() { 
  20. return stream_context_create( array( 'http' => array( 'protocol_version' => '1.0', 'header' => 'Connection: Close' ) ) );