Changing Http Headers in Axis1.4

Discussion in 'Java' started by itsprabhu@gmail.com, Dec 12, 2006.

  1. Guest

    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
     
    , Dec 12, 2006
    #1
    1. Advertising

  2. luker Guest

    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



    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
    > 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, Dec 12, 2006
    #2
    1. Advertising

  3. Guest

    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

    luker wrote:
    > 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
    >
    >
    >
    > 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
    > > 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
     
    , Dec 13, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    319
    =?UTF-8?B?QXJuZSBWYWpow7hq?=
    Mar 21, 2007
  2. andrewzzz
    Replies:
    0
    Views:
    381
    andrewzzz
    Dec 12, 2008
  3. Jan Thomä

    Axis1 vs. Axis2

    Jan Thomä, Dec 18, 2008, in forum: Java
    Replies:
    0
    Views:
    2,065
    Jan Thomä
    Dec 18, 2008
  4. Ian
    Replies:
    2
    Views:
    1,985
  5. perkal

    axis1.1/.net1.1 interoperability

    perkal, Jan 16, 2006, in forum: ASP .Net Web Services
    Replies:
    6
    Views:
    203
    perkal
    Jan 24, 2006
Loading...

Share This Page