2015-02-05 3 views
0

현재 javaEE에서 jax-ws 서비스를 개발 중입니다. 모든 것이 올바르게 작동하고 있으며, 나는 soapUI 테스트를 생성 할 수있었습니다. 하지만 URL에있는 wsdl에 액세스하면 복잡한 유형 정의가 표시되지 않습니다. 샘플 코드는 다음과 같이WSDL에 복합 유형 정의가 없습니다.

@WebService 
public interface AccountWs { 

    @WebMethod 
    ActionStatus createCustomer(@WebParam(name = "customer") CustomerDto postData); 

} 

@WebService(serviceName = "AccountWs", endpointInterface = "org.xxx.api.ws.AccountWs") 
public class AccountWsImpl implements AccountWs { 

    @Override 
    public ActionStatus createCustomer(CustomerDto postData) { 
    } 

} 

@XmlRootElement(name = "Customer") 
@XmlAccessorType(XmlAccessType.FIELD) 
public class CustomerDto { 

    private String code; 

} 

내 다른 질문은 생성 된 WSDL과 같은 열거 열거 같은 다른 속성에서 카디널리티를 추가하는 방법은? 위의 코드는 다음과 같이 생성되어야합니다.

<xsd:complexType name="CustomerDto"> 
    <xsd:sequence> 
     <xsd:element minOccurs="0" name="code" nillable="true" type="xsd:string"/> 
     ... 

답변

0

내 대답에 대한 답변을 찾았습니다. 복잡한 유형의 전체 xsd는 실제로 자동 생성되었지만 보통과 달리 wsdl 파일로 가져온 다른 파일에 작성되므로 my. 따라서 내 CustomerWS? wsdl 파일에는 import 문이 있습니다.

<wsdl:import location="http://xxx/Customer?wsdl=Customer.wsdl" namespace="http://ws.api.meveo.org/"> 
</wsdl:import> 

그리고 여기에는 완전한 서비스 정의가 들어 있습니다.