File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,6 +70,20 @@ public function doRequest($servico, $argumentos)
7070 }
7171
7272 if (is_string ($ argumentos )) {
73+ /* @see http://php.net/manual/pt_BR/function.libxml-use-internal-errors.php */
74+ libxml_use_internal_errors (true );
75+ $ xml = simplexml_load_string ($ argumentos );
76+
77+ if ($ xml === false ) {
78+ foreach (libxml_get_errors () as $ error ) {
79+ throw new Exception ('Ocorreu um erro ao processar o XML de envio: ' . $ error ->message );
80+ }
81+ }
82+
83+ if ($ xml = $ xml ->children ('soapenv ' , true )) {
84+ $ argumentos = $ xml ->Body ->children ()->asXML ();
85+ }
86+
7387 $ argumentos = [new SoapVar ($ argumentos , XSD_ANYXML )];
7488 }
7589
@@ -147,7 +161,7 @@ public function formatXML($soap)
147161 if (!$ soap ) {
148162 return null ;
149163 }
150-
164+
151165 $ dom = new DOMDocument ;
152166 $ dom ->preserveWhiteSpace = false ;
153167 $ dom ->formatOutput = true ;
You can’t perform that action at this time.
0 commit comments