0
訪問一個Web服務我創建了一個使用Visual Studio「添加服務引用」的代理類。不幸的是我必須把在肥皂頭中的以下元件c#web服務客戶端:如何添加自定義標題請求?
<soapenv:Header>
<ser:CF>XXXXXXXXXX</ser:CFSender>
<ser:Identity xmlns="http://company.org" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ser:AppKey>XXX</ser:AppKey>
<ser:AppName>XXXX</ser:AppName>
<ser:Parameter>Y</ser:Parameter>
</ser:Identity>
</soapenv:Header>
由Visual Studio生成代理僅具有枝以下元素作爲方法參數
<ser:CF>XXXXXXXXXX</ser:CFSender>
但不身份。我需要在Web服務調用之前以編程方式放置「Identity」元素....我需要最簡單的解決方案。我在其他問題中看到了如何放置一個參數......但身份是一個嵌套對象,我不知道該怎麼做。 任何人都可以提供幫助嗎?