pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <tfoot id='51BqQ'></tfoot>

        <small id='51BqQ'></small><noframes id='51BqQ'>

        <i id='51BqQ'><tr id='51BqQ'><dt id='51BqQ'><q id='51BqQ'><span id='51BqQ'><b id='51BqQ'><form id='51BqQ'><ins id='51BqQ'></ins><ul id='51BqQ'></ul><sub id='51BqQ'></sub></form><legend id='51BqQ'></legend><bdo id='51BqQ'><pre id='51BqQ'><center id='51BqQ'></center></pre></bdo></b><th id='51BqQ'></th></span></q></dt></tr></i><div class="rp5t7jb" id='51BqQ'><tfoot id='51BqQ'></tfoot><dl id='51BqQ'><fieldset id='51BqQ'></fieldset></dl></div>

        <legend id='51BqQ'><style id='51BqQ'><dir id='51BqQ'><q id='51BqQ'></q></dir></style></legend>

          <bdo id='51BqQ'></bdo><ul id='51BqQ'></ul>

      1. SOAP-ERROR:編碼:違反編碼規(guī)則?

        SOAP-ERROR: Encoding: Violation of encoding rules?(SOAP-ERROR:編碼:違反編碼規(guī)則?)

        <small id='r6FeB'></small><noframes id='r6FeB'>

        <legend id='r6FeB'><style id='r6FeB'><dir id='r6FeB'><q id='r6FeB'></q></dir></style></legend>

            <tfoot id='r6FeB'></tfoot>
                <tbody id='r6FeB'></tbody>
            • <i id='r6FeB'><tr id='r6FeB'><dt id='r6FeB'><q id='r6FeB'><span id='r6FeB'><b id='r6FeB'><form id='r6FeB'><ins id='r6FeB'></ins><ul id='r6FeB'></ul><sub id='r6FeB'></sub></form><legend id='r6FeB'></legend><bdo id='r6FeB'><pre id='r6FeB'><center id='r6FeB'></center></pre></bdo></b><th id='r6FeB'></th></span></q></dt></tr></i><div class="plxdfdb" id='r6FeB'><tfoot id='r6FeB'></tfoot><dl id='r6FeB'><fieldset id='r6FeB'></fieldset></dl></div>
                <bdo id='r6FeB'></bdo><ul id='r6FeB'></ul>
                  本文介紹了SOAP-ERROR:編碼:違反編碼規(guī)則?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  伙計們,我被困住了,在過去的幾個小時里我的頭從桌子上摔下來.

                  Guys, I'm stuck, banging my head off the desk for the past few hours.

                  我正在嘗試使用一項服務(wù),并且我調(diào)用了其他 8 個函數(shù),它們本質(zhì)上與這個函數(shù)幾乎相同,但是這個函數(shù)會導(dǎo)致SOAP-ERROR: Encoding: Violation of encoding rules"錯誤.

                  I am trying to consume a service, and I have 8 other functions that I call that are almost IDENTICAL in nature to this one, but this one, results in a 'SOAP-ERROR: Encoding: Violation of encoding rules' error.

                  這里是函數(shù)調(diào)用(為安全起見省略了 wsdl):

                  Heres the function call (wsdl omitted for security):

                      function CanLoadProduct($data){
                  
                      $client = new SoapClient('wsdl-url');
                  
                      $params = array('username'   => $this->username,
                                      'password'  => $this->password,
                                      'prod'      => $data['productid'],
                                      'mdn'       => $data['mdn']);
                  
                      try {
                          $reply = $client->__soapCall("CanLoadProduct", $params);
                      } catch (Exception $e) {
                          echo 'Error: ',  $e->getMessage(), "
                  ";
                          print_r($params);
                          die();
                      }
                  
                      if( $reply['result'] == 1 ){
                          return TRUE;        // 1 = true
                      } else {
                          return FALSE;
                      }
                  
                  }
                  

                  好的,這個函數(shù),連接到一個webservice,需要的元素是:用戶名、密碼、prod、mdn,我將所有這 4 個作為 $params 數(shù)組的一部分提供.用戶名/通行證定義較早,并且工作正常,因為其他 8 個函數(shù)使用 Web 服務(wù)沒有任何問題.

                  Ok so this function, connects to a webservice, the required elements are: username, password, prod, mdn, all 4 of which I supply as part of the $params array. Username/Pass are defined earlier, and do work fine, as the other 8 functions consume the web service without any problems.

                  $data[] 數(shù)組(我傳遞給函數(shù)的)包含:$data['productid']$data['mdn']沒有使用其他任何東西.

                  The $data[] array (that I pass to the function), contains: $data['productid'] $data['mdn'] nothing else is used.

                  我得到了

                  SOAP-ERROR: Encoding: Violation of encoding rules
                  

                  出于某種無法解釋的原因,谷歌搜索這個錯誤讓我無處可去.還有人遇到這個嗎?運行 PHP 5.2.9-2.奇怪的是,這與這個 100% 有效的函數(shù)相同:

                  for some unexplained reason, and Googling this error gets me nowhere. Anyone else run into this? Running PHP 5.2.9-2. The strange thing is this is identical to this function which works 100%:

                      function GetPIN($productid){
                  
                      $client = new SoapClient('wsdl-url');
                  
                      $params = array('username'  => $this->username,
                                      'password'  => $this->password,
                                      'prod'      => $productid);
                  
                      try {
                          $reply = $client->__soapCall("GetPIN", $params);
                      } catch (Exception $e) {
                          echo 'Error: ',  $e->getMessage(), "
                  ";
                          die();
                      }
                          return $reply;
                  }
                  

                  這是 WSDL(應(yīng)該先發(fā)布這個):

                  Here is the WSDL (should have posted this first):

                  <?xml version="1.0" encoding="ISO-8859-1"?>
                  <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
                      xmlns:tns="ready:test" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
                      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
                      xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="ready:test">
                  <types>
                  <xsd:schema targetNamespace="ready:test"
                  >
                   <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
                   <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
                  </xsd:schema>
                  </types>
                  <message name="CanLoadProductRequest">
                    <part name="username" type="xsd:string" />
                    <part name="password" type="xsd:string" />
                    <part name="prod" type="xsd:string" />    
                    <part name="mdn" type="xsd:string" />
                    <part name="esn" type="xsd:string" /></message>
                  <message name="CanLoadProductResponse">
                    <part name="result" type="xsd:int" /></message>
                  <portType name="CanLoadProductPortType">
                    <operation name="CanLoadProduct">
                      <input message="tns:CanLoadProductRequest"/>
                      <output message="tns:CanLoadProductResponse"/>
                    </operation>
                  </portType>
                  
                  <binding name="CanLoadProductBinding" type="tns:CanLoadProductPortType">
                    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
                    <operation name="CanLoadProduct">
                      <soap:operation soapAction="{url-removed}" style="rpc"/>
                      <input>
                          <soap:body use="encoded" namespace="" 
                             encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                      </input>
                      <output>
                          <soap:body use="encoded" namespace="" 
                              encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                      </output>
                    </operation>
                  </binding>
                  <service name="CanLoadProduct">
                    <port name="CanLoadProductPort" binding="tns:CanLoadProductBinding">
                  
                      <soap:address location="{url-removed}"/>
                    </port>
                  </service>
                  </definitions>
                  

                  推薦答案

                  看起來您的某處類型不匹配,要么在組裝請求時(其中一個參數(shù)不是字符串類型),要么服務(wù)器返回其他內(nèi)容而不是 int(違反 WSDL 響應(yīng)定義,從而導(dǎo)致客戶端認為響應(yīng)無效,因為它期望其他內(nèi)容).

                  It looks like you have a type mismatch somewhere, either while assembling your request (one of the parameters is not of type string), or the server returns something other than an int (violating the WSDL response definition and thus causing the client to consider the response invalid, as it expects something else).

                  • 要測試第一種情況,請確保首先將所有參數(shù)轉(zhuǎn)換為字符串
                  • 要測試第二種情況,請創(chuàng)建您的 SoapClient,并將 trace 選項設(shè)置為 true,以便之后通過 $client->__getLastResponse() 從服務(wù)器獲得對實際 XML 答案的訪問(您也可以通過 __getLastRequest() 將其用于請求調(diào)試.
                  • To test the first case, ensure casting all parameters to string first
                  • To test the second case, create your SoapClient with the trace option set to true in order to gain access to the actual XML answer from the server via $client->__getLastResponse() afterwards (You can use this for request debugging also via __getLastRequest()).

                  一些額外的觀察/問題:

                  Some additional observations/questions:

                  • 根據(jù)已發(fā)布的 WSDL,CanLoadProductRequest"具有第五個參數(shù)esn",您不會在函數(shù)調(diào)用中提供該參數(shù).
                  • 您使用 $client->__soapCall("CanLoadProduct", $params) 而不是 $client->CanLoadProduct($username, $password, etc.) 的任何原因?(第一個版本是一個較低級別的變體,旨在用于非 WSDL 場景.第二個版本可能會為您提供更詳細的錯誤/異常)
                  • 您能否通過其他方式測試對 CanLoadProductRequest 的 SOAP 調(diào)用?錯誤可能在服務(wù)器端,試圖返回不符合 WSDL 定義的結(jié)果類型.
                  • According to the posted WSDL, the 'CanLoadProductRequest' has a fifth param 'esn', which you do not supply in your function call.
                  • Any reason why you use $client->__soapCall("CanLoadProduct", $params) instead of $client->CanLoadProduct($username, $password, etc.)? (The first version is a lower level variation which is intended to be used for non_WSDL scenarios. The second version might give you a more detailed error/exception)
                  • Can you test the SOAP Call to CanLoadProductRequest by some other means? The error could be on the server side, trying to return a result type that does not fit the WSDL definition.

                  這篇關(guān)于SOAP-ERROR:編碼:違反編碼規(guī)則?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  enable SOAP on PHP(在 PHP 上啟用 SOAP)
                  Get received XML from PHP SOAP Server(從 PHP SOAP 服務(wù)器獲取接收到的 XML)
                  not a valid AllXsd value(不是有效的 AllXsd 值)
                  PHP SoapClient: SoapFault exception Could not connect to host(PHP SoapClient:SoapFault 異常無法連接到主機)
                  Implementation of P_SHA1 algorithm in PHP(PHP中P_SHA1算法的實現(xiàn))
                  Sending a byte array from PHP to WCF(將字節(jié)數(shù)組從 PHP 發(fā)送到 WCF)

                  <small id='Cj1ON'></small><noframes id='Cj1ON'>

                    <bdo id='Cj1ON'></bdo><ul id='Cj1ON'></ul>

                      <legend id='Cj1ON'><style id='Cj1ON'><dir id='Cj1ON'><q id='Cj1ON'></q></dir></style></legend>
                    1. <i id='Cj1ON'><tr id='Cj1ON'><dt id='Cj1ON'><q id='Cj1ON'><span id='Cj1ON'><b id='Cj1ON'><form id='Cj1ON'><ins id='Cj1ON'></ins><ul id='Cj1ON'></ul><sub id='Cj1ON'></sub></form><legend id='Cj1ON'></legend><bdo id='Cj1ON'><pre id='Cj1ON'><center id='Cj1ON'></center></pre></bdo></b><th id='Cj1ON'></th></span></q></dt></tr></i><div class="5tntbvx" id='Cj1ON'><tfoot id='Cj1ON'></tfoot><dl id='Cj1ON'><fieldset id='Cj1ON'></fieldset></dl></div>
                        <tbody id='Cj1ON'></tbody>
                        <tfoot id='Cj1ON'></tfoot>

                            主站蜘蛛池模板: 美名宝起名网-在线宝宝、公司、起名平台 | 生物除臭剂-除味剂-植物-污水除臭剂厂家-携葵环保有限公司 | 锻造液压机,粉末冶金,拉伸,坩埚成型液压机定制生产厂家-山东威力重工官方网站 | 网优资讯-为循环资源、大宗商品、工业服务提供资讯与行情分析的数据服务平台 | 焊接减速机箱体,减速机箱体加工-淄博博山泽坤机械厂 | 飞歌臭氧发生器厂家_水处理臭氧发生器_十大臭氧消毒机品牌 | 厂房出租-厂房规划-食品技术-厂房设计-厂房装修-建筑施工-设备供应-设备求购-龙爪豆食品行业平台 | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | 七维官网-水性工业漆_轨道交通涂料_钢结构漆 | 防爆大气采样器-防爆粉尘采样器-金属粉尘及其化合物采样器-首页|盐城银河科技有限公司 | LCD3D打印机|教育|桌面|光固化|FDM3D打印机|3D打印设备-广州造维科技有限公司 | 泰国试管婴儿_泰国第三代试管婴儿费用|成功率|医院—新生代海外医疗 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛婚外情取证-青岛王军侦探事务所 | 喷涂流水线,涂装流水线,喷漆流水线-山东天意设备科技有限公司 | 耳模扫描仪-定制耳机设计软件-DLP打印机-asiga打印机-fitshape「飞特西普」 | 环比机械| PVC地板|PVC塑胶地板|PVC地板厂家|地板胶|防静电地板-无锡腾方装饰材料有限公司-咨询热线:4008-798-128 | 干洗加盟网-洗衣店品牌排行-干洗设备价格-干洗连锁加盟指南 | 玻璃钢板-玻璃钢防腐瓦-玻璃钢材料-广东壹诺 | 伊卡洛斯软装首页-电动窗帘,别墅窗帘,定制窗帘,江浙沪1000+别墅窗帘案例 | 昆明化妆培训-纹绣美甲-美容美牙培训-昆明博澜培训学校 | 水质传感器_水质监测站_雨量监测站_水文监测站-山东水境传感科技有限公司 | 东莞市海宝机械有限公司-不锈钢分选机-硅胶橡胶-生活垃圾-涡电流-静电-金属-矿石分选机 | 铝箔袋,铝箔袋厂家,东莞铝箔袋,防静电铝箔袋,防静电屏蔽袋,防静电真空袋,真空袋-东莞铭晋让您的产品与众不同 | 高硼硅玻璃|水位计玻璃板|光学三棱镜-邯郸奥维玻璃科技有限公司 高温高压釜(氢化反应釜)百科 | 机床导轨_导轨板_滚轮导轨-上海旻佑精密机械有限公司 | 氟塑料磁力泵-不锈钢离心泵-耐腐蚀化工泵厂家「皖金泵阀」 | 老房子翻新装修,旧房墙面翻新,房屋防水补漏,厨房卫生间改造,室内装潢装修公司 - 一修房屋快修官网 | 北京西风东韵品牌与包装设计公司,创造视觉销售力! | 电机修理_二手电机专家-河北豫通机电设备有限公司(原石家庄冀华高压电机维修中心) | 手术室净化厂家_成都实验室装修公司_无尘车间施工单位_洁净室工程建设团队-四川华锐16年行业经验 | 制冷采购电子商务平台——制冷大市场 | 深圳标识制作公司-标识标牌厂家-深圳广告标识制作-玟璟广告-深圳市玟璟广告有限公司 | 成都装修公司-成都装修设计公司推荐-成都朗煜装饰公司 | 精密五金冲压件_深圳五金冲压厂_钣金加工厂_五金模具加工-诚瑞丰科技股份有限公司 | 东莞爱加真空科技有限公司-进口真空镀膜机|真空镀膜设备|Polycold维修厂家 | PVC地板|PVC塑胶地板|PVC地板厂家|地板胶|防静电地板-无锡腾方装饰材料有限公司-咨询热线:4008-798-128 | 维泰克Veertek-锂电池微短路检测_锂电池腐蚀检测_锂电池漏液检测 | 浙江建筑资质代办_二级房建_市政_电力_安许_劳务资质办理公司 | 三氯异氰尿酸-二氯-三氯-二氯异氰尿酸钠-优氯净-强氯精-消毒片-济南中北_优氯净厂家 | 澳洁干洗店加盟-洗衣店干洗连锁「澳洁干洗免费一对一贴心服务」 干洗加盟网-洗衣店品牌排行-干洗设备价格-干洗连锁加盟指南 |