ID:               49853
 User updated by:  rumana024 at yahoo dot com
 Reported By:      rumana024 at yahoo dot com
 Status:           Open
 Bug Type:         SOAP related
 Operating System: Windows XP
 PHP Version:      5.2SVN-2009-10-12 (SVN)
 New Comment:

I have solved my issue... Yahoooooooooo...
I switched to php5.3. And I now the http headers are passing through.


Previous Comments:
------------------------------------------------------------------------

[2009-10-14 23:31:01] rumana024 at yahoo dot com

I see a conversation at
http://aspn.activestate.com/ASPN/Mail/Message/php-dev/3710449 about
Transfer-Encoding: chunked and its affect on stream_context parameters.
Is this the problem?

------------------------------------------------------------------------

[2009-10-14 19:37:32] rumana024 at yahoo dot com

Is this a PHP bug? If not,can you please post some sample !working!
code on creating a SOAP Client with the stream_context option and http
header(in this case https). Those headers can be seen as the part of the
http request headers. I have pretty much tried different suggestions
that I read on diffrent threads on www and php.net to make a successful
soap call.    

Regards
RI

------------------------------------------------------------------------

[2009-10-13 18:03:07] rumana024 at yahoo dot com

$headers = array('X-USERID: user_1253314668.com\r\n', 
                'Content-type: application/x-www-form-urlencoded\r\n',
                'X-PASSWORD: 1253314679\r\n',
                'X-SIGNATURE:
AtQaNHC.hbpghF5uGCRO99PVYV7ki3.SAb3vQzBlBAxEyi0b\r\n',
                'X-VERSION: 1.2.0\r\n',
                'X-PROTOCOL: SOAP11\r\n',
                'X-SOURCE: PHP_SOAP_SAMPLE_V1\r\n');    

$context = stream_context_create(array('http' => array('header' =>
$headers)));

$soapClient = new SoapClient(null,array('location' =>
"https://svcs.sandbox.com/Method1/";, 
                                        'uri' =>
"http://x.x.com/types/test";, 
                                        'soap_version' =>
SOAP_1_1,'trace' => 1, 'stream_context' => $context)); 



//Constructing the Payload
$param = "the payload"
$result = $soapClient->Method1($params);


I have changed the wrapper from https to http. Also made the header an
array. Still the same error. I do not see the http header with other
http headers when print the $soapClient->_getLastRequestHeaders().
Please advice how to resolve the issue.

------------------------------------------------------------------------

[2009-10-13 10:48:05] sjo...@php.net

Thank you for your bug report.

Please try 'http' as wrapper name instead of 'https'.

------------------------------------------------------------------------

[2009-10-12 23:18:28] rumana024 at yahoo dot com

Description:
------------
Hi:


I am using PHP Soap PHP-SOAP/5.2.9-2 to connect to a web service. Part
of the reqiurment is that , few http headers need to be as part of the
request, but not part of the soap envelope. I am using the stream
context option and add the http headers with that option. Unfortunately,
the stream context is not being read at all. 




Reproduce code:
---------------
Here is my code 


$opts = array(
  'https'=>array(
    'method'=>"GET",
    'header'=>'X-SECURITY-USERID: seller_1253314668_biz_api1.x.com\r\n'
. 
              'X-SECURITY-PASSWORD: 1253314679\r\n' .
              'X-SECURITY-SIGNATURE:
AtQaNHC.hbpghF5uGCRO99PVY6a2ASO58V7ki3.SAb3vQzBlBAxEyi0b\r\n' .
              'X-SERVICE-VERSION: 1.2.0\r\n' .
              'X-MESSAGE-PROTOCOL: SOAP11\r\n' .
              'X-REQUEST-SOURCE: PLATFORM_JAVA_SOAP_SAMPLE_V1\r\n' .
              'X-APPLICATION-ID: APP-80W284485P519543T\r\n'));


$context = stream_context_create($opts);


$soapClient = new SoapClient(null,array('location' =>
"https://svcs.sandbox.x.com/AP/Method1/";,
                                        'uri' =>
"http://svcs.x.com/types/ap";, 
                                        'soap_version' => SOAP_1_1,
'trace' => 1, 'stream_context' => $context));



 

Expected result:
----------------
Security Credential are going as HTTP Headers and the Http headers are
contained in the context parameter. I get the result Invalid User name
and Password. So the context is not going through at all.
I know for sure the credentials are valid.

I know other option parameter like 'location', 'uri' are working.Please
advice how to fix this problem.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49853&edit=1

Reply via email to