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

List:       wss4j-dev
Subject:    Configuring a client security handler per service
From:       "Beelen, M. - SPLXE" <Martijn.Beelen () KLM ! COM>
Date:       2007-05-30 10:21:01
Message-ID: B89D66CCE1FFEC4CA62A7644109D35F0033C4133 () KL1010WF ! cs ! ad ! klmcorp ! net
[Download RAW message or body]

Hi,

 

We are using Axis 1.2.1 and Spring 2.0.3 to invoke a remote webservice
using a password callback defined in a client-deploy.wsdd file as
follows:

 

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

      <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender" />

      <globalConfiguration>

            <requestFlow>

                  <handler
type="java:org.apache.ws.axis.security.WSDoAllSender">

                        <parameter name="action" value="UsernameToken"
/>

                        <parameter name="user" value="USERNAME" />

                        <parameter name="passwordCallbackClass"
value="package.PasswordCallback" />

                        <parameter name="passwordType"
value="PasswordText" />

                        <parameter name="mustUnderstand" value="false"
/>

                  </handler>

            </requestFlow>

      </globalConfiguration>

</deployment>

 

This sends our username and password with all webservices invoked
through the Axis (client). However, we would like to configure which
username and password have to be used for each service individually.

 

In our Spring configuration we define a webservice (client) as follows,
extending a JaxRpcPortProxyFactoryBean by
package.MyServiceJaxRpcPortProxy:

 

  <bean id="MyServiceBean" class="package.MyServiceJaxRpcPortProxy">

    <property name="serviceFactoryClass"
value="org.apache.axis.client.ServiceFactory" />

    <property name="wsdlDocumentUrl" value="http://host/MyService.wsdl"
/>

    <property name="namespaceUri" value="http://host/myservice" />

    <property name="serviceName" value="MyService" />

    <property name="portName" value="MySOAPPort" />

    <property name="serviceInterface" value="package.MyService" />

  </bean>

 

Do you know if and how it would be possible to configure for a specific
webservice which username should be used (for instance by changing the
wsdd) ?



Thanks in advance, best regards,

 

 

Martijn



**********************************************************************
For information, services and offers, please visit our web site:
http://www.klm.com. This e-mail and any attachment may contain
confidential and privileged material intended for the addressee
only. If you are not the addressee, you are notified that no part
of the e-mail or any attachment may be disclosed, copied or
distributed, and that any other action related to this e-mail or
attachment is strictly prohibited, and may be unlawful. If you have
received this e-mail by error, please notify the sender immediately
by return e-mail, and delete this message. Koninklijke Luchtvaart
Maatschappij NV (KLM), its subsidiaries and/or its employees shall
not be liable for the incorrect or incomplete transmission of this
e-mail or any attachments, nor responsible for any delay in
receipt.
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal
Dutch Airlines) is registered in Amstelveen, The Netherlands, with
registered number 33014286 
**********************************************************************
[Attachment #3 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:Arial;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:595.35pt 842.0pt;
	margin:1.0in 89.85pt 1.0in 89.85pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt'>We
are using Axis 1.2.1 and Spring 2.0.3 to invoke a remote webservice using a
password callback defined in a client-deploy.wsdd file as \
follows:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";background:white'>&lt;deployment
xmlns=&quot;http://xml.apache.org/axis/wsdd/&quot;
xmlns:java=&quot;http://xml.apache.org/axis/wsdd/providers/java&quot;&gt;</span></font><font
 size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font><font size=2 \
face="Courier New"><span lang=FR style='font-size:10.0pt;font-family: "Courier \
New";background:white'>&lt;transport name=&quot;http&quot; \
pivot=&quot;java:org.apache.axis.transport.http.HTTPSender&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span lang=FR \
style='font-size:10.0pt;font-family: "Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=FR style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;globalConfiguration&gt;</span></font><font size=2 face="Courier New"><span \
lang=FR style='font-size:10.0pt;font-family: "Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
lang=FR style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"; \
background:white'>&lt;requestFlow&gt;</span></font><font size=2 face="Courier \
New"><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;handler type=&quot;java:org.apache.ws.axis.security.WSDoAllSender&quot;&gt;</span></font><font
 size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;parameter name=&quot;action&quot; value=&quot;UsernameToken&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;parameter name=&quot;user&quot; value=&quot;USERNAME&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;parameter name=&quot;passwordCallbackClass&quot; \
value=&quot;package.PasswordCallback&quot; /&gt;</span></font><font size=2 \
face="Courier New"><span style='font-size:10.0pt; font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;parameter name=&quot;passwordType&quot; value=&quot;PasswordText&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;parameter name=&quot;mustUnderstand&quot; value=&quot;false&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/handler&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/requestFlow&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/globalConfiguration&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";background:white'>&lt;/deployment&gt;</span></font><font
size=2><span style='font-size:10.0pt'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt'>This
sends our username and password with <b><span style='font-weight:bold'>all
webservices</span></b> invoked through the Axis (client). However, we would
like to configure which username and password have to be used <b><span
style='font-weight:bold'>for each service \
individually</span></b>.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt'>In our
Spring configuration we define a webservice (client) as follows, extending a \
JaxRpcPortProxyFactoryBean by \
package.MyServiceJaxRpcPortProxy:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";background:white'>&nbsp;
&lt;bean id=&quot;MyServiceBean&quot; \
class=&quot;package.MyServiceJaxRpcPortProxy&quot;&gt;</span></font><font size=2 \
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp; &lt;property \
name=&quot;serviceFactoryClass&quot; \
value=&quot;org.apache.axis.client.ServiceFactory&quot; /&gt;</span></font><font \
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp; &lt;property \
name=&quot;wsdlDocumentUrl&quot; value=&quot;http://host/MyService.wsdl&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt; \
font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;namespaceUri&quot; \
value=&quot;http://host/myservice&quot; /&gt;</span></font><font size=2 face="Courier \
New"><span style='font-size:10.0pt; font-family:"Courier \
New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;serviceName&quot; \
value=&quot;MyService&quot; /&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp; &lt;property name=&quot;portName&quot; \
value=&quot;MySOAPPort&quot; /&gt;</span></font><font size=2 face="Courier New"><span \
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier \
New";background:white'>&nbsp;&nbsp;&nbsp; &lt;property \
name=&quot;serviceInterface&quot; value=&quot;package.MyService&quot; \
/&gt;</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt; \
font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";background:white'>&nbsp;
&lt;/bean&gt;</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt'>Do
you know if and how it would be possible to configure for a specific webservice
which username should be used (for instance by changing the wsdd) ?<br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt'>Thanks
in advance, best regards,</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:11.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span \
style='font-size:11.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=NL \
style='font-size:10.0pt'>Martijn</span></font><span lang=NL><o:p></o:p></span></p>

</div>

</body>

</html>

<HTML><BODY><P><hr size=1></P>
<P><STRONG>

</STRONG></P></BODY></HTML>



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

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