Re: [SOAP] Is it possible to change a parameter element?

From: Date: Thu, 28 Oct 2010 14:52:30 +0000
Subject: Re: [SOAP] Is it possible to change a parameter element?
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-3125@lists.php.net to get a copy of this message
Figured it out. class MSSoapClient extends SoapClient { function __doRequest($request, $location, $action, $version) { $namespace = "http://www.portalfiscal.inf.br/nfe/wsdl/NfeRecepcao2"; $request = preg_replace('/<ns1:(\w+)/', '<$1 xmlns="'.$namespace.'"', $request); $request = preg_replace('/<ns1:(\w+)/', '<$1', $request); $request = str_replace(array('/ns1:', 'xmlns:ns1="'.$namespace.'"'), array('/', ''), $request); return parent::__doRequest($request, $location, $action, $version); } } $client = new MSSoapClient(...); Good luck! -vatertime Jos&amp;eacute; Ricardo wrote: > > Hi folks, I have tried many ways to generate parameters (arrays and > Objects), but none of them worked. > > I have a WS parameter (in the body of my envelope) which is being > generated like this: > > <ns1:nfeDadosMsg> > > But I need it to be generated like this: > > <nfeDadosMsg > xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeRecepcao2"> > > Is it possible? How can I do it? > > I'd really appreciate your help. > > Thanks in advance, > > Zé Ricardo > > -- > PHP Soap Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- View this message in context: http://old.nabble.com/Is-it-possible-to-change-a-parameter-element--tp29964264p30077474.html Sent from the Php - Soap mailing list archive at Nabble.com.

« previous php.soap (#3125) next »