关于webservice遇到的一些问题
2016-12-13 13:37
337 查看
首先是怎么看wsdl的xml格式理解里面的参数
<types>
<element name="callInfo" type="xsd:string"/ add方法参数类型>
</element>
</types>
<message name=”addRequest” add方法参数>
<part name=”” type=””/>
</message>
<message name=”addResponse” add方法返回>
<part name=”” type=””/>
</message>
<portType name=”” 操作方法列表>
<operation neme=”add”>
<input message=”tns:方法元素”/>
<output message=”tns:返回相应”/>
</operation>
</portType>
<binding neme=”购物车” type=”tns:” 为服务绑定方法操作>
</binding>
<service name=”服务的名字:商城”>
<port name=”购物车” binding=”tns:服务于购物车”>
<soap:address location=”http://localhost/index.php”
路径>
</port>
</sevice>
soap遇到最多的问题就是head头产生的,以下是遇到的一些问题
ns1:Client.NoSOAPAction no SOAPAction header!
头文件少了soapAction,这里采用curl方式请求,不知道Action没关系,在
curl_setopt($curl, CURLOPT_HTTPHEADER, array("SOAPAction: ''"));
头文件也可以加默认参数
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml;charset=utf-8"));
<types>
<element name="callInfo" type="xsd:string"/ add方法参数类型>
</element>
</types>
<message name=”addRequest” add方法参数>
<part name=”” type=””/>
</message>
<message name=”addResponse” add方法返回>
<part name=”” type=””/>
</message>
<portType name=”” 操作方法列表>
<operation neme=”add”>
<input message=”tns:方法元素”/>
<output message=”tns:返回相应”/>
</operation>
</portType>
<binding neme=”购物车” type=”tns:” 为服务绑定方法操作>
</binding>
<service name=”服务的名字:商城”>
<port name=”购物车” binding=”tns:服务于购物车”>
<soap:address location=”http://localhost/index.php”
路径>
</port>
</sevice>
soap遇到最多的问题就是head头产生的,以下是遇到的一些问题
ns1:Client.NoSOAPAction no SOAPAction header!
头文件少了soapAction,这里采用curl方式请求,不知道Action没关系,在
curl_setopt($curl, CURLOPT_HTTPHEADER, array("SOAPAction: ''"));
头文件也可以加默认参数
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml;charset=utf-8"));
相关文章推荐
- 杨辉三角
- 多线程学习笔记
- jquery获取select选中值以及清除选中状态
- 关于 z-index的问题 和 display动画效果
- VM开启问题
- Access 执行查询时,抛出“标准表达式中数据类型不匹配”的错误
- (转)网上总结的 NIPS 201 参会感受
- HTTPS演变小图
- 2.8 Swift区间运算符
- 使用XtraBackup 备份MySQL数据库
- 【转】Spring源码解读
- JavaBean
- Windows之如何让Windows2012和Windows2008多用户同时远程
- 认识gradle
- 数据结构实验之排序七:选课名单
- spooler API研究——获取所有本地和网络打印机
- Java 1.5, 1.6, 1.7, 1.8的区别
- WCF、MongoDB
- 盘点最受父母欢迎的十大儿童APP
- C# LINQ查询操作符