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

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

    <i id='WRtcJ'><tr id='WRtcJ'><dt id='WRtcJ'><q id='WRtcJ'><span id='WRtcJ'><b id='WRtcJ'><form id='WRtcJ'><ins id='WRtcJ'></ins><ul id='WRtcJ'></ul><sub id='WRtcJ'></sub></form><legend id='WRtcJ'></legend><bdo id='WRtcJ'><pre id='WRtcJ'><center id='WRtcJ'></center></pre></bdo></b><th id='WRtcJ'></th></span></q></dt></tr></i><div class="mk0c0mu" id='WRtcJ'><tfoot id='WRtcJ'></tfoot><dl id='WRtcJ'><fieldset id='WRtcJ'></fieldset></dl></div>
  1. <legend id='WRtcJ'><style id='WRtcJ'><dir id='WRtcJ'><q id='WRtcJ'></q></dir></style></legend>
    1. <small id='WRtcJ'></small><noframes id='WRtcJ'>

    2. <tfoot id='WRtcJ'></tfoot>
    3. Webservice SOAP 請求 - 發送的數據類型錯誤

      Webservice SOAP request - Wrong type of data sent(Webservice SOAP 請求 - 發送的數據類型錯誤)
        <legend id='fWaf9'><style id='fWaf9'><dir id='fWaf9'><q id='fWaf9'></q></dir></style></legend>
      1. <tfoot id='fWaf9'></tfoot>

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

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

                本文介紹了Webservice SOAP 請求 - 發送的數據類型錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                上下文/我想要的:

                我在使用 SOAP 調用 Web 服務時遇到問題.這是我想調用的 WS 的相關部分的圖像:

                (我自愿隱藏命名空間部分,這里不相關)

                我想通過 'Demande_de_mot_de_passe' 函數發送數據并從這個請求中獲取結果.

                在下面的代碼中,這個請求是正確的(函數的名字好),我猜問題是我要發送的數據的格式.函數的調用是用這部分進行的:

                $client->Demande_de_mot_de_passe($soapVar);

                我嘗試過的:

                這是我嘗試過的代碼的相關部分(我自愿更改數據的值,但沒有其他任何內容.括號沒有拼寫錯誤,它關閉了函數和我沒有放在這里的類以保留相關部分):

                 $client = new SoapClient('URL_OF_THE_WS?WSDL', array('跟蹤' =>1、'編碼' =>'UTF-8','soap_version' =>SOAP_1_1,'類圖' =>數組('Demande_de_mot_de_passe_Input' => 'Demande_de_mot_de_passe_Input')));$donnesUtilisateur = 新的 Demande_de_mot_de_passe_Input;$donnesUtilisateur->Code_societe = '000';$donnesUtilisateur->Ident_type = 'A';$donnesUtilisateur->Ident_code = 'xxxxxx';$donnesUtilisateur->Dat_demande = '00000000';$donnesUtilisateur->Adr_mail = 'xxxxxx';$donnesUtilisateur->Adr_cpos = 'xxxxxx';$donnesUtilisateur->Nom = 'xxxxxx';$donnesUtilisateur->Prenom = 'xxxxxx';$donnesUtilisateur->Dat_naiss = '00000000';$namespace = 'URL_OF_NAMESPACE';$soapVar = new SoapVar($donnesUtilisateur, SOAP_ENC_OBJECT,'Demande_de_mot_de_passe_Input', $namespace);$result = $client->Demande_de_mot_de_passe($soapVar);打印_r($result);}}類 Demande_de_mot_de_passe_Input {公共 $Code_societe;公共 $Ident_type;公共 $Ident_code;公開 $Dat_demande;公共 $Adr_cpos;公共 $Adr_mail;公共 $Nom;公開 $Prenom;公開 $Dat_naiss;}

                我也試過用這樣的數組傳遞一個對象的數組(沒有成功):

                $donnesUtilisateur = ['Code_societe' =>'000','Ident_type' =>'一個','Ident_code' =>'xxxxxx','Dat_demande' =>'00000000','Adr_cpos' =>'xxxxxx','Adr_mail' =>'xxxxxx','Nom' =>'xxxxxx','Prenom' =>'xxxxxx','Dat_naiss' =>'00000000',];

                和:

                $donnesUtilisateur = (對象) ['Code_societe' =>'000','Ident_type' =>'一個','Ident_code' =>'xxxxxx','Dat_demande' =>'00000000','Adr_cpos' =>'xxxxxx','Adr_mail' =>'xxxxxx','Nom' =>'xxxxxx','Prenom' =>'xxxxxx','Dat_naiss' =>'00000000',];

                我得到的錯誤:

                SoapFault:未收到Demande_de_mot_de_passe_Input"對象.在 SoapClient->__call() 中

                如果我不明白,發送的數據格式不正確,但是當我嘗試其他方式發送時,它仍然報告同樣的錯誤.

                我讀過的文檔沒有成功:

                (抱歉,帖子太長了,我希望它足夠清楚,如果需要,不要忘記詢問精度,在此先感謝您的幫助:))

                解決方案

                在您的 WSDL 類型中,有一個名為 Demande_de_mot_de_passe 的序列,它使用名為 Demande_de_mot_de_passeRequest 的元素而不是 <代碼>Demande_de_mot_de_passe_Input.

                來自 SoapUI 的打印描述了消息請求,但如果它是 document 樣式,則 Demande_de_mot_de_passe 是一種類型.另一方面,如果它是 RPC 是方法名稱.

                如果是 RPC,您可以按如下所示進行啟動.您應該盡可能使用本機對象(SOAP 會更好地使用它們).stdObject 就足夠了:

                $request = new stdClass();$ demande_de_mot_de_passeRequest->Code_societe = '000';$ demande_de_mot_de_passeRequest->Ident_type = 'A';$ demande_de_mot_de_passeRequest->Ident_code = 'xxxxxx';$ demande_de_mot_de_passeRequest->Dat_demande = '00000000';$ demande_de_mot_de_passeRequest->Adr_mail = 'xxxxxx';$ demande_de_mot_de_passeRequest->Adr_cpos = 'xxxxxx';$ demande_de_mot_de_passeRequest->Nom = 'xxxxxx';$ demande_de_mot_de_passeRequest->Prenom = 'xxxxxx';$ demande_de_mot_de_passeRequest->Dat_naiss = '00000000';$request->Demande_de_mot_de_passeRequest = $ demande_de_mot_de_passeRequest;$response = $client->Demande_de_mot_de_passe($request);

                如果您的 SOAP 綁定是文檔,您只需添加一個名為 Demande_de_mot_de_passe

                的新上層

                /** 變量 $demande_de_mot_de_passeRequest 如上創建 **/$ demande_de_mot_de_passe = new stdClass();$ demande_de_mot_de_passe->Demande_de_mot_de_passeRequest = $ demande_de_mot_de_passeRequest;$request->Demande_de_mot_de_passe = $ demande_de_mot_de_passe;$response = $client->Demande_de_mot_de_passe($request);

                您的 WSDL 不需要列表/集合(這不是您的情況),因此您不需要使用 SoapVar 創建/解析變量.您可以閱讀其他示例(一個是我的,但它是葡萄牙語),另一個是關于 BOGUS 節點的:

                http://forum.imasters.com.br/topic/535213-enviar-xml-via-soap/?p=2137411http://www.fischco.org/blog/2011/3/26/php-soapserver-objects-arrays-and-encoding.html

                Context / What I want :

                I'm facing an issue while calling a Webservice with SOAP. Here's an image the relevant part of the WS I want to call :

                (I voluntarily hide the namespace part, not relevant here)

                I want to send data through 'Demande_de_mot_de_passe' function and catch result from this request.

                In the code below, this request is correct (the name of the function is good), I guess the problem is the formatting of the data I want to send. The call of the function is made with this part :

                $client->Demande_de_mot_de_passe($soapVar);
                

                What I've tried :

                Here's the relevant part of the code I've tried ( I voluntarily change values of data but nothing else. There is no typo error with the brackets, it close the function and the class I didn't put here to keep the relevant part) :

                    $client = new SoapClient('URL_OF_THE_WS?WSDL', array(
                      'trace'        => 1,
                      'encoding'     => 'UTF-8',
                      'soap_version' => SOAP_1_1,
                      'classmap'     => array('Demande_de_mot_de_passe_Input' => 'Demande_de_mot_de_passe_Input')
                    ));
                
                    $donnesUtilisateur = new Demande_de_mot_de_passe_Input;
                    $donnesUtilisateur->Code_societe = '000';
                    $donnesUtilisateur->Ident_type   = 'A';
                    $donnesUtilisateur->Ident_code   = 'xxxxxx';
                    $donnesUtilisateur->Dat_demande  = '00000000';
                    $donnesUtilisateur->Adr_mail     = 'xxxxxx';
                    $donnesUtilisateur->Adr_cpos     = 'xxxxxx';
                    $donnesUtilisateur->Nom          = 'xxxxxx';
                    $donnesUtilisateur->Prenom       = 'xxxxxx';
                    $donnesUtilisateur->Dat_naiss    = '00000000';
                    $namespace = 'URL_OF_NAMESPACE';
                
                    $soapVar = new SoapVar($donnesUtilisateur, SOAP_ENC_OBJECT,'Demande_de_mot_de_passe_Input', $namespace);
                
                    $result = $client->Demande_de_mot_de_passe($soapVar);
                
                    print_r($result);
                
                  }
                }
                
                class Demande_de_mot_de_passe_Input {
                  public $Code_societe;
                  public $Ident_type;
                  public $Ident_code;
                  public $Dat_demande;
                  public $Adr_cpos;
                  public $Adr_mail;
                  public $Nom;
                  public $Prenom;
                  public $Dat_naiss;
                }
                

                I've also tried with passing array of casting an object with the array like this (without success) :

                $donnesUtilisateur =  [
                      'Code_societe' => '000',
                      'Ident_type'  => 'A',
                      'Ident_code'  => 'xxxxxx',
                      'Dat_demande' => '00000000',
                      'Adr_cpos'    => 'xxxxxx',
                      'Adr_mail'    => 'xxxxxx',
                      'Nom'         => 'xxxxxx',
                      'Prenom'      => 'xxxxxx',
                      'Dat_naiss'   => '00000000',
                    ];
                

                and :

                $donnesUtilisateur = (object) [
                      'Code_societe' => '000',
                      'Ident_type'  => 'A',
                      'Ident_code'  => 'xxxxxx',
                      'Dat_demande' => '00000000',
                      'Adr_cpos'    => 'xxxxxx',
                      'Adr_mail'    => 'xxxxxx',
                      'Nom'         => 'xxxxxx',
                      'Prenom'      => 'xxxxxx',
                      'Dat_naiss'   => '00000000',
                    ];
                

                Error I get :

                SoapFault: Did not receive a 'Demande_de_mot_de_passe_Input' object. in SoapClient->__call()
                

                If I unterstand clearly, the formatting of data sent is not correct but when I try other way to send it, it still reporting the same error.

                Docs I've read about without success :

                http://www.fvue.nl/wiki/Php:_Soap:_How_to_add_attribute_to_SoapVar

                http://grokbase.com/t/php/php-soap/066jkmcz2h/passing-objects-to-soap-server-complextype-classmap

                EDIT

                Here's a capture of the WS 'Demande_de_mot_de_passe' function call in SoapUI :

                (Sorry for the long post, I hope it is clear enough, don't forget to ask about precisions if needed, thanks in advance for your help :) )

                解決方案

                At your WSDL's type, there's a sequence named Demande_de_mot_de_passe which use a element named Demande_de_mot_de_passeRequest and not Demande_de_mot_de_passe_Input.

                Your print from SoapUI describe the message request, but if it's document style, Demande_de_mot_de_passe is a type. On the other hand if it's RPC is the method name.

                Starting if it's RPC you can do as showed below. You should use as native object as you can (SOAP will work better with they). A stdObject will be good enough:

                $request = new stdClass();
                
                $demande_de_mot_de_passeRequest->Code_societe = '000';
                $demande_de_mot_de_passeRequest->Ident_type = 'A';
                $demande_de_mot_de_passeRequest->Ident_code = 'xxxxxx';
                $demande_de_mot_de_passeRequest->Dat_demande = '00000000';
                $demande_de_mot_de_passeRequest->Adr_mail = 'xxxxxx';
                $demande_de_mot_de_passeRequest->Adr_cpos = 'xxxxxx';
                $demande_de_mot_de_passeRequest->Nom = 'xxxxxx';
                $demande_de_mot_de_passeRequest->Prenom = 'xxxxxx';
                $demande_de_mot_de_passeRequest->Dat_naiss = '00000000';
                
                $request->Demande_de_mot_de_passeRequest = $demande_de_mot_de_passeRequest;
                
                $response = $client->Demande_de_mot_de_passe($request);
                

                If your SOAP binding is document, you just have to add a new upper level named Demande_de_mot_de_passe

                /** The variable $demande_de_mot_de_passeRequest is created as above **/
                
                $demande_de_mot_de_passe = new stdClass();
                $demande_de_mot_de_passe->Demande_de_mot_de_passeRequest = $demande_de_mot_de_passeRequest;
                $request->Demande_de_mot_de_passe = $demande_de_mot_de_passe;
                
                $response = $client->Demande_de_mot_de_passe($request);
                

                Your WSDL doesn't need a list/collections (it's not your case), so you don't need to create/parse variables with SoapVar. There's others examples that you can read about (one is mine, but it's in portuguese) and other is about the BOGUS node:

                http://forum.imasters.com.br/topic/535213-enviar-xml-via-soap/?p=2137411 http://www.fischco.org/blog/2011/3/26/php-soapserver-objects-arrays-and-encoding.html

                這篇關于Webservice SOAP 請求 - 發送的數據類型錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                enable SOAP on PHP(在 PHP 上啟用 SOAP)
                Get received XML from PHP SOAP Server(從 PHP SOAP 服務器獲取接收到的 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算法的實現)
                Sending a byte array from PHP to WCF(將字節數組從 PHP 發送到 WCF)
                <tfoot id='KaTWB'></tfoot>

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

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

                      <tbody id='KaTWB'></tbody>
                        <bdo id='KaTWB'></bdo><ul id='KaTWB'></ul>

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

                          主站蜘蛛池模板: 胶泥瓷砖胶,轻质粉刷石膏,嵌缝石膏厂家,腻子粉批发,永康家德兴,永康市家德兴建材厂 | 拼装地板,悬浮地板厂家,悬浮式拼装运动地板-石家庄博超地板科技有限公司 | 医养体检包_公卫随访箱_慢病随访包_家签随访包_随访一体机-济南易享医疗科技有限公司 | 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | 卫生纸复卷机|抽纸机|卫生纸加工设备|做卫生纸机器|小型卫生纸加工需要什么设备|卫生纸机器设备多少钱一台|许昌恒源纸品机械有限公司 | PCB厂|线路板厂|深圳线路板厂|软硬结合板厂|电路板生产厂家|线路板|深圳电路板厂家|铝基板厂家|深联电路-专业生产PCB研发制造 | 能量回馈_制动单元_电梯节能_能耗制动_深圳市合兴加能科技有限公司 | 蓝米云-专注于高性价比香港/美国VPS云服务器及海外公益型免费虚拟主机 | 安徽净化工程设计_无尘净化车间工程_合肥净化实验室_安徽创世环境科技有限公司 | 防水接头-电缆防水接头-金属-电缆密封接头-不锈钢电缆接头 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | 传爱自考网_传爱自学考试网 | 亿立分板机_曲线_锯片式_走刀_在线式全自动_铣刀_在线V槽分板机-杭州亿协智能装备有限公司 | 亚克力制品定制,上海嘉定有机玻璃加工制作生产厂家—官网 | 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 | 广东之窗网 | 神超官网_焊接圆锯片_高速钢锯片_硬质合金锯片_浙江神超锯业制造有限公司 | 天津电机维修|水泵维修-天津晟佳机电设备有限公司 | 台式低速离心机-脱泡离心机-菌种摇床-常州市万丰仪器制造有限公司 | crm客户关系管理系统,销售管理系统,crm系统,在线crm,移动crm系统 - 爱客crm | 丁基胶边来料加工,医用活塞边角料加工,异戊二烯橡胶边来料加工-河北盛唐橡胶制品有限公司 | 南方珠江-南方一线电缆-南方珠江科技电缆-南方珠江科技有限公司 南汇8424西瓜_南汇玉菇甜瓜-南汇水蜜桃价格 | 机构创新组合设计实验台_液压实验台_气动实训台-戴育教仪厂 | 高光谱相机-近红外高光谱相机厂家-高光谱成像仪-SINESPEC 赛斯拜克 | 浙江华锤电器有限公司_地磅称重设备_防作弊地磅_浙江地磅售后维修_无人值守扫码过磅系统_浙江源头地磅厂家_浙江工厂直营地磅 | 合肥抖音SEO网站优化-网站建设-网络推广营销公司-百度爱采购-安徽企匠科技 | 北京翻译公司-专业合同翻译-医学标书翻译收费标准-慕迪灵 | 金属检测机_金属分离器_检针验针机_食品药品金属检探测仪器-广东善安科技 | IIS7站长之家-站长工具-爱网站请使用IIS7站长综合查询工具,中国站长【WWW.IIS7.COM】 | 二次元影像仪|二次元测量仪|拉力机|全自动影像测量仪厂家_苏州牧象仪器 | ◆大型吹塑加工|吹塑加工|吹塑代加工|吹塑加工厂|吹塑设备|滚塑加工|滚塑代加工-莱力奇塑业有限公司 | 砍排机-锯骨机-冻肉切丁机-熟肉切片机-预制菜生产线一站式服务厂商 - 广州市祥九瑞盈机械设备有限公司 | 变位机,焊接变位机,焊接变位器,小型变位机,小型焊接变位机-济南上弘机电设备有限公司 | 回转窑-水泥|石灰|冶金-巩义市瑞光金属制品有限责任公司 | 维泰克Veertek-锂电池微短路检测_锂电池腐蚀检测_锂电池漏液检测 | 产业规划_产业园区规划-产业投资选址及规划招商托管一体化服务商-中机院产业园区规划网 | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | EDLC超级法拉电容器_LIC锂离子超级电容_超级电容模组_软包单体电容电池_轴向薄膜电力电容器_深圳佳名兴电容有限公司_JMX专注中高端品牌电容生产厂家 | 交变/复合盐雾试验箱-高低温冲击试验箱_安奈设备产品供应杭州/江苏南京/安徽马鞍山合肥等全国各地 | 钢格板|热镀锌钢格板|钢格栅板|钢格栅|格栅板-安平县昊泽丝网制品有限公司 |