• http://localhost:8080/hello?wsdl


    <definitions
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
        xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tns="http://impl.service.zno.cn/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://impl.service.zno.cn/"
        name="HelloServiceImplService">
        <types>
            <xsd:schema>
                <xsd:import namespace="http://impl.service.zno.cn/" schemaLocation="http://localhost:8080/hello?xsd=1" />
            </xsd:schema>
        </types>
        <message name="say">
            <part name="parameters" element="tns:say" />
        </message>
        <message name="sayResponse">
            <part name="parameters" element="tns:sayResponse" />
        </message>
        <portType name="HelloService1">
            <operation name="say">
                <input wsam:Action="http://impl.service.zno.cn/HelloService1/sayRequest" message="tns:say" />
                <output wsam:Action="http://impl.service.zno.cn/HelloService1/sayResponse" message="tns:sayResponse" />
            </operation>
        </portType>
        <binding name="HelloService1PortBinding" type="tns:HelloService1">
            <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
            <operation name="say">
                <soap:operation soapAction="" />
                <input>
                    <soap:body use="literal" />
                </input>
                <output>
                    <soap:body use="literal" />
                </output>
            </operation>
        </binding>
        <service name="HelloServiceImplService">
            <port name="HelloService1Port" binding="tns:HelloService1PortBinding">
                <soap:address location="http://localhost:8080/hello" />
            </port>
        </service>
    </definitions>
    这里有一个service 叫HelloServiceImplService
    它有一个port 叫HelloService1Port
    这个port的地址是location
    这个port绑定的类是HelloService1
    这个类有一个方法say

    整体阅读应该是由下往上看
    tns 为 target name space
    // String namespaceURI, String localPart
    QName qname = new QName("http://impl.service.zno.cn/","HelloServiceImplService");
            
    Service service = Service.create(new URL("http://localhost:8080/hello?wsdl"),qname);
    HelloService1 serv = service.getPort(HelloService1.class);
    serv.say("hi");


  • 相关阅读:
    让.Net程序支持命令行启动
    拒绝卡顿——在WPF中使用多线程更新UI
    比NPOI更好用的Excel操作库——EPPlus
    利用Visual Studio Natvis 框架简化C++的变量调试工作
    使用LibZ合并.Net程序集,支持WPF
    SONY新的圈铁耳机
    找回VisualStudio异常设置中丢失的“用户未处理的(User-unhandled)”列
    去除下载文件属性中烦人的锁定状态
    POJ 3347 Kadj Squares
    POJ 1696 Space Ant(极角排序)
  • 原文地址:https://www.cnblogs.com/zno2/p/4651659.html
Copyright © 2020-2023  润新知