471,601 Members | 1,203 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,601 software developers and data experts.

Adding own HTTP header fields along with a SOAP request in PHP


I am new to PHP scripting and i am trying to connect to a soap server
(as mentioned below) using the SOAP extension comesup with PHP. Now my
requirement is to add my HTTP header fields along with my SOAP request,
so that the SOAP server will receive it and does some high level
processing. Is it possible to add our own HTTP header fields in PHP?
If i use the header() function to add the field into the HTTP header
and it neither reports an error nor adds it to the headers list.

Can anybody suggest me a solution for the problem I face?


header("X-Test: foo");
setcookie('foo', 'bar');
/* Define a custom response header */
header("X-Sample-Test: foo");

$client = new SoapClient(NULL,
"location" => "",
"uri" => "urn:calc",
"style" => SOAP_RPC,
"use" => SOAP_ENCODED,
"trace" => 1
echo ($client->__call(
new SoapParam(
10,"a"),new SoapParam(22,"b")
"uri" => "urn:calc",
"soapaction" => "add"
)). "\n");
//echo $client->requestheaders();

Request received at Soap server:
Connection: Keep-Alive
User-Agent: PHP SOAP 0.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:calc"
Content-Length: 490
Cookie: Auth=Valid USER;

<?xml version="1.0" encoding="UTF-8"?>
xmlns:ns1="urn:calc" xmlns:xsd="http://www.w3.org/2001/XMLSchema"

Sep 21 '05 #1
0 3246

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Daniel Albisser | last post: by
4 posts views Thread by Mark | last post: by
7 posts views Thread by Mullin Yu | last post: by
reply views Thread by IT Drone | last post: by
reply views Thread by | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.