Regarding validating SMO XML in Mediation Flow in IBM WESB - websphere-esb

I want to validate the SMO XML flowing in Websphere Enterprise Service Bus(WESB) mediation module.
Is it possible to do it inside the Custom Mediation or I have to create a Java class for that?
And how can I do that? I'm clueless on how to approach this.
Also, if you can suggest any useful links to read more on this, I would appreciate that.
Thanks :)

Custom mediation is a java class behind scene.
In ESB, you can do schema validation of messages by setting the validation checkbox on xslt transformation primitive or you can use code in a custom mediation:
BOInstanceValidator validator = (BOInstanceValidator) new
ServiceManager().locateService("com/ibm/websphere/bo/BOInstanceValidator");
boolean valid = validator.validate(dataObject, diagnosticList);
Documentation

Related

How to provide child class of document in OASIS API for Filenet

We are trying to use OASIS API to create a document in Filenet through Atom. We tried different syntax but not working. If it's just cmis:document it's working but if we change that with any leaf class of document it's not supporting. Does anyone worked with OASIS API to interact with FIleNet for a custom class?
After going through the IBM website found answer. We were confused by following similar syntax "cmis:document". We were passing as "cmis:leafclass". But eventually came to know if you are passing leaf class no need of cmis: present. You just need to pass "leafclass". Below link for reference.
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014928326

Which function in "nestjs/swagger" converts DTOs to Swagger model definitions?

I have DTOs specified with Class-Validator and I am looking for a library that can be used to generate Swagger specification from it. I am not using it for a REST API, the code is addressing an IoT/MQTT scenario - I simply use Class-Validator to manage JSON.
NestJS/Swagger is the best maintained library. I would like to use it's capability to produce Swagger definitions without a NestJS Server. Ideally I would like to pass in a DTO definition and get it's Swagger schema.
I have been reading the source, but am struggling to understand which function in the framework actually does that. At best, I have been able to track it down to modelsDefinitions property in swagger-explorer class.
As best I can tell, from there, api-parameters.explorer and api-produces.explorer. The way they work is not clear to me. I was wondering of someone might help me out?
I'd like to add that I am aware of class-validator-jsonschema, but it is not maintained and no longer seems to work properly.
nestjs/swagger does not expose what you need as its public API which you cannot access it. The class you're looking for is SchemaObjectFactory and the method is exploreModelSchema.
Reference:
SwaggerObjectFactory
Test

How to retrieve post data, validate it in controller and save it in database using GORM in Micronaut?

I come from Grails background and have recently started a project in Micronaut using GORM.
I tried to find required information in documentation but its not clear how we retrieve post data in controller, validate it similar to Command Objects offered in Grails and save it into database using interface service provided in documentation
PS : I know I can map every field to action argument in controller, and also declare a interface method specifying each argument as property but that does not seems right thing to do as my domain class has so many properties.
Making the action #Transactional or any method would work for saving data as far as I know but I want to know the proper way in Micronaut.
My requirement is simple, save post data in database using GORM in Micronaut.
If I were you I would look back at the documentation, sections 6.4 to 6.11:
https://docs.micronaut.io/snapshot/guide/index.html#binding
https://docs.micronaut.io/snapshot/guide/index.html#datavalidation
http://hibernate.org/validator/
Micronaut is very annotation based, unlike Grails which uses convention over configuration. However in Grails 4, Micronaut will toke over the application context, giving you some of the benefits of Micronaut, but still maintaining the convention over configuration.

Adding custom attribute in all spring integration component

I need to add custom attribute to all spring integration component for example - need to add 'description' attribute to all inbound and outbound gateway.
Once we are able to add the custom attribute, I need to log the newly added attribute - 'description'.
Can you please suggest the approach for this.
Thanks
I've explained you how it isn't going to be possible because if Java nature. Now let's try to imagine what we could do on the matter. You can register some additional support beans in the application context and have their relationship to the integration components. For example through some id pattern or key-value store like simple HashMap. So, this way you always will be able to extract that additional information whenever you get access to the original component: or rely on its id or call the map registry.

Spring Integration XSD Validation FIlter

Please let me know if there is a way to override the default soap fault thrown by spring integration XSD validator. By default the fault generated is a client fault, But I want to change it to a custom fault code. Is AbstractSoapFaultDefinitionExceptionResolver.getFaultDefinition() the right place to do this?
The Spring Integration XSD Validator doesn't throw any Fault exceptions.
The Fault is a specific of the SOAP protocol and Spring WS wraps anyway service downstream Exception to the SOAP Fault using default strategy in face of:
org.springframework.ws.server.EndpointExceptionResolver=org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver,\
org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver
That is only way to customize it: implement your own EndpointExceptionResolver with desired logic.
Yes, perhaps AbstractSoapFaultDefinitionExceptionResolver.getFaultDefinition() is for your case.
We need to know more context on the matter.
From other side looks like we have talked with you about similar issue in other your questions...

Resources