Andrew Prinoli

Greenhorn
+ Follow
since Jan 11, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrew Prinoli

Hello ,
I'm using Tomcat6 + Axis 1+wss4j.
I have to modify something in wss4j's source code but I can't test its results...but I couldn't enable logging with log4j..
How should I do that???
I could be able to do log with log4j for axis..using the following properties file , placed in folder \Tomcat\webapps\axis\WEB-INF\classes.

log4j.properties :

# Set root logger level to WARN and its only appender to A1.
log4j.rootLogger=WARN, A1
# show DEBUG for SOAPPart method
log4j.logger.org.apache.axis.SOAPPart=DEBUG
# A1 is set to be a ConsoleAppender.
# log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=axis.log
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


How do I enable logging with wss4j?
I tried putting the properties file included with wss4j's source but with no luck..
Thanks in Advance
15 years ago
Hi,
I have a simple class with 2 constructors.(It's very long so I won't paste it..).
I assign the value of a boolean static field according to the used constructor.
I also have implemented serialize/deser methods.

My problem is the following :
I have to perform different serialization/deserialization actions according to the constructor..so to the static field...but the static field doesn't preserve its value..
How should I do that??
How should I discrimine between them?
15 years ago
Hi..my aim is to serialize/deserialize my "SoapPair" class , that contains Axis MessageContext obj (SoapPair receives this from its constructor), not serializable object(when trying to normally serialize , it returns "axis MessageContext not serializable")..
How do I serialize/deser the SoapPair class?
Do I have to use SerializationContext/Deser context? How?
Thanks in Advance.
15 years ago
ok..I've googled around..
I've tried in the following way , but I still receive an exception (java.net.MalformedURLException) , while deserializing..


If you have any idea please help me..
Thanks a lot..
15 years ago
Hi,
I'm developing for my thesis a java project implemented ad the top of Axis1. I should implement an addition handler for Axis1 (and wss4j).
I've almost done all the work..but I have a big problem that I cannot solve..:
have to implement serialization/deserialization methods to a class (called SoapPair) using Axis serialization/deserialization.
The class SoapPair ,as the name indicates, contains a Soap message divided into header+body . At the constructor receives a MessageContext obect from Axis.


I have to implement those methods but I don't know how..
I have to call them from a test class that simulates Axis engine (passing to soappair a MessageContext obj).


Thanks in Advance
15 years ago
I have some soap content encapsulate in a few w3c node. From this object I wan't to obtain a SOAP Message (or and Axis Message...)but I don't know how....Firstly I think that I should convert the node into a document..
Hi,I have a org.w3c.dom.node and from it I wan't to create a
SOAPMessage object.
Unhappily I tried with no luck..
How should I do that?
Thanks in advance
Hi,I have a org.w3c.dom.node and from it I wan't to create a SOAPMessage object.
Unhappily I tried with no luck..
How should I do that?
Thanks in advance
15 years ago
I create a simple axis Message whith this simple procedure :



And I think that that part of code should work ok..since if I print out the message with i.e. "msg.writeTo(System.out)" it works..

I need to retrieve the SOAP header , but I keep on getting errors (nullpointer..) while doing it with "msg.getSOAPHeader()".
It doesn't even work doing so :



How should I do that?
Thanks a lot in Advance..
Bye

A.P
15 years ago
Hi,
I've just created a javax.xml.soap.SOAPMessage from scratch and it works.
My aim is to create an org.apache.axis.Message from that SOAPMessage..but I don't know how..I tried using the various constructors but with unsuccessful results..
e.g.Message m=new Message(soapenvelope)
etc..
Anyone knows how to create that?
I need it to at last create an instance of Axis MessageContext class ,to pass to my own test handler..
Thanks in Advance
15 years ago
thanks a lot..
It's for my degree project...I have to implement an automatic secure web service generator starting from formal description of protocols (with SPI calculus)..
andrew
15 years ago
Sorry,
my aim is to do that in a standalone program ,which receives with its own handlers a MessageContext object , and check is there is UsernameToken or not , and check if WssSecurity header or not..using wss4j and axis libraries (without a real webservice..)..
15 years ago
Sorry it's a very simple question :
what is the shortest way to check if an Axis Message object has or not a security header?
And how to check if an Axis Message object has or not an UsernameToken?

thanks a lot in advance
15 years ago
Hi guys...
I'm implementing a quite simple cryptographic algorithm , but I keep
on getting this exception :
java.security.InvalidKeyException: Invalid key length: 444 bytes
at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA12275)
at javax.crypto.Cipher.init(DashoA12275)
Please note that I have JCE working correctly..
Now I'll post and explain my code :

I have a byte[] buffer , which lengh is 304 bytes.
I have a Certificate retrieved from local keystore ,from which I get
corresponding PublicKey.
Then I retrieve Private Key from same keystore (passing a password)
I have to create the digital signature of that buffer (and it works
correctly) :

PrivateKey priv = sp.getPrivate();
Signature sig = Signature.getInstance(priv.getAlgorithm());//create a
Signature instance
sig.initSign(priv);
sig.update(BIGBUFFER, 0, BIGBUFFER.length);
byte[] C_FINAL=sig.sign();//returns the signature result in a byte
array

In the second part of the algorithm I have to encrypt the byte[] array
C_FINAL , using the PUBLIC KEY ..... but while executing the following
code I get the InvalidKeyException

Cipher CPHR = Cipher.getInstance("DES/ECB/PKCS5Padding");
Certicate id=sp.getId();//retrieve certificate from another class
PublicKey PUB_KEY=id.getPublicKey();//retrieve public key from
certificate

CPHR.init(Cipher.ENCRYPT_MODE, PUB_KEY);//this line throws the
exception....

C_FINAL = CPHR.doFinal(C_FINAL);

Please,anybody knows how to solve this problem..?
Thanks a lot guys...
bye
17 years ago
Hi guys,
I'm working on a distributed application.
My client side sends over tcp socket , serialized messages.The class that I serialize is called "AgentMessage". Serialization and deserialization seems to work correctly...but I have a question about keeping the state of a field (is a Vector) : I'll post the code to explain the problem...it's very simple :

public class AgentMessage{
private StaticPart sp;
private DynElement de;
private Vector oldde = new Vector();

public AgentMessage(String agent, byte[] code, String mainclass,Certificate signerId, PrivateKey priv, String configuration,String pack, Serializable dclear, byte[] dsecret, PathEl[] dpath,byte[] c) {

sp = new StaticPart(agent, code, mainclass, signerId,priv,configuration, pack);
de = new DynElement(dclear, dsecret, c, dpath);
oldde.add(de);

}



My final aim is to maintain in the static vector all the "DynElement" objects....
But ,when the message is deserialized in the server side of this app , I have to create a new instance of the class "AgentMessage"....so the elements in the vector would be lost.....
How do I mantain a collection of these objects??
Thanks a lot guys....
Bye!!!
A.P.
17 years ago