soap報文略說

2021-07-23 02:07:23 字數 2484 閱讀 4597

簡單說一下soap報文,有兩種版本的報文的報頭。

soap_1_1_protocol與soap_1_2_protocol

分別對應的是

1.1:

xmlns:soap

env="">

1.2:

xmlns:env="">

env:envelope>

以下附帶乙個報文拼裝基類。當時寫的比較粗略沒有寫上解析響應報文的通用方法,只有乙個介面的解析響應方法。

這個以後有空填坑

/**

* 封裝soap報文基類

* 1.1:* 1.2:

*@author huangtao

*建立時間2023年9月2日下午9:07:42

* */

public

class

basesoapmessage

setmessage(message);

return message;

}/**

* 指定協議版本生成基礎報文,option,namespace,prefix引數若都設定了則返回乙個含參報文

*@param protocol

*@param protocol1_1為1.1的soap協議,protocol1_2為1.2的soap協議.

*@return

*@throws soapexception

*@author:huangtao

*/public soapmessage buildbasesoapmessage(string protocol ) throws soapexception

setmessage(message);

return message ;

}/**

* 將報文轉成位元組流

*@param message

*@return

*@author:huangtao

*/public

byte getsoapmessageasbytes( ) catch (soapexception ex) catch (ioexception ex)

return bytestream.tobytearray();

}/**

* 將報文轉成字串

*@param message

*@return

*@author:huangtao

*/public string getsoapmessageasstring()

/*** 為soap報文新增節點與值,預設排序以put的先後加入xml節點中

*@param message

*@param elements

*@return

*@author:huangtao

*@throws soapexception

*/public soapmessage addsoapmessageelement() throws soapexception

return message;}

return message;

}/**

*獲取介面返回報文中return 的值

*@param soapstring

*@return

*/public

static string getresultfromxml(string soapstring,string operation) }}

}return result;

} catch (exception e)

}public soapmessage getmessage()

public

void

setmessage(soapmessage message)

public string getprotocol()

public

void

setprotocol(string protocol)

public string getoption()

public

void

setoption(string option)

public string getnamespace()

public

void

setnamespace(string namespace)

public string getprefix()

public

void

setprefix(string prefix)

public linkedhashmapgetelements()

public

void

setelements(linkedhashmapelements)

public

static

void

main(string args)

}

利用WSE 加密SOAP報文 7

給收到的報文解密 當收到乙個由x.509證書加密後的報文後,soapinputfilter會自動嘗試使用使用者金鑰儲存室的私有金鑰來進行解密,當然,這個需要告訴wse 執行時 可以找到這個證書的額外配置資訊。這個資訊由應用程式配置檔案的security storelocation currentus...

利用WSE 加密SOAP報文 5

解密收到的報文 不管是在客戶端還是在伺服器端,wse 總是在securityinputfilter實現報文解密的,由於對稱加密需要由公共金鑰派生出來的加密金鑰,你需要建立乙個securityinputfilter能夠呼叫的方法來得到這個對稱金鑰,然後你就能使用包含在encrypteddata中的金鑰...

oracle 解析soap報文XML報錯

ora 31011 xml parsing failed ora 19202 error occurred in xml processing 1 專案做和ebs的介面,ebs提供乙個webservice服務。在資料庫中訪問ebs的webservice 報文解析沒有問題 突然一天請求回來的xml檔案...