您的位置:首页 > 其它

关于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"));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: