[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsif-user
Subject:    Re: Setting HTTP Headers in WSIF SOAP over HTTP requests
From:       Nirmal Mukhi <nmukhi () us ! ibm ! com>
Date:       2003-06-09 19:29:49
[Download RAW message or body]

This is a multipart message in MIME format.
--=_alternative 006B19B685256D40_=
Content-Type: text/plain; charset="US-ASCII"

Hi Geoff,

While this might work, it breaks the protocol-independence, since the code 
wouldn't work for any WSIFPort other than the Apache Axis port. If you 
have determined that setting information on the WSIFPort's context doesn't 
work, and you believe that it should, could you file a bugzilla for this?

Thanks,
Nirmal.




Geoff Alexander/Raleigh/IBM@IBMUS
06/09/2003 02:29 PM
Please respond to wsif-user
 
        To:     "Simon Solomon" <b08sxs@FDS.com>
        cc:     wsif-user@ws.apache.org
        Subject:        Re: Setting HTTP Headers in WSIF SOAP over HTTP 
requests






Simon,

I was able to figure out how to pass a cookie in a WSIF/SOAP over HTTP
request.  I had to directly access the Axis Call:

   WSIFPort_ApacheAxis port = (WSIFPort_ApacheAxis) service.getPort();
   Call call = port.getCall();
   String cookies =
      (String) call.getProperty(HTTPConstants.HEADER_COOKIE);
   StringBuffer cookiesBuffer;
   if (cookies == null) {
      cookiesBuffer = new StringBuffer();
   } else {
      cookiesBuffer = new StringBuffer(cookies);
   }
   if (cookiesBuffer.length() != 0) {
      cookiesBuffer.append(";");
   }
   cookiesBuffer.append("CCCC=cccc");
   call.setProperty(
      HTTPConstants.HEADER_COOKIE,
      cookiesBuffer.toString());

Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
SDWB Development
IBM Corporation
RTP, NC

----- Forwarded by Geoff Alexander/Raleigh/IBM on 06/09/2003 02:02 PM 
-----
  
                      Geoff Alexander   
                                               To:      "Simon Solomon" 
<b08sxs@FDS.com> 
                      06/07/2003 09:24         cc: wsif-user@ws.apache.org 
 
                      PM                       From:    Geoff 
Alexander/Raleigh/IBM@IBMUS 
                                               Subject: Re: Setting HTTP 
Headers in WSIF SOAP over HTTP requests(Document link: Geoff 
                                               Alexander)     
  
  



Simon,

I'm now able to include HTTP headers in my WSIF requests based on your
sample code.  However, I am unable to send a send a Cookie header.  For
example, the following code sends the cookie3 header, but not the cookie
header:

      WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
      WSIFService service = factory.getService(def);
      WSIFPort port = service.getPort();
      WSIFMessage portContext = port.getContext();
           if (portContext == null ) {
            portContext = new WSIFDefaultMessage();
           }
      Hashtable httpHeaders;
      try {
            httpHeaders = (Hashtable) portContext.getObjectPart(
                  WSIFConstants.CONTEXT_REQUEST_HTTP_HEADERS);
      } catch (WSIFException e) {
            httpHeaders = null;
      }
      if (httpHeaders == null) {
            httpHeaders = new Hashtable(2);
      }
      String cookie = (String) httpHeaders.get("cookie");
      StringBuffer cookieBuffer = new StringBuffer();
      if ((cookie != null) && (!cookie.equals(""))) {
            cookieBuffer.append(cookie);
            cookieBuffer.append(";");
      }
      cookieBuffer.append("AAAA=");
      cookieBuffer.append("xxxxx");
      httpHeaders.put("cookie", cookieBuffer.toString());
      httpHeaders.put("cookie3", cookieBuffer.toString());
      portContext.setObjectPart(
            WSIFConstants.CONTEXT_REQUEST_HTTP_HEADERS,
            httpHeaders);
      port.setContext(portContext);
      WSIFOperation operation = port.createOperation("getUserInfo");
      WSIFMessage input = operation.createInputMessage();
      WSIFMessage output = operation.createOutputMessage();
      WSIFMessage fault = operation.createFaultMessage();
      if (operation
            .executeRequestResponseOperation(input, output, fault)) {
            System.out.println(output.getObjectPart("result"));
      } else {
            // handle failure
      }

Do you know how to include cookies in the WSIF SOAP request?

Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
SDWB Development
IBM Corporation
RTP, NC



  
                      "Simon Solomon"   
                      <b08sxs@FDS.com>         To:       Geoff 
Alexander/Raleigh/IBM@IBMUS 
                                               cc: wsif-user@ws.apache.org 
 
                      05/20/2003 12:00         Subject:  Re: Setting HTTP 
Headers in WSIF SOAP over HTTP requests 
                      PM   
  
  









Geoff,
     the attached code sample sets HTTP header(s) to the WSIF Port (which
will be used to execute a service)

  org.apache.wsif.WSIFPort wsifPort = null;
  //Acquire your port obj...

  //Get the Port Context
  org.apache.wsif.WSIFMessage portCtx = wsifPort.getContext();

  if(null == portCtx)
     portCtx = new org.apache.wsif.base.WSIFDefaultMessage();


  //Build the header
  Hashtable httpHeaders = new Hashtable();
  //Add header info (Header Name/Value pair)
  httpHeaders.put("Some Header1", "Some header1 value");
  httpHeaders.put("Some Header2", "Some header2 value");

  //Set The SOAP HTTP Request Header to the port context
  portCtx.setObjectPart(
          org.apache.wsif.WSIFConstants.CONTEXT_REQUEST_HTTP_HEADERS,
          httpHeaders);
  wsifPort.setContext(portCtx);

  //Use the port Object to execute your service i.e.
  //org.apache.wsif.WSIFOperation wsifOperation = wsifPort
().createOperation("myOpName");



Simon Solomon
ssolomon@fds.com





           Geoff Alexander
           <gdlxn@us.ibm.com>
                                                                        To
           05/20/2003 11:24 AM        ssolomon@fds.com
                                                                        cc

                                                                   Subject
                                      Setting HTTP Headers in WSIF SOAP
                                      over HTTP requests














Simon,

I'm resending this as I didn't include a subject the first time and 
thought
you might delete it thinking it was spam.

In an April 4 posting to the wsif-user mailing list, you state:

      I am successfully setting HTTP headers for SOAP over HTTP requests.

Could you tell me how you do this?

Thanks,
Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
SDWB Development
IBM Corporation
RTP, NC


Geoff Alexander, Ph.D.
919/254-5216 T/L 444-5216
SDWB Development
IBM Corporation
RTP, NC









--=_alternative 006B19B685256D40_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Hi Geoff,</font>
<br>
<br><font size=2 face="sans-serif">While this might work, it breaks the
protocol-independence, since the code wouldn't work for any WSIFPort other
than the Apache Axis port. If you have determined that setting information
on the WSIFPort's context doesn't work, and you believe that it should,
could you file a bugzilla for this?</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Nirmal.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Geoff Alexander/Raleigh/IBM@IBMUS</b></font>
<p><font size=1 face="sans-serif">06/09/2003 02:29 PM</font>
<br><font size=1 face="sans-serif">Please respond to wsif-user</font>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To:
&nbsp; &nbsp; &nbsp; &nbsp;&quot;Simon Solomon&quot; &lt;b08sxs@FDS.com&gt;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc:
&nbsp; &nbsp; &nbsp; &nbsp;wsif-user@ws.apache.org</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject:
&nbsp; &nbsp; &nbsp; &nbsp;Re: Setting HTTP Headers in WSIF SOAP
over HTTP requests</font></table>
<br>
<br>
<br><font size=2><tt><br>
<br>
<br>
<br>
Simon,<br>
<br>
I was able to figure out how to pass a cookie in a WSIF/SOAP over HTTP<br>
request. &nbsp;I had to directly access the Axis Call:<br>
<br>
 &nbsp; WSIFPort_ApacheAxis port = (WSIFPort_ApacheAxis) service.getPort();<br>
 &nbsp; Call call = port.getCall();<br>
 &nbsp; String cookies =<br>
 &nbsp; &nbsp; &nbsp;(String) call.getProperty(HTTPConstants.HEADER_COOKIE);<br>
 &nbsp; StringBuffer cookiesBuffer;<br>
 &nbsp; if (cookies == null) {<br>
 &nbsp; &nbsp; &nbsp;cookiesBuffer = new StringBuffer();<br>
 &nbsp; } else {<br>
 &nbsp; &nbsp; &nbsp;cookiesBuffer = new StringBuffer(cookies);<br>
 &nbsp; }<br>
 &nbsp; if (cookiesBuffer.length() != 0) {<br>
 &nbsp; &nbsp; &nbsp;cookiesBuffer.append(&quot;;&quot;);<br>
 &nbsp; }<br>
 &nbsp; cookiesBuffer.append(&quot;CCCC=cccc&quot;);<br>
 &nbsp; call.setProperty(<br>
 &nbsp; &nbsp; &nbsp;HTTPConstants.HEADER_COOKIE,<br>
 &nbsp; &nbsp; &nbsp;cookiesBuffer.toString());<br>
<br>
Geoff Alexander, Ph.D.<br>
919/254-5216 T/L 444-5216<br>
SDWB Development<br>
IBM Corporation<br>
RTP, NC<br>
<br>
----- Forwarded by Geoff Alexander/Raleigh/IBM on 06/09/2003 02:02 PM -----<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;Geoff Alexander &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp;&quot;Simon Solomon&quot; \
&lt;b08sxs@FDS.com&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;06/07/2003 09:24 &nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; \
&nbsp;wsif-user@ws.apache.org &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;PM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; From: &nbsp; &nbsp;Geoff Alexander/Raleigh/IBM@IBMUS &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; Subject: Re: Setting HTTP Headers in WSIF SOAP over HTTP
requests(Document link: Geoff &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; Alexander) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
<br>
<br>
<br>
Simon,<br>
<br>
I'm now able to include HTTP headers in my WSIF requests based on your<br>
sample code. &nbsp;However, I am unable to send a send a Cookie header.
&nbsp;For<br>
example, the following code sends the cookie3 header, but not the cookie<br>
header:<br>
<br>
 &nbsp; &nbsp; &nbsp;WSIFServiceFactory factory = \
WSIFServiceFactory.newInstance();<br>  &nbsp; &nbsp; &nbsp;WSIFService service = \
factory.getService(def);<br>  &nbsp; &nbsp; &nbsp;WSIFPort port = \
service.getPort();<br>  &nbsp; &nbsp; &nbsp;WSIFMessage portContext = \
port.getContext();<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (portContext == null ) \
{<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;portContext = new \
WSIFDefaultMessage();<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
 &nbsp; &nbsp; &nbsp;Hashtable httpHeaders;<br>
 &nbsp; &nbsp; &nbsp;try {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;httpHeaders = (Hashtable) \
portContext.getObjectPart(<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp;WSIFConstants.CONTEXT_REQUEST_HTTP_HEADERS);<br>  &nbsp; &nbsp; &nbsp;} \
catch (WSIFException e) {<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;httpHeaders = \
null;<br>  &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp;if (httpHeaders == null) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;httpHeaders = new Hashtable(2);<br>
 &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp;String cookie = (String) \
httpHeaders.get(&quot;cookie&quot;);<br>  &nbsp; &nbsp; &nbsp;StringBuffer \
cookieBuffer = new StringBuffer();<br>  &nbsp; &nbsp; &nbsp;if ((cookie != null) \
&amp;&amp; (!cookie.equals(&quot;&quot;))) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cookieBuffer.append(cookie);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cookieBuffer.append(&quot;;&quot;);<br>
 &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp;cookieBuffer.append(&quot;AAAA=&quot;);<br>
 &nbsp; &nbsp; &nbsp;cookieBuffer.append(&quot;xxxxx&quot;);<br>
 &nbsp; &nbsp; &nbsp;httpHeaders.put(&quot;cookie&quot;, \
cookieBuffer.toString());<br>  &nbsp; &nbsp; \
&nbsp;httpHeaders.put(&quot;cookie3&quot;, cookieBuffer.toString());<br>  &nbsp; \
&nbsp; &nbsp;portContext.setObjectPart(<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;WSIFConstants.CONTEXT_REQUEST_HTTP_HEADERS,<br>  &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp;httpHeaders);<br>  &nbsp; &nbsp; &nbsp;port.setContext(portContext);<br>
 &nbsp; &nbsp; &nbsp;WSIFOperation operation = \
port.createOperation(&quot;getUserInfo&quot;);<br>  &nbsp; &nbsp; &nbsp;WSIFMessage \
input = operation.createInputMessage();<br>  &nbsp; &nbsp; &nbsp;WSIFMessage output = \
operation.createOutputMessage();<br>  &nbsp; &nbsp; &nbsp;WSIFMessage fault = \
operation.createFaultMessage();<br>  &nbsp; &nbsp; &nbsp;if (operation<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.executeRequestResponseOperation(input,
output, fault)) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;System.out.println(output.getObjectPart(&quot;result&quot;));<br>  &nbsp; \
&nbsp; &nbsp;} else {<br>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// handle \
failure<br>  &nbsp; &nbsp; &nbsp;}<br>
<br>
Do you know how to include cookies in the WSIF SOAP request?<br>
<br>
Geoff Alexander, Ph.D.<br>
919/254-5216 T/L 444-5216<br>
SDWB Development<br>
IBM Corporation<br>
RTP, NC<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&quot;Simon Solomon&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&lt;b08sxs@FDS.com&gt; &nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp;
&nbsp; Geoff Alexander/Raleigh/IBM@IBMUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; wsif-user@ws.apache.org &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;05/20/2003 12:00 &nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp;Re: Setting
HTTP Headers in WSIF SOAP over HTTP requests &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;PM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Geoff,<br>
 &nbsp; &nbsp; the attached code sample sets HTTP header(s) to the WSIF
Port (which<br>
will be used to execute a service)<br>
<br>
 &nbsp;org.apache.wsif.WSIFPort wsifPort = null;<br>
 &nbsp;//Acquire your port obj...<br>
<br>
 &nbsp;//Get the Port Context<br>
 &nbsp;org.apache.wsif.WSIFMessage portCtx = wsifPort.getContext();<br>
<br>
 &nbsp;if(null == portCtx)<br>
 &nbsp; &nbsp; portCtx = new org.apache.wsif.base.WSIFDefaultMessage();<br>
<br>
<br>
 &nbsp;//Build the header<br>
 &nbsp;Hashtable httpHeaders = new Hashtable();<br>
 &nbsp;//Add header info (Header Name/Value pair)<br>
 &nbsp;httpHeaders.put(&quot;Some Header1&quot;, &quot;Some header1 value&quot;);<br>
 &nbsp;httpHeaders.put(&quot;Some Header2&quot;, &quot;Some header2 value&quot;);<br>
<br>
 &nbsp;//Set The SOAP HTTP Request Header to the port context<br>
 &nbsp;portCtx.setObjectPart(<br>
 &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;org.apache.wsif.WSIFConstants.CONTEXT_REQUEST_HTTP_HEADERS,<br>  &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp;httpHeaders);<br>  &nbsp;wsifPort.setContext(portCtx);<br>
<br>
 &nbsp;//Use the port Object to execute your service i.e.<br>
 &nbsp;//org.apache.wsif.WSIFOperation wsifOperation = wsifPort<br>
().createOperation(&quot;myOpName&quot;);<br>
<br>
<br>
<br>
Simon Solomon<br>
ssolomon@fds.com<br>
<br>
<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Geoff Alexander<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;gdlxn@us.ibm.com&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;To<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 05/20/2003 11:24 AM &nbsp; &nbsp; &nbsp;
&nbsp;ssolomon@fds.com<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;cc<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; Subject<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Setting HTTP
Headers in WSIF SOAP<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;over HTTP
requests<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Simon,<br>
<br>
I'm resending this as I didn't include a subject the first time and thought<br>
you might delete it thinking it was spam.<br>
<br>
In an April 4 posting to the wsif-user mailing list, you state:<br>
<br>
 &nbsp; &nbsp; &nbsp;I am successfully setting HTTP headers for SOAP over
HTTP requests.<br>
<br>
Could you tell me how you do this?<br>
<br>
Thanks,<br>
Geoff Alexander, Ph.D.<br>
919/254-5216 T/L 444-5216<br>
SDWB Development<br>
IBM Corporation<br>
RTP, NC<br>
<br>
<br>
Geoff Alexander, Ph.D.<br>
919/254-5216 T/L 444-5216<br>
SDWB Development<br>
IBM Corporation<br>
RTP, NC<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</tt></font>
<br>
--=_alternative 006B19B685256D40_=--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic