0
我編寫了一個java服務類,並基於該類(使用eclipse Juno和Apache作爲Web服務器)創建了一個Web服務。我的服務方法的返回類型是ProductInfoOutput,其內部由ProductInfo和ResponseStatus組成。但是當我在WSDL文件中看到時,我發現兩個基於ResponseStatus的對象。我不知道爲什麼。也許在開發時我這樣做了,但現在ProductInfoOutput只有一個ResponseStatus實例。你可以請建議如何從WSDL中刪除這個額外的對象。以下是來自WSDL的部分。作爲對Web服務的響應而映射到多個對象的單個對象
<complexType name="ProductInfoOutput">
<sequence>
<element name="productInfo" nillable="true" type="tns1:ProductInfo"/>
<element name="responseStatus" nillable="true" type="tns1:ResponseStatus"/>
<element name="response" nillable="true" type="tns1:ResponseStatus"/>
</sequence>
</complexType>
服務類:
ProductInfoOutput productInfoOutput;
DatabaseQueries query;
public ProductInfoOutput getProductInfo(String barcode) {
productInfoOutput=new ProductInfoOutput();
query=new DatabaseQueries();
productInfoOutput=query.retrieveSingleProductByBarcode(barcode);
return productInfoOutput;
}
請向我們展示映射到此的Java代碼。 – 2013-02-10 18:50:12
這是使用eclipse自動生成的。右鍵單擊服務類 - > Web服務 - >創建Web服務。在問題中更新了我的服務課程。 – 2013-02-10 18:52:55
任何建議約翰? – 2013-02-13 03:46:13