Below are my client-config.wsdd and crypto.properties file and the java
launch command is:
java -Daxis.ClientConfigFile=properties/client-config.wsdd sample.Test
Notice that this configuration is set up to sign the request using a private
key stored in a local JKS keystore and to send the corresponding public key
in a certificate.
I've already managed to change the Addressing namespace from 2004/08 to
2004/03 by downloading Apache Addressing source code and changing the default
namespace in the Constants class and then compiling it again.
If you use the client-config.wsdd file below, the To and Action headers will
be set automatically. What I can't get rid of is the From element, which a
sample .Net client doesn't use.
Still I can't get my Java client to work. Now .Net fails with an Integrity
error. I'll do a bit more research.
Hope this helps,
Nuno Guerreiro
client-config.wsdd -------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="
http://xml.apache.org/axis/wsdd/" xmlns:java="
http://xml.apache.org/axis/wsdd/providers/java"> <globalConfiguration>
<parameter name="addressing.sendReplyTo" value="true"/>
<parameter name="enableNamespacePrefixOptimization" value="false"/>
<requestFlow>
<handler
type="java:org.apache.axis.message.addressing.handler.AddressingHandler">
<!--
<parameter name="referencePropertyNames" value="*"/>
-->
<parameter name="referencePropertyNames"
value="{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}Action;{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}MessageID;{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}ReplyTo;{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}To"
/>
</handler>
<handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="Timestamp Signature"/>
<parameter name="passwordCallbackClass"
value="pt.bcp.b2b.sample.PWCallback"/>
<parameter name="signaturePropFile" value="crypto.properties" />
<parameter name="signatureKeyIdentifier" value="DirectReference" />
<!--
<parameter name="signatureParts"
value="{Element}{
http://schemas.xmlsoap.org/soap/envelope/}Body;{Element}{
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp"
/>
-->
<parameter name="signatureParts"
value="{Element}{
http://schemas.xmlsoap.org/soap/envelope/}Body;{Element}{
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}MessageID;{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}To;{Element}{
http://schemas.xmlsoap.org/ws/2004/03/addressing}Action"
/>
<parameter name="user" value="wse2qsclient" />
</handler>
</requestFlow>
</globalConfiguration>
<transport name="java"
pivot="java:org.apache.axis.transport.java.JavaSender"/>
<transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
<transport name="local"
pivot="java:org.apache.axis.transport.local.LocalSender"/>
</deployment>
-----------------------------------------------------
crypto.properties -----------------------------------
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=changeit
org.apache.ws.security.crypto.merlin.file=properties/client.keystore
--------------------------------------------------------
[quoted text, click to view] "Eddie" wrote:
> thank you very much for the info. At the very least I now know it can work.
> would you happen to have a snippet as to how the TO and Action is set?
>
> "Nuno Guerreiro" wrote:
>
> > Hi,
> >
> >
> > The To and Action headers are working for me, except with a different
> > namespace.
> >
> > Are you using WSS4J? If not, then download it from the Apache site. Besides
> > the normal distribution, there is a zip file which contains other jars, and
> > one of them is addressing-1.0.jar. You should be using a handler from it. If
> > you need more info, let me know.
> >
> > Regards,
> >
> >
> > Nuno Guerreiro
> >
> >
> > "Eddie" wrote:
> >
> > > I am running a WSE 2.0 Service with an Apache Axis client trying to consume.
> > > The Fault message is that the client is missing the TO and Action SOAP
> > > header. I assume this has something to do with the WS-Addressing. THey are
> > > using Axis 1.2. I've read that Axis2 has more robust support for
> > > WS-Addressing. I really need help. So if anyone has advice or examples,