Search code examples
c#javaweb-serviceswsdlwsimport

Error importing .net webservice with wsimport


I have a webservice which has been coded with c#. I want to use it in java app so i am trying to import it with wsimport with these parameters :

wsimport -keep -verbose -B-XautoNameResolution http://localhost:50358/WebService.asmx?wsdl

I have a class like this in my webservice :

 public class ReturnClass
{
    int _returnCode;
    DataTable _outputDataDT;


    public int ReturnCode { set { _returnCode = value; } get { return _returnCode; } }
    public DataTable OutputDataDT { set { _outputDataDT = value; } get { return _outputDataDT; } }

}

If i use a Datatable variable, wsimport returns this error :

[ERROR] Property "Any" is already defined. Use <jaxb:property> to resolve thi s conflict. line 16 of http://localhost:50358/WebService.asmx?wsdl

[ERROR] The following location is relevant to the above error line 17 of http://localhost:50358/WebService.asmx?wsdl

But if i remove datatable variable, it works, but i need datatable.

How can i fix this?


Solution

  • I have removed all Datatables, and used List<> instead of Datatable