wsdl报文总体概述
示例wsdl报文

标签说明


wsdl:definition

wsdl:types
我们java定义的服务接口中某方法的输入参数和返回值

使用注解修改修改默认参数名
1
2
3
4
5
6
7
8
9
10
11
|
package com.eh.webservice.demo;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
@WebService
public interface HelloService {
@WebResult(name = "resultX") String sayHello(@WebParam(name = "whoX") String who);
}
|
wsdl

请求
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
POST /cxf
Content-Type: text/xml; charset=utf-8
Accept: */*
Cache-Control: no-cache
Host: localhost:9999
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:sayHello xmlns:ns2="http://demo.webservice.eh.com/">
<whoX>徐达</whoX>
</ns2:sayHello>
</soap:Body>
</soap:Envelope>
|
返回
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
POST http://localhost:9999/cxf
HTTP/1.1 200 OK
Date: Mon, 09 Nov 2020 10:41:29 GMT
Content-Type: text/xml;charset=utf-8
Content-Length: 229
Server: Jetty(9.4.31.v20200723)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:sayHelloResponse xmlns:ns2="http://demo.webservice.eh.com/">
<resultX>hello, 徐达</resultX>
</ns2:sayHelloResponse>
</soap:Body>
</soap:Envelope>
|
wsdl:message

wsdl:portType

wsdl:binding

wsdl:service

总结
