久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='tR9kP'></tfoot>

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

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

        將字節數組從 PHP 發送到 WCF

        Sending a byte array from PHP to WCF(將字節數組從 PHP 發送到 WCF)

        <small id='99xlE'></small><noframes id='99xlE'>

        <tfoot id='99xlE'></tfoot>

            <tbody id='99xlE'></tbody>

            • <bdo id='99xlE'></bdo><ul id='99xlE'></ul>

              <i id='99xlE'><tr id='99xlE'><dt id='99xlE'><q id='99xlE'><span id='99xlE'><b id='99xlE'><form id='99xlE'><ins id='99xlE'></ins><ul id='99xlE'></ul><sub id='99xlE'></sub></form><legend id='99xlE'></legend><bdo id='99xlE'><pre id='99xlE'><center id='99xlE'></center></pre></bdo></b><th id='99xlE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='99xlE'><tfoot id='99xlE'></tfoot><dl id='99xlE'><fieldset id='99xlE'></fieldset></dl></div>
              <legend id='99xlE'><style id='99xlE'><dir id='99xlE'><q id='99xlE'></q></dir></style></legend>

                • 本文介紹了將字節數組從 PHP 發送到 WCF的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我必須從我的 PHP 客戶端向 WCF 主機發送一個字節數組(編碼照片).當我在 PHP 中對我的數組執行 var_dump() 時,我得到一個數組 [2839],這是可以的,但是在服務器端,當我調試時,我看到收到的數組只是字節 [5] ......知道如何修復它嗎?

                  I have to send a byte array (encoded photo) from my PHP client to the WCF host. when I do a var_dump() on my array in PHP I get an array[2839] which is ok but on the server side when I debug I see that received array is only byte[5]... Any idea how I can fix it?

                  我用過這樣的代碼

                  $file = file_get_contents($_FILES['Filedata']['tmp_name']);
                          $byteArr = str_split($file);
                          foreach ($byteArr as $key=>$val) { $byteArr[$key] = ord($val); }
                  
                  $client = new SoapClient('http://localhost:8000/MgrService?wsdl',
                                      array(
                                      'location' => 'http://localhost:8000/MgrService/SOAP11',
                                      'trace' => true,
                                      'soap_version' => SOAP_1_1
                                      ));
                    $par1->profileId = 13;
                    $par1->photo = $byteArr;          
                  
                    $client->TestByte($par1);
                  

                  正如我之前在 wcf 主機上寫的那樣,我只得到字節 [5] :/也許它需要一些解碼才能正確地序列化肥皂?我應該使用 Base64 解碼還是什么?

                  And as I wrote earlier on the wcf host I get only byte[5] :/ maybe it needs some decoding to right soap serialize? should I use Base64 decoding or something?

                  一般我只想以字節[]為參數將發布的文件上傳到c#函數:/幫助

                  General I just want to upload posted file to c# function with byte[] as parameter :/ Help

                  哦,這個函數的 wsdl 部分看起來像這樣

                  Oh and the wsdl part of this function looks like this

                  <xs:element name="TestByte">
                  <xs:complexType>
                  <xs:sequence>
                  <xs:element minOccurs="0" name="photo" nillable="true" type="xs:base64Binary"/>
                  </xs:sequence>
                  </xs:complexType>
                  </xs:element>
                  

                  推薦答案

                  您應該在 PHP 中使用字符串來模擬字節數組.您甚至可以將語法 $str[index] 與字符串一起使用.否則,您將有巨大的開銷(4 倍或 8 倍,具體取決于有效負載的整數大小加上哈希表開銷).

                  You should use strings in PHP to emulate byte arrays. You can even use the syntax $str[index] with strings. You have a HUGE overhead (4x or 8x depending on the int size the payload PLUS the hash table overhead) otherwise.

                  我不太熟悉 SOAP 擴展所做的類型轉換,但使用字符串可能會起作用.

                  I'm not very familiar with the type conversions the SOAP extension does, but using a string instead will probably work.

                  剛剛檢查了來源:

                  if (Z_TYPE_P(data) == IS_STRING) {
                      str = php_base64_encode((unsigned char*)Z_STRVAL_P(data), Z_STRLEN_P(data), &str_len);
                      text = xmlNewTextLen(str, str_len);
                      xmlAddChild(ret, text);
                      efree(str);
                  }
                  

                  所以它已經為你做了 base 64 編碼.

                  So it already does the base 64 encoding for you.

                  [推測]

                  您的 5 字節長結果是因為按照上面的代碼轉換為字符串:

                  Your 5-byte long result is because of the conversion to string that follows the code above:

                  if (Z_TYPE_P(data) == IS_STRING) {
                          ...
                  } else {
                      zval tmp = *data;
                  
                      zval_copy_ctor(&tmp);
                      convert_to_string(&tmp);
                      str = php_base64_encode((unsigned char*)Z_STRVAL(tmp), Z_STRLEN(tmp), &str_len);
                      text = xmlNewTextLen(str, str_len);
                      xmlAddChild(ret, text);
                      efree(str);
                      zval_dtor(&tmp);
                  }
                  

                  轉換結果為數組",長度為 5 個字節.

                  The conversion results in "Array", which is 5 bytes long.

                  這篇關于將字節數組從 PHP 發送到 WCF的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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算法的實現)
                  SoapClient error fallback in PHP(PHP 中的 SoapClient 錯誤回退)
                    <bdo id='lzks4'></bdo><ul id='lzks4'></ul>

                      <tbody id='lzks4'></tbody>

                      1. <small id='lzks4'></small><noframes id='lzks4'>

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

                          • 主站蜘蛛池模板: 欧美 日韩 国产 成人 | 一区二区三区四区在线播放 | 久久成人国产精品 | 国产欧美一级 | 国产美女自拍视频 | 91精品国产一区二区 | 精品久久久久久 | 欧美精品在线观看 | 黄色av网站在线观看 | 国产成人精品久久二区二区91 | av资源在线看 | 色毛片 | 精品久久1| 日韩欧美在线视频观看 | 国产91久久精品一区二区 | 夜夜爽99久久国产综合精品女不卡 | 国产日韩精品一区二区三区 | 久草网址 | 伊人精品在线 | 秋霞精品| 亚洲精品久久区二区三区蜜桃臀 | 国产高清精品一区二区三区 | 婷婷狠狠 | 欧美日韩精品 | 国产精品久久久久久久久久了 | 国产不卡视频 | 亚洲综合视频 | 日韩高清不卡 | 一级a性色生活片久久毛片波多野 | 亚洲欧美在线免费观看 | 福利视频一区二区 | 97久久精品午夜一区二区 | 中文字幕一区二区三区四区 | 亚洲精品丝袜日韩 | av免费网站在线观看 | 天天综合成人网 | 国产福利视频 | 亚洲色图第一页 | 国产色黄| 亚洲精品一级 | 久久噜噜噜精品国产亚洲综合 |