Loading ...
Sorry, an error occurred while loading the content.

Multiple "Accept" tags in the HTTP Request Header

Expand Messages
  • satheesh.uppalapati
    Hello All, We have a requirement to integrate our vendor provided B2B platform with a trading partner who uses SOAP Perl Lite client as the web service client.
    Message 1 of 2 , Sep 11, 2009
    • 0 Attachment
      Hello All,

      We have a requirement to integrate our vendor provided B2B platform with a trading partner who uses SOAP Perl Lite client as the web service client. But we ran into some sort of problem here. The HTTP request headers generated by the Perl client has multiple "Accept" tags repeated as shown below and they are being rejected by our B2B server as invalid HTTP headers.

      Please help me with answers to the following questions.

      1. Are multiple/repeated "Accept" tags allowed in the HTTP request headers?
      2. Is there a way to send a single "Accept" tag with values concatenated instead of sending multiple occurances?

      ====================
      connection: TE, close;
      accept: text/xml;
      accept: multipart/*;
      accept: application/soap;
      host: test.b2bgateway.com:21250;
      user-agent: SOAP::Lite/Perl/0.710.08;
      content-length: 1052;
      content-type: text/xml; charset=utf-8;
      soapaction: http://tempuri.org/2.0/Verify;
      ===================


      TIA
      Satheesh
    • Martin Busik
      Hi, ... Yes. See http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z3 Cheers, Martin ... Yes. use SOAP::Lite (+trace = [ transport = &rewrite_headers ]);
      Message 2 of 2 , Sep 12, 2009
      • 0 Attachment
        Hi,

        > Please help me with answers to the following questions.
        >
        > 1. Are multiple/repeated "Accept" tags allowed in the HTTP
        > request headers?

        Yes. See http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z3

        Cheers,
        Martin


        > 2. Is there a way to send a single "Accept" tag with values
        > concatenated instead of sending multiple occurances?

        Yes.

        use SOAP::Lite (+trace => [ "transport" => \&rewrite_headers ]);

        ...

        sub rewrite_headers {
        my $r = shift;
        if(UNIVERSAL::isa($r,"HTTP::Request")) {
        $r->header(Accept => "text/html; multipart/*; application/soap");
        }
        }

        Cheers,
        Martin
      Your message has been successfully submitted and would be delivered to recipients shortly.