Foros del Web » Programando para Internet » PHP »

__soapCall bad headers ¿?

Estas en el tema de __soapCall bad headers ¿? en el foro de PHP en Foros del Web. loading........... bueno que cren que esté mal en mis headers? :S gracias. Código PHP: <?php // FIRST I NEED TO LOG IN $client  = new  soapclient ( "https://login.twinfield.com/webservices/session.asmx?WSDL" );  // BELOW THE REAL USERNAME, PASSWORD AND ORGANISATION ARE USED $params  = array( ...
  #1 (permalink)  
Antiguo 14/05/2009, 19:12
Avatar de MaBoRaK  
Fecha de Ingreso: abril-2003
Ubicación: La Paz - Bolivia
Mensajes: 2.003
Antigüedad: 21 años
Puntos: 35
__soapCall bad headers ¿?

loading...........


bueno que cren que esté mal en mis headers? :S gracias.
Código PHP:
<?php

// FIRST I NEED TO LOG IN

$client = new soapclient("https://login.twinfield.com/webservices/session.asmx?WSDL"); 

// BELOW THE REAL USERNAME, PASSWORD AND ORGANISATION ARE USED

$params = array('user' => 'USERNAME''password' => 'PASSWORD''organisation' => 'ORGANISATION');

$response $client->__soapCall("Logon", array($params), null$mySoapHeader, &$mySoapHeader); 

print_r($response);

// THIS RETURNS

/*

stdClass Object
(
    [LogonResult] => Ok
    [nextAction] => None
    [cluster] => https://c1.twinfield.com
)


*/

$SessionID $mySoapHeader['Header']->SessionID;

echo(
"<hr>");

// THIS RETURNS

/*

Array
(
    [Header] => stdClass Object
        (
            [SessionID] => 25c7d3e3-13c4-49c9-aba0-e240371a07f9
        )

*/

echo("<hr>");

$xml_to_send '<transactions> 
  <transaction destiny="temporary"> 
    <header> 
      <office>100</office> 
      <code>SLS</code> 
      <currency>EUR</currency> 
      <period>2006/6</period> 
      <date>20060615</date> 
      <invoicenumber>112</invoicenumber> 
    </header> 
    <lines> 
      <line id="1" type="total"> 
        <dim1>1300</dim1> 
        <dim2>1000</dim2> 
        <value>119.00</value> 
        <debitcredit>debit</debitcredit> 
      </line> 
      <line id="2" type="detail"> 
        <dim1>8020</dim1> 
        <value>100.00</value> 
        <vatcode>SH</vatcode> 
        <debitcredit>credit</debitcredit> 
        <description>...</description> 
      </line> 
      <line type="vat" id="3"> 
        <dim1>1530</dim1> 
        <value>19.00</value> 
        <vatcode>VH</vatcode> 
        <debitcredit>credit</debitcredit> 
      </line> 
    </lines> 
  </transaction> 
</transactions>'
;

$finmut = new soapclient("https://c1.twinfield.com/webservices/processxml.asmx?wsdl"); 

$body = array('xmlRequest' => $xml_to_send);
$header = array('Header' => array('SessionID' => $SessionID));

$response $finmut->__soapCall("ProcessXmlString", array($body), null$header); 

print_r($finmut);

print_r($response);

// Muestra

// Fatal error: SoapClient::__soapCall() [<a href='soapclient.--soapcall'>soapclient.--soapcall</a>]: Invalid SOAP header in /Users/chris/Sites/4thport-booking.com/twinfield/send.php on line 58

?>
connection closed.
__________________

Maborak Technologies
  #2 (permalink)  
Antiguo 14/05/2009, 21:35
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: __soapCall bad headers ¿?

Haz comprobado que $SessionID sea un string? Porque viendo la información de tu var_dump puede que sea un objeto o un nodo y por eso te marca el error.

Saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:35.