It's must look like:

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" 
xmlns:ns1="http://tempuri.org/" xmlns:ns2="http://www.w3.org/2005/08/addressing"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:rgs="Rgs.Ufo" xmlns:xsi="xsi">

Now it's

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="Rgs.Ufo" xmlns:ns2="http://www.w3.org/2005/08/addressing">

I need add xmlns:rgs="Rgs.Ufo" and xmlns:xsi="xsi"

I try something like

  $params[] = new \SoapVar('',XSD_ANYXML, '123', null, 'Envelope', 'http://www.w3.org/2001/XMLSchema');
       $params[] = new \SoapVar('',XSD_ANYXML, '', null, 'Envelope', 'http://www.w3.org/2001/XMLSchema-instance');

.....
  $data = $client->SomeFucntion(new \SoapVar($params, XSD_ANYXML));

It didn't help

Full

$client = new \SoapClient('https://someurl',array("soap_version" => SOAP_1_2,"trace" => 1,'use' => SOAP_LITERAL, ));
$header = $this->getWsseSoapHeaders(); // some headers with login/pass
$client->__setSoapHeaders($header);
.....
 $string = 'some xml body';
.....
 $params[]= new \SoapVar($string, XSD_ANYXML);
       $params[] = new \SoapVar('',XSD_ANYXML, '123', null, 'Envelope', 'http://www.w3.org/2001/XMLSchema');
       $params[] = new \SoapVar('',XSD_ANYXML, '', null, 'Envelope', 'http://www.w3.org/2001/XMLSchema-instance');

        try {
            $data = $client->SomeFucntion(new \SoapVar($params, XSD_ANYXML));
 } catch (\SoapFault $exception) {
}

0 Answers