2
這是我可以生成的問題的最簡化版本。如何在intelij想法中生成wsdl客戶端
我有一個Web服務:
@WebService()
public class Service {
@WebMethod
public IsLoggedInResponse IsLoggedIn() {
return new IsLoggedInResponse();
}
}
這是我返回類:
@XmlRootElement
public class IsLoggedInResponse {
private boolean isLoggedIn;
public IsLoggedInResponse(boolean isLoggedIn) {
this.isLoggedIn = isLoggedIn;
}
public IsLoggedInResponse() {
// TODO Auto-generated constructor stub
}
@XmlElement
public boolean isLoggedIn() {
return isLoggedIn;
}
public void setLoggedIn(boolean isLoggedIn) {
this.isLoggedIn = isLoggedIn;
}
}
這是對webserivce按右鍵,並生成從Java WSDL代碼時產生的XSD:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" targetNamespace="http://webservice.pubsale.com/" xmlns:tns="http://webservice.pubsale.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="IsLoggedIn" type="tns:IsLoggedIn"/>
<xs:element name="IsLoggedInResponse" type="tns:IsLoggedInResponse"/>
<xs:element name="IsLoggedInResponse" type="tns:IsLoggedInResponse"/>
<xs:complexType name="IsLoggedIn">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="IsLoggedInResponse">
<xs:sequence>
<xs:element name="return" type="tns:isLoggedInResponse" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="isLoggedInResponse">
<xs:sequence>
<xs:element name="loggedIn" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
notice isLoggedInResponse創建兩次。爲什麼?我該如何阻止它?
它似乎是由具有'IsLoggedInResponse'一個重載的構造引起的。你想要兩個構造函數嗎? –