gSOAP的指令是用//开始的,一般放在头文件的开始位置,//和后面的指令之间不能有空格(//gosap是合法的,// gsoap是非法的)。
1.在头文件中指定web service的名臣:/gsoap namespace-prefix service name: service-name
2.指定WSDL的定义(默认情况下,WSDL的定义和1中的service name是一样的)://gsoap namespace-prefix service definitions: definitions-name
3.指定web service的文档://gsoap namespace-prefix service documentation: text
4.指定端口类型:
/gsoap namespace-prefix service portType: portType-name |
或者使用
//gsoap namespace-prefix service type: portType-name |
还可以使用WSDL2.0的格式定义
//gsoap namespace-prefix service interface: portType-name |
6.指定web service绑定的名称(默认情况下,端口绑定的定义和1中的service name是一样的)://gsoap namespace-prefix service binding: binding-name
7.指定传输协议,例如http://schemas.xmlsoap.org/soap/http,表示HTTP协议,并且HTTP协议是默认的。://gsoap namespace-prefix service transport: transport-URL
8.指定web service的位置(URL是一个可执行的web service的具体位置):
//gsoap namespace-prefix service location: URL |
或者使用
//gsoap namespace-prefix service endpoint: URL |
或者
//gsoap namespace-prefix service port: URL |
10.指定整个web service的文档或者文字编码方式://gsoap namespace-prefix service encoding: literal
当soap-env指定的编码方式和SOAP1.1或者SOAP1.2不同时,使用下面的指令://gsoap namespace-prefix service encoding: encoding-style
11.指定web service命名空间的URI://gsoap namespace-prefix service namespace: namespace-URI
12.