RT。我们服务端用java开发。客户端用dephi开发 
现在需要在soap header中传递验证信息, 
但是客户端需要我们的wsdl文件中有header信息, 
如何能将header写入到wsdl文件中呢?

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主截止到2008-06-20 13:53:04的汇总数据:
    注册日期:2007-11-16
    上次登录:2008-6-20
    发帖数:5                  发帖分:180                
    结贴数:0                  结贴分:0                  
    结贴率:0.00 %        结分率:0.00 %        
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    参考如下定义 Header_Auth.xsd 自定的XSD 文件<?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.opentravel.org/OTA/2003/05" targetNamespace="http://www.opentravel.org/OTA/2003/05">
    <wsdl:types>
    <xs:schema>
    <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="Header_Auth.xsd"/>
    <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="OTA_HotelAvailNotifRQ.xsd"/>
    <xs:import namespace="http://www.opentravel.org/OTA/2003/05" schemaLocation="OTA_HotelAvailNotifRS.xsd"/>
    </xs:schema>
    </wsdl:types>
    <wsdl:message name="AuthHeaderRequest">
    <wsdl:part name="auth_header_info" element="tns:Authentication"/>
    </wsdl:message>
    <wsdl:message name="AvailNotifMessageRequest">
    <wsdl:part name="OTA_HotelAvailNotifRQ" element="tns:OTA_HotelAvailNotifRQ"/>
    </wsdl:message>
    <wsdl:message name="AvailNotifMessageResponse">
    <wsdl:part name="OTA_HotelAvailNotifRS" element="tns:OTA_HotelAvailNotifRS"/>
    </wsdl:message>
    <wsdl:portType name="AvailNotifPortType">
    <wsdl:operation name="OTA_HotelAvailNotifRQ">
    <wsdl:input name="AvailNotifMessageRequest" message="tns:AvailNotifMessageRequest"/>
    <wsdl:output name="AvailNotifMessageResponse" message="tns:AvailNotifMessageResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="OTA_HotelAvailNotifService" type="tns:AvailNotifPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="OTA_HotelAvailNotifRQ">
    <soap:operation soapAction="http://www.opentravel.org/OTA/2003/05/OTA_HotelAvailNotifRQ" style="document"/>
    <wsdl:input>
    <soap:body use="literal"/>
    <soap:header message="tns:AuthHeaderRequest" part="auth_header_info" use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="OTA_HotelAvailNotifService">
    <wsdl:port name="AvailNotifPort" binding="tns:OTA_HotelAvailNotifService">
    <soap:address location="http://[YOUR WEB SERVICE URL END POINT]"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>Header_Auth.xsd<?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.opentravel.org/OTA/2003/05" elementFormDefault="qualified">
    <!-- Authentication header -->
    <xs:element name="Authentication">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="UserOrgID" type="xs:string"/>
    <xs:element name="UserID" type="xs:string"/>
    <xs:element name="UserPSW" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>

    </xs:schema>
      

  3.   

     <soap:header message="tns:AuthHeaderRequest" part="auth_header_info" use="literal"/>就想知道这句话。这么加进去的。。