WSDL程序用法
发布时间:2023-09-25 11:47:08 所属栏目:教程 来源:
导读:假设这个服务提供了一个名称为sayHello的公共可用函数。 此函数需要单个字符串参数并返回单个字符串问候语。 例如,如果传递参数值为:world,那么服务函数sayHello将返回问候语:Hello,world!。
HelloService.
HelloService.
假设这个服务提供了一个名称为sayHello的公共可用函数。 此函数需要单个字符串参数并返回单个字符串问候语。 例如,如果传递参数值为:world,那么服务函数sayHello将返回问候语:Hello,world!。 HelloService.wsdl 文件的内容如下所示 - <deFinitions name = HelloService targetNamespace = http://www.examples.com/wsdl/HelloService.wsdl xmlns = http://schemas.xmlsoap.org/wsdl/ xmlns:soap = http://schemas.xmlsoap.org/wsdl/soap/ xmlns:tns = http://www.examples.com/wsdl/HelloService.wsdl xmlns:xsd = http://www.w3.org/2001/XMLSchema> <message name = SayHelloRequest> <part name = firstName type = xsd:string/> </message> <message name = SayHelloResponse> <part name = greeting type = xsd:string/> </message> <portType name = Hello_PortType> <operation name = sayHello> <input message = tns:SayHelloRequest/> <output message = tns:SayHelloResponse/> </operation> </portType> <binding name = Hello_Binding type = tns:Hello_PortType> <soap:binding style = rpc transport = http://schemas.xmlsoap.org/soap/http/> <operation name = sayHello> <soap:operation soapAction = sayHello/> <input> <soap:body encodingStyle = http://schemas.xmlsoap.org/soap/encoding/ namespace = urn:examples:helloservice use = encoded/> </input> <output> <soap:body encodingStyle = http://schemas.xmlsoap.org/soap/encoding/ namespace = urn:examples:helloservice use = encoded/> </output> </operation> </binding> <service name = Hello_Service> <documentation>WSDL File for HelloService</documentation> <port binding = tns:Hello_Binding name = Hello_Port> <soap:address location = http://www.examples.com/SayHello/ /> </port> </service> </deFinitions> 示例分析说明 定义 - HelloService 类型 - 使用内置数据类型,它们在XMLSchema中定义。 消息 - sayHelloRequest - firstName参数 sayHelloresponse - 问候的返回值 端口类型 - 由请求和响应服务组成的sayHello操作。 绑定 - 使用SOAP HTTP传输协议的方向。 (编辑:汽车网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |