我正在使用gSoap爲ONVIF相機構建Web服務。 我使用ONVIF在https://www.onvif.org/profiles/specifications/提供的核心wdsl生成了頭文件和源文件。gSoap故障SOAP-ENV:MustUnderstand [無子碼]
然而,每次我讓來自客戶端的請求時,我得到下面的錯誤在功能soap_begin_serve(soap)
:
SOAP 1.2 fault SOAP-ENV:MustUnderstand[no subcode]
"The data in element 'Security' must be understood but cannot be processed"
是什麼上述錯誤的手段和如何解決呢?
編輯:這就是我接收在攝像機側:
POST/HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetSystemDateAndTime"
Host: localhost:8090
Content-Length: 261
Accept-Encoding: gzip, deflate
Connection: Close
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetSystemDateAndTime xmlns="http://www.onvif.org/ver10/device/wsdl"/></s:Body></s:Envelope>POST/HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetScopes"
Host: localhost:8090
Content-Length: 905
Accept-Encoding: gzip, deflate
Connection: Close
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header><Security s:mustUnderstand="1" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><UsernameToken><Username>admin</Username><Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">WFz21zL8rch8LRoxAPzgHRMBbr0=</Password><Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">9y79ka0xD02oCIw6GAoIPwEAAAAAAA==</Nonce><Created xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2017-05-21T08:15:58.902Z</Created></UsernameToken></Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><GetScopes xmlns="http://www.onvif.org/ver10/device/wsdl"/></s:Body></s:Envelope>
UsernameToken/Security標題存在問題。你能發佈你發送給相機的SOAP消息嗎? – aminexplo
發佈了camera.thanks收到的請求。 – thunderbird
我必須爲WS-Security單獨配置gsoap嗎? – thunderbird