【问题标题】:Importing Delphi Web Services into Java将 Delphi Web 服务导入 Java
【发布时间】:2008-10-09 12:01:56
【问题描述】:

我有一个在 Delphi 中构建的 Web 服务器,我正在尝试通过 Eclipse 向导创建一个 Web 服务客户端来在 Java 上使用它的 Web 服务(我正在使用 Eclipse IDE)。 Web 服务资源管理器识别 WSDL 文件,但在尝试创建客户端时,向导说存在“意外属性”并且没有创建任何文件。

这是我的 wsdl 文件(我的 Delphi Web Server 发布的那个)。

<?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 说两者中的“消息”属性:

definicions.binding.operation.input  
definitions.binding.operation.output

出乎意料。我知道这是多余的,因为这些已经定义在

definitions.portType.operation.input  
definitions.portType.operation.output

但是,我仍然无法导入网络服务。

我的 Java 应用程序将在 JBoss 4.2 服务器上运行,但我认为将客户端创建为 Java 实用程序项目会更容易(因为它只创建一个项目而不是两个)。

那么,关于如何让 Eclipse 忽略这些属性,或者 Delphi 不发布它们的任何想法?

【问题讨论】:

    标签: java eclipse web-services delphi


    【解决方案1】:

    从 apache 尝试 Axis2,查看 wsdl2java 命令为您的 Delphi Web 服务生成 java 客户端。如果您使用 Ant 进行构建,则需要生成客户端。

    http://ws.apache.org/axis2/1_3/userguide-creatingclients.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-09
      • 1970-01-01
      • 2011-04-24
      • 2015-02-08
      • 1970-01-01
      相关资源
      最近更新 更多