Changing Http Headers in Axis1.4

I

itsprabhu

Hi all i have generated java files from wsdl using WSDL2Java. I need to
invoke a method in the web service.There is a stub file generated and
iam using them to test. I want to change the request headers .

Generated one

POST / HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.4
Host: localhost:8008
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "urn:Login"
Content-Length: 441

Expected one

POST / HTTP/1.1
Authorization: Basic cHI6cHI=
Content-Length: 441
Content-Type: text/xml; charset=utf-8
User-Agent: Java/1.5.0_09
Host: localhost:8008
SOAPAction: "urn:Login"
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

I have tried setting using call.setProperty() but still not working.
Can anyone help me out in this its very urgent....
Thanks,
Prabhu
 
L

luker

Hi, you can try by setting your own header via the method setHeader on
a specific object, but thats tricky, you know.... be careful!

bye

Luca



(e-mail address removed) ha scritto:
 
I

itsprabhu

Hi luker i've tried that also but still its not changing .

setHeader("http://www.dev.com/loc",org.apache.axis.transport.http.HTTPConstants.HEADER_ACCEPT,"text/html,
image/gif, image/jpeg, *; q=.2, */*; q=.2");

My problem is when i use socket connection program to connect to the
server the req header is goin like as expected and iam gettin proper
response,but when i use the generated stub file and axis stuff my req
headers is different and iam not able to get the proper response rather
iam gettin exception like content is not allowed in the trailing
section. Can u plz help me in this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top