473,372 Members | 1,228 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 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 3659

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Daniel Albisser | last post by:
Hi @ll, We need further information about the sender of the soap-request in the http header that is used for the loadbalancing. In our case we need the mobile-number of the user that is unique....
by: Mark | last post by:
i have a very simple web servive Imports System.Web.Services <System.Web.Services.WebService(Namespace:="urn:Example1")> _ Public Class Example1 Inherits System.Web.Services.WebService
by: Mullin Yu | last post by:
I want to submit a utf-8 xml request to a servlet by the following coding. it seesm that the servlet can't recognize it correctly. can i just using string postData = "..... utf-8 data" and then...
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication...
by: IT Drone | last post by:
I suspect what I want to do is simple, but after hours of googling I can't come up with an answer. I'm consuming a Java-based web service from an ASP.NET app. I want a request that includes 3...
by: | last post by:
i just read through Axis user doc, but all sample app it mention doesn't show how to use the <HEADER> tag inside soap request / response. 1 -- is <HEADER> tag not much a use when doing 1 - 1 host...
by: Sanjaya | last post by:
Hi, I need to add application specific headers and reference parameter in the "ReplyTo" to my web service request as header elements. What is right way to do this? I'm using framework 1.1 with...
by: Nithi Gurusamy | last post by:
I have generated a Web-Service-Proxy (Add Web Reference) within VS. This proxy class is based on WebServicesClientProtocol of WSE 3.0. I want to add some custom HTTP Headers to the envelop before...
by: moorcroft | last post by:
OK I have java code which creates the following XML SOAP message: <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.