У меня есть веб-сервер, построенный на Delphi, и я пытаюсь использовать его веб-службы на Java (я использую Eclipse IDE), создав клиент веб-службы с помощью мастера Eclipse. Обозреватель веб-служб распознает файл WSDL, но при попытке создать клиента мастер сообщает о наличии «неожиданного атрибута» и не создает никаких файлов.
Это мой файл wsdl (тот, который публикует мой веб-сервер Delphi).
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="ITSOAPWebServiceservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
<message name="WebMethod0Request">
<part name="Document" type="xs:string"/>
</message>
<message name="WebMethod0Response">
<part name="return" type="xs:boolean"/>
</message>
<portType name="ITSOAPWebService">
<operation name="WebMethod">
<input message="tns:WebMethod0Request"/>
<output message="tns:WebMethod0Response"/>
</operation>
</portType>
<binding name="ITSOAPWebServicebinding" type="tns:ITSOAPWebService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="WebMethod">
<soap:operation soapAction="urn:TWebServiceIntf1-ITSOAPWebService#WebMethod" style="rpc"/>
<input message="tns:WebMethod0Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TWebServiceIntf1-ITSOAPWebService"/>
</input>
<output message="tns:WebMethod0Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TWebServiceIntf1-ITSOAPWebService"/>
</output>
</operation>
</binding>
<service name="ITSOAPWebServiceservice">
<port name="ITSOAPWebServicePort" binding="tns:ITSOAPWebServicebinding">
<soap:address location="http://localhost:1024/soap/ITSOAPWebService"/>
</port>
</service>
</definitions>
Теперь Eclipse говорит, что атрибут "message" в обоих:
definicions.binding.operation.input
definitions.binding.operation.output
неожиданно. Я знаю, что это избыточно, поскольку они уже определены в
definitions.portType.operation.input
definitions.portType.operation.output
но все же я не могу импортировать веб-службу.
Мое приложение Java будет работать на сервере JBoss 4.2, но я подумал, что будет проще создать клиент как проект утилиты Java (поскольку он создает только один проект вместо двух).
Итак, есть идеи, как заставить Eclipse игнорировать эти атрибуты или Delphi не публиковать их?