Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

miha zoubek

Ranch Hand
+ 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
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by miha zoubek

Himai Minh wrote:EndpointInterceptor is an interface with 4 methods definitions.
Your GlobanEndpointInterceptor only overrides 2 of them. So, you need to define the implementations of the other two methods.

Reference: https://docs.spring.io/spring-ws/docs/2.2.3.RELEASE/api/index.html?org/springframework/ws/server/EndpointInterceptor.html




@Himai Minh thank you. This was the case. But the main issue perssist. I do not know why EndpointInterceptor in not triggered when request is recevied.





interceptor class:



}


thank you
1 week ago
Hello

So i have created web services which is working ok and @Endpoint is detected when there is no ws-security enabled (Wss4jSecurityInterceptor). If I enable security   I get: No Endpoint found.

I guess the main issue here is that the @Endpoint is triggered before interceptor decodes request from client (I guess).

I am trying like this if interceptor will be triggered but i get different error which i am unable to fix:

Error:(10, 8) java: softnet.si.ldp.client.GlobanEndointInterceptor is not abstract and does not override abstract method afterCompletion(org.springframework.ws.context.MessageContext,java.lang.Object,java.lang.Exception) in org.springframework.ws.server.EndpointInterceptor



import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;




My interceptors:
 

thank you for all help!



1 week ago
Hello

I will kindly as you to help me debug this as I am spinning in endless loop

So, here is first my error:


2020-03-27 11:35:07.491  WARN 33616 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'portingNotification' defined in class path resource [softnetservice/local/softnet/config/SoapServerConfig.class]: Unsatisfied dependency expressed through method 'defaultWsdl11Definition' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'portingShema' defined in class path resource [softnetservice/local/softnet/config/SoapServerConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: class path resource [PortingNotification_WS.xsd] has invalid root element : [definitions] instead of [schema]



And here is my code:



and my pom: I am puting it on pastebin link due to size: https://pastebin.com/ePbTL3VW


thank you.
miha
4 months ago

Campbell Ritchie wrote:Too difficult a question for “Beginning”. Moving discussion.
Please supply more details about the XML calendar class, and how it is supposed to take its input. I am not familiar with it. Are you supposed to use a date format object to parse that text? Why aren't you using the current date‑time classes?



Class in which there are methods:
public void setFromDate(XMLGregorianCalendar value) {
       this.fromDate = value;
   }

and "setToDate" are generated from wsdl, which i got for implementation of SOAP. From this method you can see that type is  "XMLGregorianCalendar": https://docs.oracle.com/javase/7/docs/api/javax/xml/datatype/XMLGregorianCalendar.html

The main issue if for me that in doc from provider i can see that date should be like year/month/day hour/minutes, which is not what I am seeing in XMLGregorianCalendar method
9 months ago
Hi

in method defenition I have this:

public void setFromDate(XMLGregorianCalendar value) {
       this.fromDate = value;
   }



So i should set value as type XMLGregorianCalendar.

I see that xml is set with this annotation:  

Problem is this: in documentation i see that time should be send in request like:


Problem is that this give me error: I guess due to "/"

How can I set (esace /) that this will wokr?


tnx
miha
9 months ago
This is whole request, i was having that part as you were asking ecrypted, so that is why i printed only ecrypted part:
9 months ago

Stephan van Hulst wrote:Doesn't look like the entire story, as evidenced by the namespace in the output XML. Do you have package level annotations?



I am just printing this part, otherwise namespace is defined.
9 months ago
Hi

I have issue with marshaling as after marshall happens the propery which was set is not populated in xml (fromData nad toDate).

my class:




my code how i am marshalling:



Output is:

9 months ago
@Kris i moved everything to java 8 and now it is working

thank you for all help!
9 months ago
@Kris thank you for this tip and helping me understand this.

SoapClient.java



PortingApplication.java



And yes, xml is for loading policy file, which indicated what it is used (sign, encrpy,...). I fallowed tutorial and do not see that I missed something.

How can I debug verison issue?

My pom.xml


9 months ago
Kris thank you so much.

This is when i try to encrypt with symmetric keystore:
https://pastebin.com/0LGQrvTC


This is when i try to encrypt with keystore:
https://pastebin.com/mSYHfD2R

thank you!
9 months ago

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.
9 months 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





9 months 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.
9 months ago