[Design of JBoss ESB] - WS Endpoints :: WSDL rendered dynamically
by andretemple
Hi all,
I've checkout the jbossesb-4.4.GACP from SVN and took a look in publish_as_webservice sample.
After some tests I realized that when I import some xsd into main xsd something goes wrong. Exploring the generated artifacts from JBossAS I saw that imported xsd was not copied into deployed services (tmp directory) and here is the problem.
So I got the source code from JBoss4ESBDeployer and did a few changes.
Below is the snippets from xsd and source code.
I think it's a good idea to include something like this in JBossESB new release, since we always have a complex xsd structure and could expose it as a service in the bus.
What do you think?
tks.
request.xsd
| <xs:schema version='1.0' targetNamespace="http://www.jboss.org/sayHi"
| xmlns:x1='http://www.jboss.org/sayHi'
| xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault="qualified"
| xmlns:Q1="http://www.jboss.org/standard">
|
| <xs:import schemaLocation="standard.xsd" namespace="http://www.jboss.org/standard"></xs:import>
| <xs:include schemaLocation="standard.xsd"></xs:include>
|
| <xs:element name="sayHi" type="x1:sayHi"/>
| <xs:complexType name="sayHi">
| <xs:sequence>
| <xs:element name="person" type="Q1:person" minOccurs="1"></xs:element>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
|
standard.xsd
| <xs:schema version='1.0' targetNamespace="http://www.jboss.org/standard"
| xmlns:tns='http://www.jboss.org/standard' xmlns:xs='http://www.w3.org/2001/XMLSchema'
| elementFormDefault="qualified">
|
| <xs:complexType name='person'>
| <xs:sequence>
| <xs:element name='name' type='xs:string' />
| <xs:element name='surname' type='xs:string' />
| </xs:sequence>
| </xs:complexType>
|
| </xs:schema>
org.jboss.soa.esb.listeners.config.JBoss4ESBDeployer.java
| public class JBoss4ESBDeployer extends SubDeployerSupport
| implements SubDeployer, JBoss4ESBDeployerMBean
|
| ...
|
| public void init(DeploymentInfo di) throws DeploymentException {
| ...
| try
| {
| Thread.currentThread().setContextClassLoader(di.localCl) ;
| warFile = createWebserviceWars(di, jbossEsb, deploymentName, publishers) ;
| }
| finally
| {
| Thread.currentThread().setContextClassLoader(origCL) ;
| }
|
| ...
| }
|
| private File createWebserviceWars(final DeploymentInfo di, final Jbossesb jbossEsb, final String deploymentName, final List<ContractReferencePublisher> publishers) throws DeploymentException {
| ...
| for(Service service: endpointServices)
| {
| final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(service) ;
| final String wsdl = ESBContractGenerator.generateWSDL(service, serviceInfo) ;
| addFile(zos, serviceInfo.getWSDLFileName(), wsdl) ;
|
| ZipFile file = new ZipFile(di.url.getFile());
| Enumeration xsdFiles = file.entries();
| if (xsdFiles != null) {
| while (xsdFiles.hasMoreElements()) {
| ZipEntry xsdFile = (ZipEntry) xsdFiles.nextElement();
| if (xsdFile.getName().indexOf("xsd") > 0) {
| String xsdFileName = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_')
| + "/" + xsdFile.getName();
| addFile(zos, xsdFileName, getBytesFromFile(
| di.localCl.getResourceAsStream(xsdFile.getName()), xsdFile.getSize(), xsdFile.getName()));
| }
| }
| }
| ...
| }
|
| private byte[] getBytesFromFile(InputStream is, long length, String fileName) throws IOException {
| if (length > Integer.MAX_VALUE) {
| // File is too large
| }
| // Create the byte array to hold the data
| byte[] bytes = new byte[(int)length];
|
| // Read in the bytes
| int offset = 0;
| int numRead = 0;
| while (offset < bytes.length
| && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
| offset += numRead;
| }
|
| // Ensure all the bytes have been read in
| if (offset < bytes.length) {
| throw new IOException("Could not completely read file "+ fileName);
| }
|
| // Close the input stream and return bytes
| is.close();
| return bytes;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184285#4184285
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184285
15 years, 12 months
[Design of JBoss jBPM] - Re: Future of jBPM???
by KrisVerlaenen
anonymous wrote : I regret that the drools guys put so much effort in duplication. We have had a couple of meetings on this topic. But we couldn't come to a joint PVM strategy yet. Hopefully that will still happen.
The Drools team has always been asking for collaboration with the jBPM team from the start. We presented specific recommendations on how to improve the design of a the current jBPM PVM model in several areas, more than a year ago. We also suggested broadening the scope to make it not process-centric but knowledge-centric, allowing unification and a tight integration (and still loosely-coupled as well of course) between rules and processes.
What you call duplication (and we consider improvement !) was the only option to move forward at that point. The Drools team will continue to actively add new exciting features to the Drools Flow engine. We believe that at this point we already offer most of the features supported by the jBPM engine (and much more), using a superior design.
But we hope the jBPM team would reconsider collaborating with us and we are still open for any type of discussion and collaboration, as it'll allow us to combine our strengths and resources in the most efficient way ...
anonymous wrote : One of the main things I don't see [in Drools Flow] yet is the whole persistence and support of long running processes.
Drools Flow does offer persistence of your runtime process state, by providing JPA-based persistence of process instances, adding support for long-living processes as well.
Kris
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184282#4184282
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184282
15 years, 12 months
[Design of EJB 3.0] - Re: Default JNDI naming scheme in EJB3.0 and possible confli
by jaikiran
"jaikiran" wrote :
|
| No exceptions in JBoss AS 4.2.3 GA.
|
| Going by the logs looks like something to do with the org.jboss.ejb3.stateless.BaseStatelessProxyFactory which is doing with binding in 4.2.3 GA. Let me setup the 4.2.3 source code to dig more into this.
Found this in org.jboss.ejb3.stateless.BaseStatelessProxyFactory
protected void bindProxy(Object proxy) throws NamingException
| {
| try
| {
| log.debug("Binding proxy for " + getContainer().getEjbName() + " in JNDI at " + jndiName);
| Util.rebind(getContainer().getInitialContext(), jndiName, proxy);
| } catch (NamingException e)
| {
| NamingException namingException = new NamingException("Could not bind stateless proxy with ejb name " + getContainer().getEjbName() + " into JNDI under jndiName: " + getContainer().getInitialContext().getNameInNamespace() + "/" + jndiName);
| namingException.setRootCause(e);
| throw namingException;
| }
| }
For some reason Util.rebind is being used instead of Util.bind. That explains why the exception is not thrown.
Do you think it was intentional to use rebind for some reason? If not, do you want me to create a JIRA to fix this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184131#4184131
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184131
15 years, 12 months