I have written a java service class and create a web service based on that class (using eclipse Juno and Apache as the web server). The return type of my service method is ProductInfoOutput and which internally consists of ProductInfo and ResponseStatus. But when i see in the WSDL file i find two objects based on ResponseStatus. I don’t know why. Maybe at the time of development i did that but now ProductInfoOutput has only one instance of ResponseStatus. Can you please suggest how can i remove this extra object from WSDL. Below is the portion from WSDL.
<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>
Service class:
ProductInfoOutput productInfoOutput;
DatabaseQueries query;
public ProductInfoOutput getProductInfo(String barcode) {
productInfoOutput=new ProductInfoOutput();
query=new DatabaseQueries();
productInfoOutput=query.retrieveSingleProductByBarcode(barcode);
return productInfoOutput;
}
After two days of wastage i found the root cause of the problem. There is one server-config.wsdd file in the project which is automatically created when you first time create the web service and is not updated even if you update your business class. I removed manually the service from wsdd and recreated the web service from business class.