Adding HTTP Authentication to SoapUI testrunner.sh test cases I've written recently about some peculiar behaviour in SoapUI when using Setup Scripts and also about using testrunner.sh and project properties to to run SoapUI tests via the command line. Those articles were informative in their own right but they didn't cover one important part that many web services usually (and should!) have - authentication. So I'm going to tackle that here, or specifically how to make your SoapUI test cases authenticate to a web service.
Testing using SoapUI property values, SOAP response capture and no GUI I recently had to analyse the performance of a web service that can be used to upload documents into a database, SoapUI was the natural choice for this but I didn't want to run it from my laptop so I could avoid network transfer times interfering with my results. This meant I had to run SoapUI directly on the server where the web service was running.
Latest JodaTime and WebLogic incompatibility, missing methods Joda-Time is a great library if you can't use Java 8 in your project. If you happen to be using version above 22.214.171.124 with your web service and deploying to WebLogic 12c (12.1) you will likely get java.lang.NoSuchMethodError exceptions. This is how to fix it.
Conserving the Log4J MDC context when using a thread pool I've been updating logging in the web services I look after so that the WS-A MessageID can be logged for each request and for all of the messages written to the log during that request. On the most part putting this value it into the MDC and configuring the appender to write it out to the log is all that's required. However, when you start using thread pools e.g. with ThreadPoolExecutor the MDC goes haywire and that's because and I quote..."The MDC is managed on a per thread basis."
Example JAX-WS WebService built with Oracle WebLogic Maven plugin (wsgen) In the past I've shown how to use Ant and the JWSC task to build a JAX-WS web service, well I've moved onto Maven now and started to use the Oracle WebLogic Maven plugin to build services. This is an example on how to build a JAX-WS web service using that plugin, specifically the wsgen goal.
Returning compressed MTOM data with JAX-WS DataHandler A while back I've shown an example MTOM/XOP enabled web service using DataHandler. Although MTOM is great for optimising the output of a web service, sometimes it's just better to compress these results before sending them.
Maven WebLogic Plugin and the Java 5 source code bug plus how to fix it I've noted previously that the JWSC Ant Task fails to build Java sources above 1.5 source version due to a hardcoded "1.5" value in one of the Jar files. That was happening for the 12.1.2 version of the Ant task, it also appears to be a problem in the 12.1.2 Maven plugin as well as the 12.1.3 Maven plugin.
Unresolved WebApp library references defined in weblogic.xml when deploying via Administration Console I've had the development team on my current project come to me with a peculiar issue. They were trying to deploy one of the web services and kept on getting an unresolved library reference error every time. This struck me as odd because we deploy these services all the time without any issues. I looked into this further and discovered that the team was using the Administration Console to deploy this service, instead of using the wldeploy ant task. This is where things got interesting.
Fixing the 'This Web Service is not currently available' issue in WebLogic While I was experimenting with different ways of packaging our web services and shared libraries, I've come across a problem where WebLogic was reporting a status of 'This Web Service is not currently available'. This was happening for a web service that was clearly put into service (Active state). I could make calls to this service without any errors, yet the WebLogic Console was throwing a hissy fit.
Addressing the weblogic.application.ModuleException: Context path '/my_shared_lib' is already in use error I've experienced a strange error coming out of the Weblogic wldeploy tool recently. It was reporting that a context path used by my shared library is already in use when I was trying to deploy a new web service. This seemed confusing to me - I had two web services that were both referencing the same shared library, the first service would deploy without any issues while the second would fail deployment with the context root error. Shared libraries by their nature are meant to be shared so what was the issue?
How to get the WebLogic 12c JAX-WS runtime version number I needed to know the version of the JAX-WS runtime that my installation of WebLogic (12.1.2) was using. This information was nowhere to be found in the documentation, so I decided to do some digging around to see what I can find.
HashMap keys and values passed as null with JAX-WS and WebLogic 12c I've noticed something curious while testing some web services recently. The keys and values in the HashMap object that's passed as an IN parameter to the web service were all being turned into nulls. If I passed one key/value pair, I'd get one key/value pair of nulls, if I passed two key/value pairs, I'd get a pair of null/null, and so on. I did eventually track down the problem and fixed it, but it has been an interesting issue to come across.
How to fix the JWSC WsBuildException: Wrong number of class files So I've continued moving my web services over from wsimport way of building them to JWSC and in my quest I keep hitting issues to do with JWSC compilation. This latest problem came in the form of 'Wrong number of class files' error message. This stumbled me for a while, it was an hour before my vacation was about to start, I just wanted to throw the laptop off the balcony at this point, but I managed to find a fix for this error.
JWSC from WebLogic 12.1.2 fails to build Java sources above 1.5 I've written a post previously showing an example build system that uses JWSC to build your JWS based web service and then the wldeploy task to deploy it to WebLogic. Recently I've been expanding on the use of JWSC at work and have come up against a serious obstacle. JWSC would not build any Java sources that were above the 1.5 language level.
How to enable Webservices request and response dumping in WebLogic Recently we've had a need at work to see exactly what requests have been arriving at one of our WebLogic servers, this meant enabling HTTP Transport dumping to a log file. I've done this previously with success, but this time around I've hit a few issues. Some of our web services would cause a request/response dump to the log file, but some would not. After searching for a while, I found how to ensure that all requests/responses are dumped to the managed server log file, here's how.
Force HTTPS SSL URLs on web service requests in WebLogic I've written earlier about adding basic HTTP authentication to a web service. That example forced the user of the web service to authenticate using basic authentication before a request would be served, however the username and password in this case are prone to sniffing and can be retrieved with relative ease. This is easily addressed by setting up your deployment so that WebLogic forces the use of HTTPS/SSL URLs web making requests.
WebLogic 12.1.2 not respecting @PostConstruct annotated method exceptions I've been working on moving our web services at work to WebLogic 12.1.2 and noticed a curious issue. When I first moved one of the web services across, I knew for a fact that the method that's annotated with @PostConstruct would fail (due to changed data source names). However, when I deployed the service it was successful. Looking at the managed server logs, the service did indeed fail during initialisation, so subsequent calls to this service were failing for me. This seemed like a problem so I went out to verify it with a simple example.
SoapUI not respecting authorisation settings for web service requests We've been moving our web services over from Oracle Application Server 10g to WebLogic 12c. This meant that the authorisation settings for these services have changed. We were no longer using the same users/passwords to authenticate to a web service with each request. While testing this out I've noticed that SoapUI had some really odd behaviour and was not respecting some of the authorisation settings that I used.
Adding basic HTTP authentication to a WebLogic web service Here's how to add basic HTTP authentication to a Weblogic web service. I've had to do this recently at work and was a little confused at how the role-name, principal-name, etc were related so decided to add this as a note for the future and for anyone else who may be interested.