Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

So you've created a JAX-WS client for a web service you want to call and you added the AddressingFeature to support WS-A. You can see wsa:MessageIDs being generated and sent to the target web service, but instead of having random IDs, you want to be able to create your own. Unfortunately, AddressingFeature doesn't provide this level of customisation.

If you're using JAX-WS RI to generate your service client, the only way to get past this shortcoming is to create a SOAPHandler that can intercept and change SOAP headers. The handler needs to look for the MessageID header, which can then be overwritten.

To get this handler to work, two other additions are required. First, a handler-chain.xml file needs to be created that specifies the name of the SOAP handler class we're about to implement. This file needs to be presents on the classpath and be part of the same package as the web service client.
 handler-chain.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<handler>
<handler-class>net.igorkromin.WsaMessageIdInjectionHandler</handler-class>
</handler>
</handler-chain>
</handler-chains>


Then the xxxxService class that was generated as part of the web service client needs the following annotation added at class level...
 Service Annotation
@HandlerChain(file="handler-chain.xml")


Then comes the fun part, the SOAP handler class itself...

Continue reading...  

, , , ,

I've recently installed the 12.1.2 update for Safari and all of a sudden the Online Atari Lynx Emulator I've published stopped working when loading ROMs from the local file system. I've been making some updates to this emulator so figured maybe I screwed something up so tried running my development version, and that had the same problem. After spending hours going through code I couldn't find any issues...then I remembered about that Safari update the day earlier.

What was odd was when I loaded ROMs from a URL, they would run OK. It was only the locally loaded ROMs that would fail. Quite a while back, due to Chrome's Autoplay Blocking, I had to implemented a 'Click to Start' button for URL loaded ROMs. At the time, Safari didn't require that. Now however it seems that Safari is even more strict than Chrome, and Firefox.
safautoplay_2.png


So I knew that it was just a problem for locally loaded ROMs and started to play around with various Preferences. In the end I found that it was the "Auto-Play" setting, "Stop Media with Sound" that was the culprit. Maybe this update has reset it for me, but toggling it from "Stop Media with Sound" to "Allow All Auto-Play" made the emulator work again properly.
safautoplay_1.png


Continue reading...  

, , ,

It's been a while since I dipped my feet into Oracle Coherence but I figured that I'd revisit the topic again. In 2018 after upgrading to WebLogic 12.2, I started to experience some class loader issues, this unfortunately impacted how my web services were loading Coherence configuration. It turned out that the tangosol-coherence-override.xml file wasn't being loaded from the WEB-INF/classes directory and I needed a different solution.

After some initial tinkering, everything worked fine when I had a single web service deployed, but when I tried to deploy multiple services that used Coherence, the following exception would get thrown during service startup...
 Error
java.lang.IllegalStateException: Service "ReplicatedCache" has been started by a different configurable cache factory.


Ugh! Maybe I needed to look at my class loader configuration in better detail, but I felt like there should be a very simple solution for this.

This article was a great help, but it wasn't the final solution. I didn't want to specify the entire Coherence cache configuration programatically but I did want to control which configuration file was loaded by Coherence using code in my web service's PostConstruct annotated method.

Discussing the issue with a Coherence engineer, this is something I ended up coming up with...
 Java
ExtensibleConfigurableCacheFactory.Dependencies deps =
ExtensibleConfigurableCacheFactory.DependenciesHelper.newInstance("my-coherence-cache-config.xml");
ExtensibleConfigurableCacheFactory factory =
new ExtensibleConfigurableCacheFactory(deps);
ClassLoader loader = this.getClass().getClassLoader();
NamedCache nc = factory.ensureCache("MY_CACHE", loader);


The key was the ExtensibleConfigurableCacheFactory.DependenciesHelper class. The file, my-coherence-cache-config.xml, was bundled with my web service (WEB-INF/classes) and contained all the Coherence cache configuration that was needed for a specific web service. Now different web services could load their own configurations! The main down-side was that I needed to keep track of the factory class.

In the end I didn't use this approach and opted for an even simpler solution, which I'll discuss in another article.

Continue reading...  

, , , ,

If you haven't seen the Metal Earth Legends series of kits, they are worth checking out. I've built a few now, including Starscream and Gollum, Marvin the Martian and Groot. This weekend I took to The Flintstons Car and I wasn't disappointed!

At first glance I thought this would be a really quick kit to build, but it still took me over two hours. Most of the detail is in Fred and Barney, the car sections are made of large metal parts and don't have too much detail apart from the painted textures. Just like other Legends kits, this one is very colourful and is designed to appeal to a younger audience.
IMG_5052.jpg


This is a special edition kit, I'm not sure what that means exactly though. There are two metal sheets and one double-sided instructions sheet. The metal parts are painted and seem to be slightly thicker when compared to the usual Metal Earth 3D kits, though that could be due to the paint layer.

IMG_5040.jpg IMG_5041.jpg


First sections to build are Fred's body parts. It's all fairly straight forward with the legs being identical and arms being mirror images of one another. The torso is made of two pieces and all the body parts connect to it, including the head. A nice touch is that the blue tie is a separate part, not just painted on.

IMG_5042.jpg IMG_5043.jpg

IMG_5044.jpg


Continue reading...  

, ,