Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

Changing Http Headers in Axis1.4

Thread view: 
itsprabhu@gmail.com - 12 Dec 2006 06:25 GMT
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
luker - 12 Dec 2006 13:44 GMT
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

itsprabhu@gmail.com ha scritto:

> 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
[quoted text clipped - 29 lines]
> Thanks,
> Prabhu
itsprabhu@gmail.com - 13 Dec 2006 09:18 GMT
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_ACCE
PT,"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

> Hi, you can try by setting your own header via the method setHeader on
> a specific object, but thats tricky, you know.... be careful!
[quoted text clipped - 38 lines]
> > Thanks,
> > Prabhu


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.