Re: SOAPHeader Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi... Sorry Rob... I was out of city. I back again and problem still goes on

Your code final like this

<?php
$client = new SoapClient('http://test.iodeme.com/iodeme.asmx?WSDL');

$auth = array('agentID'=>'2543',
               'username'=>'pencere',
               'authenticated'=>'true');

$authvar = new SoapVar($auth, SOAP_ENC_OBJECT);
$header =  new SoapHeader("http://iodeme.arenaopen.com/GetBankList";,
                           "AuthenticationInfo", $authvar, true);

$client->__setSoapHeaders(array($header));


$res = $client->GetBankList(array('getAll'=>true));



var_dump($res);
?>

When run this script i see this eroor message 
(http://www.epdata.net/arena/test.php

Fatal error: Uncaught SoapFault exception: [soap:MustUnderstand] SOAP header 
AuthenticationInfo was not understood. in 
c:\Inetpub\wwwroot\arena\test.php:15 Stack trace: #0 [internal function]: 
SoapClient->__call('GetBankList', Array) #1 
c:\Inetpub\wwwroot\arena\test.php(15): SoapClient->GetBankList(Array) #2 
{main} thrown in c:\Inetpub\wwwroot\arena\test.php on line 15

All values is real values


Please help me

I tried other method like this


<?php
//$request = "<xml>...</xml>";
$url = 'http://test.iodeme.com/iodeme.asmx?WSDL';
$host = 'http://iodeme.arenaopen.com/GetBankList';

$request = "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"; 
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"; 
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\";>
  <soap:Header>
    <AuthenticationInfo xmlns=\"http://iodeme.arenaopen.com/\";>
      <agentID>2543</agentID>
      <username>pencere</username>
      <authenticated>true</authenticated>
    </AuthenticationInfo>
  </soap:Header>
  <soap:Body>
    <GetBankList xmlns=\"http://iodeme.arenaopen.com/\";>
      <getAll>true</getAll>
    </GetBankList>
  </soap:Body>
</soap:Envelope>";

$header[] = "POST /iodeme.asmx?WSDL HTTP/1.1";
$header[] = "Host: test.iodeme.com";
$header[] = "Content-Type: text/xml; charset=utf-8";
$header[] = "Content-length: ".strlen($request);
$header[] = "SOAPAction: \"http://iodeme.arenaopen.com/GetBankList\"";;
$header[] = $request;

       $ch = curl_init();
       curl_setopt($ch, CURLOPT_URL,$url);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       curl_setopt($ch, CURLOPT_TIMEOUT, 10);
       curl_setopt($ch, CURLOPT_CUSTOMREQUEST,'POST');
       curl_setopt($ch, CURLOPT_HTTPHEADER, $header);


       $result = curl_exec($ch);
       ECHO $result;


Thanks ROB




"Rob" <rrichards@ctindustries.net> wrote in message 
45DECE2C.6090501@ctindustries.net">news:45DECE2C.6090501@ctindustries.net...
> A. Bahadýr UGE wrote:
>> Hi. thanks again but i received this error message
>>
>>
>> Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing 
>> WSDL: Couldn't load from 'http://test.iodeme.com/iodeme.asmx' in 
>> c:\Inetpub\wwwroot\arena\index.php:2 Stack trace: #0 
>> c:\Inetpub\wwwroot\arena\index.php(2): 
>> SoapClient->__construct('http://test.iod...') #1 {main} thrown in 
>> c:\Inetpub\wwwroot\arena\index.php on line 2
>
> Looks like you might be having some network issues accessing the remote 
> WSDL. See if you can open the WSDL in a browser or some other tool and 
> then save it locally. You can then try passing the local copy to the 
> SoapClient constructor.
>
> Rob 

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux