wsimport를 사용하여 웹 서비스 프록시를 만들려고하지만 충돌 때문에 오류가 발생합니다. "두 가지 선언으로 인해 ObjectFactory 클래스에서 충돌이 발생합니다."Java EE 웹 서비스 : 명명 충돌
Webservices가있는 두 개의 EJB가 한쪽 귀에 있습니다. 둘 다 동일한 이름과 매개 변수를 가진 메소드를가집니다. 각 WS에는 자체 targetnamespace가 있습니다.
SEI의 WS A :
@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);
}
WebService에의 A :
@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) { ... }
}
SEI의 WS B :
@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);
}
를 Webservice의 B :
@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) { ... }
}
,536,913,632 10
응용 프로그램을 Weblogic 서버에 배포하면 첫 번째 웹 서비스는 WS B의 xml 선언을 가져 와서 메시지 유형으로 사용합니다. (A)의
WSDL :
<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/">
<types>
<xsd:schema>
<xsd:import namespace="http://example.com/bla/b" schemaLocation="http://192.168.178.105:7001/BWebService/AWebService?xsd=1"/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://example.com/bla/a" schemaLocation="http://192.168.178.105:7001/AWebService/AWebService?xsd=2"/>
</xsd:schema>
</types>
<message name="getId">
<part name="parameters" element="tns:getId"/>
</message>
...
XSD = 1 :
<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">
<xs:element name="getId" type="tns:getId"/>
<xs:complexType name="getId"> ... </xs:complexType>
...
XSD = 2 : 각 WS는 자신의 messagetypes의 정의하는 방법은
<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">
<xs:import namespace="http://example.com/bla/b" schemaLocation="http://192.168.178.105:7001/AWebService/AWebService?xsd=1"/>
<xs:element name="getId" nillable="true" type="ns1:getId"/>
...
있습니까? WS 프록시를 만들려면 어떻게해야합니까? (나는 그들을 다른 Java EE 응용 프로그램으로 분리하고 싶지 않습니다.)
내 대답은 아래에 도움이되는 경우 체크 표시를 클릭하고 정답으로 "동의"경우 크리스, 그것은 멋진 것입니다. 이렇게 할 때 Stackoverflow 평판 포인트를 얻습니다. – twindham