Kjeld Sigtermans

Ranch Hand
+ Follow
since Aug 10, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kjeld Sigtermans

Thanks Frits (vriendelijk dank )
I looked in to it, and asked the providing party to change their WSDL.
However now I am facing another problem, which I posted here

Cheers,
Kjeld
9 years ago
I would like to access a third party websevice using a Java client that I generated with JAX-WS wsimport, based on the WSDL provided (I am using a Maven plugin).

For quite a while I was unable to retrieve a useful response, not in the Java client and also not in SoapUI, until I found out that I had to enable WS-A on the request. In SoapUI this now results in the expected response, but what must I do to also 'enable' WS-A in the Java client? Do I maybe have to alter the WSDL, or add a parameter to wsimport?

I found some documentation on WS-A online, but so far could not find an answer.

Thanks in advance.
9 years ago
Answering my own question:

I did not find any way that Hibernate will check if the object that I am about to persist somehow already is present in the database table.
So I created a method that recursively checks the object, and all its children, to see if either of them is already there in the database (comparing the columns that are defined to be unique). If so, the persisted 'table' row/object is used instead (replacing the object I was about to persist). If not, the new object is persisted.
I used a lot of Reflection to achieve this, but it works perfectly.
Hi,

I am using a Java program I made, that makes use of Apache HTTP Client, to access a secure website (https).
When sending a request to this https:// url, I get a HTML response with an error message (a text message the site itself returns saying I probably made a typo).
When doing the same in a browser, I do get to see the page that I want. I'd like to get the same result when accessing it using my program.

In both cases, I am using a local debugging proxy, that tells me there is only one thing different: in my Java approach, I am not setting a SSL sessionID: it is 'empty'.
When using the browser, the sessionID is set: it is equal to a SSL sessionID, provided in the response of a previous request.
Now, this program I made works flawlessly with regular http requests and parameters. I just really do not know how to get the SSL sessionID from a response, and to make sure it is there in the next request?

Thanks!
Kjeld
9 years ago
Hi,

I am using Hibernate combined with HSQLDB. It has been a while since I used Hibernate.
Is it possible to have either Hibernate or HSQLDB make sure that rows in a table are unique?
I mean not just using a uniqueness constraint and getting an exception when persisting an object. When persisting an object, I would like one of these products to check if a similar row is already present in the table, and if so, use a reference to the already existing row, instead of the one that was about to be persisted.
Or do I first have to check this myself by retrieving all rows in a Set and then use contains(..), for the object and every child object?


Thanks!
Kjeld








Ok, I created a class called a 'Chain'. It implements Iterable and therefore provides an iterator. For now it only has one other method, add(final T predecessor, final T successor), with which predecessor-successor pairs can be added to the chain.
For example, when adding pairs (B, C) and (A, B) and (null, A), the iterator will return A, B, C. When providing an element that 'breaks the chain', like (D, E), the iterator just stops at C and will never show D or E, because no successor refers to D.
It is not allowed to add the same predecessor twice (illegal argument). When the precedessor is null, it depicts the successor is the first element that should be returned by the iterator. A successor can never be null (illegal argument).

I can now utilize the Chain class in my test class (see previous code posted here above) like this:

It returns the elements in the correct order.
10 years ago
Thanks. I really like the map solution and also the idea of leaving the collection unsorted: I could create my own List implementation of unsorted elements, with an iterator that returns them in the correct order. I am going to try that.

Cheers, K

10 years ago
I have come up with the code herebelow. The method 'sortManually()' works for me.
The for statement iterates through each element in the original list. The element is always added to a new, sorted list, it is just a question at what index.
The inline statement clarified (gotta love 'em): when the reference (the other element this element refers to) is null, the element is placed at the very beginning. Otherwise, when the reference already exists in the new list, this element is placed just after it. Otherwise, the element is just placed at the end.
This code assumes all elements are each referred to by one other element, or not at all.

10 years ago
I believe equality of classes in Java is how we define them to be, and furthermore, a comparator's results are not per se based on some sort of equality, so I don't agree on that part.
However, the solution I mentioned before does not work. I hoped it would. So now I'm trying something other than using a comparator.

10 years ago
Well, now I am thinking what if the comparator returns 0 if the two elements do not refer to each other, returns 1 if element B refers to A, or -1 if A refers to B? Something like that. I haven't tried it yet.
10 years ago
Hi,

I am trying to find a way to sort a collection of elements. These elements are all of the same type, and refer to each other, in such a way that each of them refer to their predecessor (the elements have an id, and a 'previousId', which refers to the id of the previous element. The first element is indicated with previousId = null).
Given that the collection has these elements in random order (unsorted), how can I sort them to be able to display them in the right order? Is it possible to sort them using a comparator, or should I look for alternatives?

Cheers,
Kjeld
10 years ago
Better late than never: I finally went with the psexec solution, since I was unable to find a framework with which I could accomplish the same thing.

Thanks!
10 years ago
Thank you for this; but what I am looking for is a Java API, so I can do exactly that from my Java program. Sorry if I was unclear about that.
Installing something like PsExec and then run it from my code is also not an option for me. I am really looking for a API equivalent to something like PsExec.

Cheers,
K
10 years ago
Hi,

Is it possible to run an executable file (e.g. bat or exe or runnable jar) on another Windows machine than the one where I am running my Java program (in the same network)?
The executable file is already on that remote machine, and I have the credentials to log in as an admin on that machine (i.o.w. I can log in as an admin on that machine using Remote Desktop).
I am trying to automate running a script on several Windows machines in my network. So I don't want to run the file manually or set up a scheduled task, but I want to start it from my client pc where I am running my Java program.

Cheers,
Kjeld


10 years ago
Nevermind. I resolved it by removing the interaction sequence from the script.
10 years ago