webservice是用delphi写的,如何在网页中调用,如javascript等
网上多数资料是delphi调用其它语语言写的webservice,但用web调用delphi的我没找到,哪位指点一下

解决方案 »

  1.   

    貌似一样的吧,只要知道公布的WSDL,其它都一样的.
    顺便说一句,Delphi的WebService可能会和其它语言存在不一致性,听前辈说开发时最好不要使用String类型的参数;
      

  2.   

    <?xml version="1.0" encoding="utf-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="ITestservice" 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="GetInt0Request"/>
      <message name="GetInt0Response">
        <part name="return" type="xs:int"/>
      </message>
      <message name="SayHelloTo1Request">
        <part name="AName" type="xs:string"/>
      </message>
      <message name="SayHelloTo1Response">    <part name="return" type="xs:string"/>
      </message>
      <portType name="ITest">
        <operation name="GetInt">
          <input message="tns:GetInt0Request"/>
          <output message="tns:GetInt0Response"/>
        </operation>
        <operation name="SayHelloTo">
          <input message="tns:SayHelloTo1Request"/>      <output message="tns:SayHelloTo1Response"/>
        </operation>
      </portType>
      <binding name="ITestbinding" type="tns:ITest">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetInt">
          <soap:operation soapAction="urn:TestIntf-ITest#GetInt" style="rpc"/>
          <input message="tns:GetInt0Request">
            <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TestIntf-ITest"/>      </input>
          <output message="tns:GetInt0Response">
            <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TestIntf-ITest"/>
          </output>
        </operation>
        <operation name="SayHelloTo">
          <soap:operation soapAction="urn:TestIntf-ITest#SayHelloTo" style="rpc"/>
          <input message="tns:SayHelloTo1Request">
            <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TestIntf-ITest"/>      </input>
          <output message="tns:SayHelloTo1Response">
            <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:TestIntf-ITest"/>
          </output>
        </operation>
      </binding>
      <service name="ITestservice">
        <port name="ITestPort" binding="tns:ITestbinding">
          <soap:address location="http://localhost/Project1.dll/soap/ITest"/>    </port>
      </service>
    </definitions>
      

  3.   

    好像最后多了两个空行,但从页面查看源代码就是这样,我用eclipse导入时是不成功的IWAB0399E Error in generating Java from WSDL:  org.xml.sax.SAXException: Fatal Error: URI=http://localhost/Project1.dll/wsdl/ITest/ Line=51: Content is not allowed in trailing section.
        org.xml.sax.SAXException: Fatal Error: URI=http://localhost/Project1.dll/wsdl/ITest/ Line=51: Content is not allowed in trailing section.
        at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    这是最上边的些错误,我也看不太明白,对java了解不多