Note that there are some explanatory texts on larger screens.

plurals
  1. POJava EE Web services: Naming conflict
    primarykey
    data
    text
    <p>I'm trying to create Web services proxies with wsimport, but I get an error because of a conflict. "Two declarations cause a collision in the ObjectFactory class."</p> <p>I've got two EJBs with Webservices deployed in one ear. Both have a method with the same name and parameters. Each WS has it's own targetnamespace.</p> <p>SEI of WS A:</p> <pre><code>@Local @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) @WebService(name = "AService", targetNamespace = "http://example.com/bla/a") public interface ASEI { @WebMethod @WebResult(name = "erpId") public Long getId(@WebParam(name = "gid") Long gid); } </code></pre> <p>WebService A:</p> <pre><code>@Stateless @WebService(serviceName = "AWebService", endpointInterface = "foo.endpointinterfaces.ASEI", targetNamespace = "http://example.com/bla/a") @BindingType(SOAPBinding.SOAP12HTTP_BINDING) public class AWebService implements ASEI { public Long getId(Long gid) { ... } } </code></pre> <p>SEI of WS B:</p> <pre><code>@Local @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) @WebService(name = "BService", targetNamespace = "http://example.com/bla/b") public interface BSEI { @WebMethod @WebResult(name = "erpId") public Long getId(@WebParam(name = "gid") Long gid); } </code></pre> <p>Webservice B:</p> <pre><code>@Stateless @WebService(serviceName = "BWebService", endpointInterface = "foo.endpointinterfaces.ASEI", targetNamespace = "http://example.com/bla/b") @BindingType(SOAPBinding.SOAP12HTTP_BINDING) public class BWebService implements BSEI { public Long getId(Long gid) { ... } } </code></pre> <p>When I deploy the application to my Weblogic server, the first Webservices imports the xml declarations of WS B and uses them for the message types. </p> <p>WSDL of A:</p> <pre><code>&lt;definitions targetNamespace="http://example.com/bla/a" name="AWebService" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://example.com/bla/a" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"&gt; &lt;types&gt; &lt;xsd:schema&gt; &lt;xsd:import namespace="http://example.com/bla/b" schemaLocation="http://192.168.178.105:7001/BWebService/AWebService?xsd=1"/&gt; &lt;/xsd:schema&gt; &lt;xsd:schema&gt; &lt;xsd:import namespace="http://example.com/bla/a" schemaLocation="http://192.168.178.105:7001/AWebService/AWebService?xsd=2"/&gt; &lt;/xsd:schema&gt; &lt;/types&gt; &lt;message name="getId"&gt; &lt;part name="parameters" element="tns:getId"/&gt; &lt;/message&gt; ... </code></pre> <p>XSD=1:</p> <pre><code>&lt;xs:schema version="1.0" targetNamespace="http://example.com/bla/b" xmlns:tns="http://example.com/bla/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:element name="getId" type="tns:getId"/&gt; &lt;xs:complexType name="getId"&gt; ... &lt;/xs:complexType&gt; ... </code></pre> <p>XSD=2:</p> <pre><code>&lt;xs:schema version="1.0" targetNamespace="http://example.com/bla/a" xmlns:tns="http://example.com/bla/a" xmlns:ns1="http://example.com/bla/b" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:import namespace="http://example.com/bla/b" schemaLocation="http://192.168.178.105:7001/AWebService/AWebService?xsd=1"/&gt; &lt;xs:element name="getId" nillable="true" type="ns1:getId"/&gt; ... </code></pre> <p>Is there a way that each WS defines it's own messagetypes? Or what else can I do, to create a WS proxy? (I don't want to separate them into different Java EE-Applications.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload