<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
how to set headers in JAX-WS
</h3>
<span style="margin-bottom: 10px;">
reply from <a href="http://community.jboss.org/people/Oberiko">Neil McFarlane</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/533086#533086">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Sorry to drag up an old message like this, but I don't see a newer one on the same topic.</p><p>Are the three solutions presented still the only way of handling  authenication via headers within the operation.  For example, a WSDL I'm trying to build a client for has the following:</p><p>{code:xml}<?xml version="1.0" encoding="utf-8"?><br/><wsdl:definitions xmlns:soap="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/soap/">http://schemas.xmlsoap.org/wsdl/soap/</a>" xmlns:tm="<a class="jive-link-external-small" href="http://microsoft.com/wsdl/mime/textMatching/">http://microsoft.com/wsdl/mime/textMatching/</a>" xmlns:soapenc="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a>" xmlns:mime="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/mime/">http://schemas.xmlsoap.org/wsdl/mime/</a>" xmlns:tns="<a class="jive-link-external-small" href="http://ws.myWebService.net">http://ws.myWebService.net</a>" xmlns:s="<a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>" xmlns:soap12="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/soap12/">http://schemas.xmlsoap.org/wsdl/soap12/</a>" xmlns:http="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/http/">http://schemas.xmlsoap.org/wsdl/http/</a>" targetNamespace="<a class="jive-link-external-small" href="http://ws.myWebService.net">http://ws.myWebService.net</a>" xmlns:wsdl="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/">http://schemas.xmlsoap.org/wsdl/</a>"><br/>  <wsdl:types><br/>    <s:schema elementFormDefault="qualified" targetNamespace="<a class="jive-link-external-small" href="http://ws.myWebService.net">http://ws.myWebService.net</a>"><br/>      <s:element name="myOperation"><br/>        <s:complexType><br/>          <s:sequence><br/>            <s:element minOccurs="1" maxOccurs="1" name="isSecureMode" type="s:boolean" /><br/>          </s:sequence><br/>        </s:complexType><br/>      </s:element><br/>      <s:element name="myOperationResponse"><br/>        <s:complexType><br/>          <s:sequence><br/>            <s:element minOccurs="0" maxOccurs="1" name="myOperationResult" type="s:string" /><br/>          </s:sequence><br/>        </s:complexType><br/>      </s:element><br/>      <s:element name="AuthenticationXML" type="tns:AuthenticationXML" /><br/>      <s:complexType name="AuthenticationXML"><br/>        <s:sequence><br/>          <s:element minOccurs="0" maxOccurs="1" name="User" type="s:string" /><br/>          <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" /><br/>        </s:sequence><br/>        <s:anyAttribute /><br/>      </s:complexType><br/>    </s:schema><br/>  </wsdl:types><br/>  <wsdl:message name="myOperationSoapIn"><br/>    <wsdl:part name="parameters" element="tns:myOperation" /><br/>  </wsdl:message><br/>  <wsdl:message name="myOperationSoapOut"><br/>    <wsdl:part name="parameters" element="tns:myOperationResponse" /><br/>  </wsdl:message><br/>  <wsdl:message name="myOperationAuthenticationXML"><br/>    <wsdl:part name="AuthenticationXML" element="tns:AuthenticationXML" /><br/>  </wsdl:message><br/>  <wsdl:message name="SendDataAuthenticationXML"><br/>    <wsdl:part name="AuthenticationXML" element="tns:AuthenticationXML" /><br/>  </wsdl:message><br/> <wsdl:portType name="myPort"><br/>  <wsdl:operation name="myOperation"><br/>   <wsdl:input message="tns:myOperationSoapIn" /><br/>   <wsdl:output message="tns:myOperationSoapOut" /><br/>  </wsdl:operation><br/>  </wsdl:portType><br/>  <wsdl:binding name="myPort12" type="tns:myPort"><br/>    <soap12:binding transport="<a class="jive-link-external-small" href="http://schemas.xmlsoap.org/soap/http">http://schemas.xmlsoap.org/soap/http</a>" /><br/>    <wsdl:operation name="myOperation"><br/>      <soap12:operation soapAction="myWebService:myOperation" style="document" /><br/>      <wsdl:input><br/>        <soap12:body use="literal" /><br/>        <soap12:header message="tns:myOperationAuthenticationXML" part="AuthenticationXML" use="literal" /><br/>      </wsdl:input><br/>      <wsdl:output><br/>        <soap12:body use="literal" /><br/>      </wsdl:output><br/>    </wsdl:operation><br/>  </wsdl:binding><br/>  <wsdl:service name="myWebServiceWS"><br/>    <wsdl:port name="myPort11" binding="tns:myPort11"><br/>      <soap:address location="<a class="jive-link-external-small" href="https://devws.myWebService.myDomain.net/myWebServicews/myWebServicews.asmx">https://devws.myWebService.myDomain.net/myWebServicews/myWebServicews.asmx</a>" /><br/>    </wsdl:port><br/>    <wsdl:port name="myPort12" binding="tns:myPort12"><br/>      <soap12:address location="<a class="jive-link-external-small" href="https://devws.myWebService.myDomain.net/myWebServicews/myWebServicews.asmx">https://devws.myWebService.myDomain.net/myWebServicews/myWebServicews.asmx</a>" /><br/>    </wsdl:port><br/>  </wsdl:service><br/></wsdl:definitions>{code}</p><p>With WsConsume, I don't get the option to add Authentication elements to my methods and setting the binding properties does nothing.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/533086#533086">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>