How can I configure a web service generated by WebLogic 10.3.6 using JAX-WS to include the object schema inside one single WSDL file declaration, instead of an import declaration?
Example code:
Interface
import javax.ejb.Local;
@Local
public interface CustomerBeanLocal {
public void updateCustomer(Customer customer);
}
Session Bean
import javax.ejb.Stateless;
import javax.jws.WebService;
@Stateless
@WebService
public class CustomerBean implements CustomerBeanLocal {
@Override
public void updateCustomer(Customer customer) {
// Do stuff...
}
}
WSDL Generated
We need the schema definitions not be imported with the <xsd:import>
tag in the example below, but to be declared inside the WSDL, which means all contract information is in a single WSDL file. No dependencies of other files.
<!-- ... -->
<types>
<xsd:schema>
<xsd:import namespace="http://mybeans/" schemaLocation="http://192.168.10.1:7001/CustomerBean/CustomerBeanService?xsd=1" />
</xsd:schema>
</types>
<!-- ... -->
The same code with WildFly includes the schema types inside the WSDL, and do not use the import feature. After some research I didn't find a way to configure the bean/server to do it in WebLogic (didn't find JAX-WS or WebLogic proprietary features to do it).
I understand the benefits of having an exported schema (reusability, etc) but it is a requirement of the project that the types must be declared inside of the WSDL, not imported.
Do you use the provided wsgen-tool for the wsdl-generation? If yes, there is a parameter called:
-inlineSchemas
which exactly does what you want.
"Used to inline schemas in a generated wsdl. Must be used in conjunction with the -wsdl option. " (Source: https://jax-ws.java.net/nonav/2.2.1/docs/wsgen.html)