Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

miha zoubek

Greenhorn
+ Follow
since Sep 13, 2019
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
3
Given in last 30 days
3
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by miha zoubek

Stephan van Hulst wrote:I think if you want to control what prefixes are used, you can do it by declaring an @XmlSchema annotation on the package itself in package-info.java and configure the xmlns element. The Javadoc has an example: https://docs.oracle.com/javase/10/docs/api/javax/xml/bind/annotation/XmlSchema.html



ok, i will try. Thank you very much. But anyway if this is not issue, then i can leave it like it is.
2 hours ago
Another thing from logs:

java.security.NoSuchAlgorithmException: Null or empty transformation
at java.base/javax.crypto.Cipher.getInstance(Cipher.java:526) ~[na:na]
at com.sun.xml.wss.impl.apachecrypto.EncryptionProcessor.encrypt(EncryptionProcessor.java:1052) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.filter.EncryptionFilter.encrypt(EncryptionFilter.java:430) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.filter.EncryptionFilter.process(EncryptionFilter.java:389) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.HarnessUtil.processWSSPolicy(HarnessUtil.java:81) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.HarnessUtil.processDeep(HarnessUtil.java:252) ~[xws-security-3.0.jar:3.0-FCS]




Does this mean that before Cipher.java:526 was executed EncryptionProcessor.java:1052?

In  EncryptionProcessor.java:1052 there is this:

I see this:



How this is string if I put flag on this line and trigger debug and it shows like object?

https://drive.google.com/file/d/1BkvKMSQPyvf7rWT7rIbRUYQVoc0ZEg-j/view?usp=sharing





2 hours ago

Kristina Hansen wrote:Well, some of your code tries to initiate a XML cipher. So, look through your code where you call Cipher.getInstance(). Also: What you posted is just the exception message, but an exception always also have a stacktrace - if you don't get one in come catch block there's a printStackTrace() missing - as the stacktrace shows you exactly the information you want to know: where's the call that fails.
Look through all your catch blocks and make sure you have a printStackTrace in each one - this should help you to find the call failing.



Hi Kristina

i do not know where to put stacktrace as this is not my library, it is library of spring-ws which i can not edit.
2 hours ago

Campbell Ritchie wrote:How does that error occur? We need more details before we can help. Is this related to your previous post?




Hi Ritchie

yes it is related to this post. I am rreally struggling to debug this
2 hours ago
Hi

my error is this, but this is not really the case. I need to find out the flow of code which in some step trigger this error:

Error is this:



This is the method that triggers this error:
 

I do not know how to find out which method is calling this method, so that i do reverse engineering and find out why "String transformation" is not set and where/how must be set.
I  am using IDEA IDE.

tnx
miha


9 hours ago

Stephan van Hulst wrote:It really should not matter what prefix you use, as long as the prefix is an alias for the correct namespace.

But if you have to change the prefix in order to make the receiver work, then the receiver doesn't know proper XML.



HI, so basically this should not be an issue:

as i have namespace and prefix the same:



Another thing. This "prefix" is itis parsed from wsdl file? Who defines this? I do not see this in wsdl.

tnx
miha
16 hours ago
HI

can someone point me what i am missing in my security policy looking at error bellow:


My Policy:



thank you.
1 day ago

Stephan van Hulst wrote:Why? Assuming the "Enevelope" in the first snippet was just a typo when you wrote your question, the only thing that's different is the namespace prefix.

Do "env" and "Soap" refer to the same namespace?



Hello

right now my request looks like:



I need to change this to:



Yes, the same namespace.


I will point out also this. When I import wsdl to SoapUI I get right namespaces but when I am generating classes via JAB2X module i get above result:

1 day ago
Hello

I need to change -> in my SOAP request.

I am using this:




and this:





I do not know if I must change this within above methods or must I do it differently. Or I can define this in classes generated from WSDL file?


thank you.
miha
1 day ago
Hello

my sign of request is working perfectly. But when I add to encrypt also request i get this error:

2019-10-16 10:52:59.296 ERROR 6912 --- [nio-8080-exec-1] j.e.resource.xml.webservices.security    : WSS0221: Unable to locate matching certificate for Key Encryption using Callback Handler.
2019-10-16 10:52:59.304 ERROR 6912 --- [nio-8080-exec-1] com.sun.xml.wss.logging.impl.filter      : WSS1413: Error extracting certificate




My code part:





from what i see the main issue is that alias for encry cert is not set. How to set it i do not know as the same handler is called for sign and encry. Sign is working.

Link: https://docs.spring.io/spring-ws/site/reference/html/security.html

7.2.4.2. Encryption
To encrypt outgoing SOAP messages, the security policy file should contain a Encrypt element. This element can further carry a EncryptionTarget element which indicates which part of the message should be encrypted, and a SymmetricKey to indicate that a shared secret instead of the regular public key should be used to encrypt the message. You can read a description of the other elements here .

<xwss:SecurityConfiguration xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
   <xwss:Encrypt />
</xwss:SecurityConfiguration>
The XwsSecurityInterceptor will fire a EncryptionKeyCallback to the registered handlers in order to retrieve the encryption information. Within Spring-WS, there is one class which handled this particular callback: the KeyStoreCallbackHandler.




Picture of object:
https://drive.google.com/file/d/1VF4St9EzcJZZo8wrhIRpbTXN2i8WpBhS/view?usp=sharing


And part of class that executes this:

https://pastebin.com/mbxuAgy7


Tnx
miha
3 days ago

Matt Wong wrote:would be helpfull by posting code causing the issue



I fixed this. It was issue with alias as I did not provide it:)
3 days ago
Hi

I am getting this error when trying so sign request with cert:



and latter:



I tried with generating new keypar for jks keystore and it is the same.

I guess it should be something else? I look at object and all properties for keystore are set.



Can anyone point me where i should look for?

tnx
miha
4 days ago
Hi

no i was having issue as jks file was not inported to keystore. I found issue, now when I am returning KeyStore object not FactoryBean object KeyStore is generated

tnx
4 days ago
Hi

i am spinning in circles  and do not know how to fix this

So i am importing keystore like:




But I get:

Loading key store from class path resource [test.jks]
Creating empty key store

System.out.... gives me


Which is correct path. The same way I am loading policy file and it is loaded correctly. I tried with different keystore and it is the same.
Can anyone know what could be the issue ?


tnx so much!
miha
5 days ago
Hi

I need to first sign outgoing SOAP request. The main issue is that i have configured and code everything it is in doc but reuqest is not signed. So, fure sure i missed something as my knowledge of java/spring is not very high (starting to lear). I would really be grateful for some help

My code:
SoapConfig.class


}

SoapClient.class



I guess the main issue is how to trigger this interceptor. Thank you!
1 week ago