Doğru php sabun başlık Setenv

0 Cevap php

Tamam benim wsdl sunucu bir çağrı olarak bekliyor:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:esc="http://escoles.webservice.jovtitus.dasc.gencat.net" xmlns:impl="http://impl.escoles.webservice.jovtitus.dasc.gencat.net">
    <soapenv:Header/>
    <soapenv:Body>
       <esc:login>
          <esc:in0>
             <!--Optional:-->
             <impl:password>++</impl:password>
             <!--Optional:-->
             <impl:user>++</impl:user>
          </esc:in0>
       </esc:login>
    </soapenv:Body>
 </soapenv:Envelope>

ama benim php sabun çağrı bu eşittir:

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://escoles.webservice.jovtitus.dasc.gencat.net">
<SOAP-ENV:Body>
<ns1:login>
<ns1:in0>
<password>+++</password>
<user>+++</user>
</ns1:in0>
</ns1:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> 

Practically is the same, but I found that there are some namespaces that my php is not applying. Why? I have ns1: where it must be esc: and nothing where it must be impl:

Herkes bana yardımcı olabilir?

Ben kullanıyorum teh php kodu dahil ediyorum:

$login = "+++++++";
$password = "+++++++++";

$enllaç = "http://preproduccio.www14.gencat.cat/jov_titus/AppJava/services/EscolesWebService";
$impl   = 'http://impl.escoles.webservice.jovtitus.dasc.gencat.net';
$esc    = 'escoles.webservice.jovtitus.dasc.gencat.net';

$aOptions = array( "uri"=> $esc, 'location' => $enllaç,'trace'=>1 );

class loginRequest {
    private $password;
    private $user;

    public function __construct($password, $user)
    {
        $this->password     =   $password;
        $this->user         =   $user;
    }
}

$x = new loginRequest($password, $login);
$param = array('in0' => $x);


try {
    $client = new SoapClient($enllaç.'?wsdl', $aOptions);
    $clau = new SoapVar($param, SOAP_ENC_OBJECT, null, 'http://impl.escoles.webservice.jovtitus.dasc.gencat.net'); 
    $result = $client->login($clau);
    echo "REQUEST:\n" .htmlentities($client->__getLastRequest()). "<br /><br />";
} catch (SoapFault $fault) {
    trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}

0 Cevap