Axis 1.4.1 wsdl2Java Locator classes - client

I spend a good amount of time on rest services but not so much on SOAP services. So this might be a stupid question, but i am going to ask it anyway.
I am building my wsdl files with wsdl2java (axis 1.4.1). The sample code I was given has a Service Locator class in the generated client code. I am trying to figure out if I need to build this class after my client is built or if I am doing something wrong in my wsdl2java command
wsdl2java.bat --test-case --generate-all --unpack-classes -uri file.wsdl -o src

Try adding -W -a to the cmd line parameters. I was having problems with missing classes ( still am actually ), but those parameters created most of the missing classes. I'll update the answer when i resolve my last missing class.
Here is the axis wsdl2java reference http://axis.apache.org/axis/java/reference.html
Just found that also adding -w parameter fixed my last issue.

Related

How do I configure micronaut serialization to work with open api generated models?

Problem Description
I have a project in which I am building a RESTful api with micronaut. The models returned in the response body are generated from an open api specification (using a gradle plugin).
However, for some reason, it micronaut always returns any model object as an empty json object {}, even when it should be a populated object.
Repository Link
https://gitlab.com/connorbutch/open-api-micronaut-quarkus
Examples of output
Expected:
[
{
"id": 123
"name": "Scruffy"
"tag": "Chuck's pup"
}
]
Actual: [{}]
How to reproduce
Clone code locally (git clone ....)
Navigate to the root directory (cd .......)
Run a gradle build (gradle clean build)
Navigate into reading-comprehension-server-impl (cd reading-comprehension-server-impl)
Run docker build (either docker build . -t .... or just run ./docker-build.sh) <-- this step will take a little bit of time and memory, so potentially close other applications
Run the docker image that was just built (docker run -p 8080:8080 reading-comprehension-server-impl)
Make a get request to the server (http://localhost:8080/pets?limit=4)
Ideas I have
Some things I was curious about include:
could this be a (gradle) scope issue? Should I use api instead of implementation for the #Introspected annotation (just to see if it works)?
could this be an issue with the model being generated in another module/jar? Should I move the generation to the same project (just to see if it works)?
could this be an issue with different micronaut version across modules?
Is there somehow I can inject (or otherwise) get a reference to the bean serializer to debug further?
Other explorations
I modified one of the endpoints to return an object model from the same module (just a dummy response) and that was returned in the proper format.... so it might be either a version issue, or a build issue (since it's in another module)
I modified the included module to use the same micronaut version (1.3.0 for now, would like to bump to 2.x.x in future), but still doesn't serialize correctly
I created a copy of the class attempting to be serialized in the response body into this module, and it worked (see NotARealPet.java). Now the question is, can I configure this to work, or should I just (temporarily) change the api to generate in the build dir of this project?
I found the answer. Even if a class is compiled with #Introspected, the graal vm (native-image cli) does not look at those classes. In order to include these, I eventually ended up including a class specifying to introspect these classes #Introspected(classes = { Pet.class, Error.class})
If anyone is interested, I'll post a gitlab link with examples

SpringBoot creating a framework starter library

I am creating a library using spring-boot (v2.1.6.RELEASE) as a starter project that will facilitate as base extension jar responsible for configuring and starting up some of the components based on client project properties file.
The issue I am facing is that if the client project's SpringBoot Application class contains the same package path as library everything works like charm! but when client project contains different package path and includes ComponentScan, it is not able to load or start components from the library.
Did anyone encounter this issue? how to make client application to auto-configure some of the components from library jar?
Note: I am following the library creation example from here: https://www.baeldung.com/spring-boot-custom-starter
There are many things that can go wrong here, without seeing relevant parts of actual code its hard to tell something concrete. Out of my head, here are a couple of points for consideration that can hopefully lead to the solution:
Since we use starters in our applications (and sometimes people use explicit component scanning in there spring applications) and this obviously works, probably the issue is with the starter module itself. Don't think that the fact that the component scan is used alone prevents the starter from being loaded ;)
Make sure the starter is a: regular library and not packaged as a spring boot application (read you don't use spring boot plugin) and have <packaging>jar</packaging> in your pom.xml or whatever you use to build.
Make sure you have: src/main/resources/META-INF/spring.factories file
(case sensitive and everything)
Make sure that this spring.factories file indeed contains a valid reference on your configuration (java class annotated with #Configuration). If you use component scanning in the same package, it will find and load this configuration even without spring factories, in this case, its just kind of another portion of your code just packaged as a separate jar. So this looks especially "suspicious" to me.
Make sure that #Configuration doesn't have #Conditional-something - maybe this condition is not obeyed and the configuration doesn't start. For debugging purposes maybe you even should remove these #Conditional annotations just to ensure that the Configuration starts. You can also provide some logging inside the #Configuration class, like: "loading my cool library".

Akka with spring and maven

I am trying to use "Akka" model with spring in maven project but i am not able to succeed because i am getting initialization failed error. I would like to know that is it possible to use them together and if it is then let me know.
Sure, we built a whole framework based on akka+spring+maven at my company. Setting it up is a bit tricky, but once configured it works smoothly. You can find a lot of examples online, like http://www.baeldung.com/akka-with-spring, but just by googling 'akka spring example' you will get a few entries.

Spring insecuremvc - sample files location?

I am trying to use Spring with: gradle, annotations (not xml), springboot, embedded server. Followed the guides of the side; they are great. Now I wanted to try it myself. I am creating a simple MVC (however I do not understand the difference between MVC and web-MVC entirely) - and want to add 'security'.
This example 'insecuremvc' (is maven, is war; instead of gradle/jar; but it is available). I could make it run.
However, where are the sources? I wanted to see them to learn it. It runs in my localhost, magically if said so, only by poms and downloaded jars - while, I could not find the jar of insecuremvc or such.
A similar question did not help. Is there anything fundamental that I have missed?
You wont have sources located in a WAR file as it means a web-archive. You can use the below link to get your sources which are in Groovy.
Source code
If there is anything else, let me know.

how to use a service in the class file generated using javaassist

Can i use a service in the class file which is generated using javaassist. how can i achieve that?? and as this class is created dynamically how can i register that this class is using the provided service of another class?
I've asked a similar question here.
The smallest unit of 'installation' would be a bundle. You could generate a sort of 'virtual bundle' around your class file, including a OSGI-INF/componentX.xml descriptor, and install that into OSGi.
If it changes, regenerate the bundle and update OSGi.
I didn't go down this path as I have a lot of generated code (about 4500 different scripts that all have dependencies) and I fear that I'd get into problems if I'd generate that many bundles.
I also got a tip about the Felix Dependency manager, but I haven't thoroughly checked that out yet, it might do the things we need.

Resources