webservice是标准的,我用java写的webservice,用delphi调用,没有问题的

解决方案 »

  1.   

    infowain(infowain) ( ) 信誉:100  2006-01-25 10:58:00  得分: 0   webservice是标准的,我用java写的webservice,用delphi调用,没有问题的
    ==================================================================我用delphi调用哪种都可以,但是用webservice.htc就不行。不同的webservice生成的xml格式并不是一样的,你可以自己试以下是两个完全一样功能的webservice,他们生成的xml:
    1、.net生成的
     <?xml version="1.0" encoding="utf-8" ?> 
    - <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
    - <types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
    - <s:element name="ttt">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="x" type="s:string" /> 
      <s:element minOccurs="0" maxOccurs="1" name="y" type="s:string" /> 
      </s:sequence>
      </s:complexType>
      </s:element>
    - <s:element name="tttResponse">
    - <s:complexType>
    - <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="tttResult" type="s:string" /> 
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:schema>
      </types>
    - <message name="tttSoapIn">
      <part name="parameters" element="s0:ttt" /> 
      </message>
    - <message name="tttSoapOut">
      <part name="parameters" element="s0:tttResponse" /> 
      </message>
    - <portType name="Service1Soap">
    - <operation name="ttt">
      <input message="s0:tttSoapIn" /> 
      <output message="s0:tttSoapOut" /> 
      </operation>
      </portType>
    - <binding name="Service1Soap" type="s0:Service1Soap">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
    - <operation name="ttt">
      <soap:operation soapAction="http://tempuri.org/ttt" style="document" /> 
    - <input>
      <soap:body use="literal" /> 
      </input>
    - <output>
      <soap:body use="literal" /> 
      </output>
      </operation>
      </binding>
    - <service name="Service1">
    - <port name="Service1Soap" binding="s0:Service1Soap">
      <soap:address location="http://10.69.101.209/WebService3/Service1.asmx" /> 
      </port>
      </service>
      </definitions>2、java的axis生成的
      <?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions targetNamespace="http://10.69.101.209:8070/axis/services/TestRS" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://10.69.101.209:8070/axis/services/TestRS" xmlns:intf="http://10.69.101.209:8070/axis/services/TestRS" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <!-- 
    WSDL created by Apache Axis version: 1.3
    Built on Oct 05, 2005 (05:23:37 EDT)  --> 
    - <wsdl:message name="tttRequest">
      <wsdl:part name="sql" type="soapenc:string" /> 
      <wsdl:part name="x" type="soapenc:string" /> 
      </wsdl:message>
    - <wsdl:message name="tttResponse">
      <wsdl:part name="tttReturn" type="soapenc:string" /> 
      </wsdl:message>
    - <wsdl:portType name="TestRS">
    - <wsdl:operation name="ttt" parameterOrder="sql x">
      <wsdl:input message="impl:tttRequest" name="tttRequest" /> 
      <wsdl:output message="impl:tttResponse" name="tttResponse" /> 
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="TestRSSoapBinding" type="impl:TestRS">
      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <wsdl:operation name="ttt">
      <wsdlsoap:operation soapAction="" /> 
    - <wsdl:input name="tttRequest">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded" /> 
      </wsdl:input>
    - <wsdl:output name="tttResponse">
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.69.101.209:8070/axis/services/TestRS" use="encoded" /> 
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="TestRSService">
    - <wsdl:port binding="impl:TestRSSoapBinding" name="TestRS">
      <wsdlsoap:address location="http://localhost:8070/axis/services/TestRS" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>可以看出,.net的东西明显多出了一个<type>的类型,好象是一个表,把参数进行了很明确的定义,而java里就没有这个。 
      

  2.   

    1的webservice是document方式的
    2的webservice是普通的rpc方式的
    axis对这两种方式都支持
      

  3.   

    flyoversky(碧海) ( ) 信誉:100  2006-01-25 18:16:00  得分: 0  1的webservice是document方式的
    2的webservice是普通的rpc方式的
    axis对这两种方式都支持
    ====================================================
    那么如何修改axis,让他默认实用document方式呢?这样就可以用webservice.htc了
     
      

  4.   

    document和rpc区别比较大,不是稍作修改就行的
    我一般都是用axis的自带工具WSDL2Java
    把wsdl转为java文件
    axis的文档中有使用说明