How to create a "true" contract first WS with wso2brs

88 Views Asked by At

We would like to create a contract first ws with wso2brs based on a certain xsd. The object model of the ws generated by the wso2brs must stay conform to this xsd. The strategy we've tried so far is generating java libraries based on the xsd, and then have the brs reason on the java libraries in the brs-project.

The problem is that the object model of the resulting ws exposed by the brs is no longer conform to that of the original xsd. It seems that something goes wrong in the "translation" xsd->javaobject->xml. The java object generators I've tried so far have been jaxb and wsdl2java.

What do we need to do in order to create a "true" contract first ws with wso2brs?

Best regards, Georg and Philip

1

There are 1 best solutions below

0
On

when creating a rules service to be deployed on WSO2 BRS that service should contain three components which are (1.)JAR containing the Java classes of facts and results, (2.)Drools file that defines the rules for the sample use case (.drl) and (3.) a rule service configuration (.rsl). So if you want to follow a contract first approach then that would only be to create the java classes, hense the drools file and service config should be part of the end rules service. So the approach you have tried can be the only way. In case if you are having issues in translation I think its better you use an IDE like Eclipse to do the translation for you http://theopentutorials.com/examples/java/jaxb/generate-java-class-from-xml-schema-in-eclipse-ide/