关于webservice遇到的一些问题
首先是怎么看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,array("Content-Type: text/xml;charset=utf-8")); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |