473,569 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Axis / WSS4J / Interop

Hello,

Anyone succeed to make work a .Net WebService client WSE
with WSS4J (I always get the error message 'Signature Verification
failed') ?

On the server my WSDD config is:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="htt p://xml.apache.org/axis/wsdd/providers/java">
<globalConfigur ation>
<parameter name="enableNam espacePrefixOpt imization" value="false" />
<parameter name="disablePr ettyXML" value="true"/>
<requestFlow>
<handler type="java:org. apache.ws.axis. security.WSDoAl lReceiver">
<parameter name="passwordC allbackClass"
value="com.hp.o v.temip.ws.hand ler.PWCallback"/>
<parameter name="action" value="Username TokenSignature UsernameToken Encrypt
Timestamp"/>
<parameter name="decryptio nPropFile" value="security .properties" />
</handler>
</requestFlow>
</globalConfigura tion>
</deployment>

On client's side, I developped with WSE 3.0 Policy framework
The following SecureMessage overriden function:

public override void SecureMessage(S oapEnvelope envelope, Security security)
{
//Must Understand Headers
security.MustUn derstand = true;
security.Timest amp.TtlInSecond s = 60;

//User Name Token
UsernameToken userToken = new UsernameToken(m _strUsername, m_strPassword,
PasswordOption. SendPlainText);
security.Tokens .Add(userToken) ;

X509SecurityTok en token = null;
try
{
token = GetSecurityToke n("CN=10.67.212 .35");
}
catch (Exception ex)
{
throw new Exception("Cert ificate not found : " + ex.Message);
}

//Define a custom X509 token
ISecurityTokenM anager stm =
SecurityTokenMa nager.GetSecuri tyTokenManagerB yTokenType(WSTr ust.TokenTypes. X509v3);
X509SecurityTok enManager x509tm = stm as X509SecurityTok enManager;
x509tm.DefaultK eyAlgorithm = "RSA15";
x509tm.DefaultS essionKeyAlgori thm = "TripleDES" ;

//security.Elemen ts.Add(new EncryptedData(t oken)); //De-comment this line
will encrypt the Body
// Add the token to the SOAP header.
security.Tokens .Add(token); //Insert the token being used into header

//Add Message Signature
MessageSignatur e sig = new MessageSignatur e(userToken);
sig.SignatureOp tions = SignatureOption s.IncludeSoapBo dy;
security.Elemen ts.Add(sig);

//Insert the encrypted UsernameToken
security.Elemen ts.Add(new EncryptedData(t oken, "#" + userToken.Id));
}

Into TOMCAT logs, I can notice that WSS4J is able to:
- retrieve my certificate with its public key
- Decrypt the UserNameToken
But the signature verification fails, some say that it could be due
to a pretty-print component that alters the SOAP message after
the signature, if so, how to deactivate such pretty-printer ?

_______________ ___
Benjamin BALET
http://bbalet.free.fr/

Feb 24 '06 #1
1 6598
Hi,
It's probably a server side problem. You need to change these lines in your
wsdd.

<parameter name="action" value="Username TokenSignature UsernameToken Encrypt
Timestamp"/>
<parameter name="decryptio nPropFile" value="security .properties" />
I think the first one should just be
<parameter name="action" value="Signatur e UsernameToken Encrypt
Timestamp"/>

and the second should define the signaturePropFi le not decryptionPropF ile.
If you're doing signature and encryption with just one file you must define
it as the signature properties file, and the WSS4J handler uses this for both.
<parameter name="signature PropFile" value="security .properties" />

Hope this helps.

Richard.

"bbalet.free.fr " wrote:
Hello,

Anyone succeed to make work a .Net WebService client WSE
with WSS4J (I always get the error message 'Signature Verification
failed') ?

On the server my WSDD config is:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="htt p://xml.apache.org/axis/wsdd/providers/java">
<globalConfigur ation>
<parameter name="enableNam espacePrefixOpt imization" value="false" />
<parameter name="disablePr ettyXML" value="true"/>
<requestFlow>
<handler type="java:org. apache.ws.axis. security.WSDoAl lReceiver">
<parameter name="passwordC allbackClass"
value="com.hp.o v.temip.ws.hand ler.PWCallback"/>
<parameter name="action" value="Username TokenSignature UsernameToken Encrypt
Timestamp"/>
<parameter name="decryptio nPropFile" value="security .properties" />
</handler>
</requestFlow>
</globalConfigura tion>
</deployment>

On client's side, I developped with WSE 3.0 Policy framework
The following SecureMessage overriden function:

public override void SecureMessage(S oapEnvelope envelope, Security security)
{
//Must Understand Headers
security.MustUn derstand = true;
security.Timest amp.TtlInSecond s = 60;

//User Name Token
UsernameToken userToken = new UsernameToken(m _strUsername, m_strPassword,
PasswordOption. SendPlainText);
security.Tokens .Add(userToken) ;

X509SecurityTok en token = null;
try
{
token = GetSecurityToke n("CN=10.67.212 .35");
}
catch (Exception ex)
{
throw new Exception("Cert ificate not found : " + ex.Message);
}

//Define a custom X509 token
ISecurityTokenM anager stm =
SecurityTokenMa nager.GetSecuri tyTokenManagerB yTokenType(WSTr ust.TokenTypes. X509v3);
X509SecurityTok enManager x509tm = stm as X509SecurityTok enManager;
x509tm.DefaultK eyAlgorithm = "RSA15";
x509tm.DefaultS essionKeyAlgori thm = "TripleDES" ;

//security.Elemen ts.Add(new EncryptedData(t oken)); //De-comment this line
will encrypt the Body
// Add the token to the SOAP header.
security.Tokens .Add(token); //Insert the token being used into header

//Add Message Signature
MessageSignatur e sig = new MessageSignatur e(userToken);
sig.SignatureOp tions = SignatureOption s.IncludeSoapBo dy;
security.Elemen ts.Add(sig);

//Insert the encrypted UsernameToken
security.Elemen ts.Add(new EncryptedData(t oken, "#" + userToken.Id));
}

Into TOMCAT logs, I can notice that WSS4J is able to:
- retrieve my certificate with its public key
- Decrypt the UserNameToken
But the signature verification fails, some say that it could be due
to a pretty-print component that alters the SOAP message after
the signature, if so, how to deactivate such pretty-printer ?

_______________ ___
Benjamin BALET
http://bbalet.free.fr/

Feb 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2690
by: Jacky Zhu | last post by:
Hi all, I am having a problem trying to consume a webservice that is developed on ..Net. I can access it without any problem using a .net client, but when I use a java client (based on Axis 1.1), some methods work, some don't. The error message I got is "org.apache.axis.types.URI$MalformedURIException: No scheme found in URI..."
3
9782
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the response. As a result of seraching news groups I guessed that the SOAP response defines an array element in a way that causes the dotnet...
3
2507
by: Lilly | last post by:
I was testing a very simple web services written in Axis (1.2RC2) with just a single method, returning a string "test". The method doesn't need any parameters. when I tested it using .Net client, it returns null. Could anyone please tell me what could ne wrong? I've beening fighting this problem for days now, but still no luck.. Could...
7
8886
by: Jamie Phillips | last post by:
I'm sure this topic has been "around the block" a few times, but I have not been able to find ANY solutin that fits this particular problem. I have written a Java Axis web service that has a method which returns an object with the following characteristics: public class MMPerson { public string firstName; public string surname; public int...
4
12297
by: Lucvdv | last post by:
I have to connect to a server set up by the government, where they used Apache Axis to create a webservice. The code I use to interface to the webservice is generated by wsdl.exe, based on a .wsdl file they sent me. Now a problem turns up with a date field they implemented as xsd:dateTime, even though it only contains a date.
0
1481
by: bbalet.free.fr | last post by:
Hello, Anyone succeed to make work a .Net WebService client WSE with WSS4J (I always get the error message 'Signature Verification failed') ? On the server my WSDD config is: <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <globalConfiguration>
5
4146
by: vthakur | last post by:
Hello: I have a Axis Web Service that sets the sessionid in the SOAP header for persisting the session. The client is a .Net client that processes the header as an Unknown Header. It sets the session id received from the Service request on subsequent requests to the service. However the Axis Web service does not process the SOAP header...
0
2218
by: cjharrelson | last post by:
I am trying to consume a .NET web service using UsernameToken plain text password authentication. Here is my .wsdd configuration file: <!-- Using the WSDoAllSender security handler in request flow --> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <transport name="http"...
2
3747
by: smith.mariya | last post by:
hi, i am mariya. i am working on vb.net. i have created the powerpoint addin. i have inserted the chart on the slide through vb.net code. now, i want to remove the gridlines on the chart and want to remove the y axis. i am not able to get the exact object and properties of the axis . can u plz tell me, what should i do? the code is as, ...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.