很多在做ONVIF的人用remotediscovery.wsdl + gsoap產生出soap的程式,但是~~~
若是用官方的頁面所發佈的remotediscovery.wsdl做出來的程式可以讓TestTool有反應的話,那我就得稱看官你不是人,而是神!
第一,它產生出來的欄位就不太符合[ws-discovery]文件所敘述的欄位。Ex:沒有ProbeMatches欄
第二,Test Tool也會去檢查這一個欄位。
所以,若根據官方發佈的remotediscovery.wsdl這個東東,大大們能得到正確的Discovery的話,真的是佩服的五體投地。
修正如下:
<wsdl:definitions
xmlns:dn="http://schemas.xmlsoap.org/ws/2005/04/discovery"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:wl="http://www.onvif.org/ver10/network/wsdl"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://schemas.xmlsoap.org/ws/2005/04/discovery">
<wsdl:types>
<xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2005/04/discovery"
xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery"
elementFormDefault="qualified">
<xs:import namespace="http://schemas.xmlsoap.org/ws/2005/04/discovery"
schemaLocation="http://schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.xsd%22/>
<!-- Message Request/Responses elements -->
<!--===============================-->
<xs:element name="Hello" type="d:HelloType"/>
<xs:element name="HelloResponse" type="d:ResolveType"/>
<xs:element name="Probe" type="d:ProbeType"/>
<xs:element name="ProbeMatches" type="d:ProbeMatches"/>
<xs:element name="Bye" type="d:ByeType"/>
<xs:element name="ByeResponse" type="d:ResolveType"/>
<!--===============================-->
</xs:schema>
</wsdl:types>
<wsdl:message name="HelloRequest">
<wsdl:part name="parameters" element="dn:Hello"/>
</wsdl:message>
<wsdl:message name="HelloResponse">
<wsdl:part name="parameters" element="dn:HelloResponse"/>
</wsdl:message>
<wsdl:message name="ProbeRequest">
<wsdl:part name="parameters" element="dn:Probe"/>
</wsdl:message>
<wsdl:message name="ProbeMatches">
<wsdl:part name="parameters" element="dn:ProbeMatches"/>
</wsdl:message>
<wsdl:message name="ByeRequest">
<wsdl:part name="parameters" element="dn:Bye"/>
</wsdl:message>
<wsdl:message name="ByeResponse">
<wsdl:part name="parameters" element="dn:ByeResponse"/>
</wsdl:message>
<wsdl:portType name="RemoteDiscoveryPort">
<wsdl:operation name="Hello">
<wsdl:input message="dn:HelloRequest" dn:Action="http://schemas.xmlsoap.org/ws/2005/04/discovery/Hello%22/>
<wsdl:output message="dn:HelloResponse" dn:Action="http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe%22/>
</wsdl:operation>
<wsdl:operation name="Bye">
<wsdl:input message="dn:ByeRequest" dn:Action="http://schemas.xmlsoap.org/ws/2005/04/discovery/Bye%22/>
<wsdl:output message="dn:ByeResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="DiscoveryLookupPort">
<wsdl:operation name="Probe">
<wsdl:input message="dn:ProbeRequest" dn:Action="http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe%22/>
<wsdl:output message="dn:ProbeMatches" dn:Action="http://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches%22/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="RemoteDiscoveryBinding" type="dn:RemoteDiscoveryPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http%22/>
<wsdl:operation name="Hello">
<soap:operation soapAction="http://www.onvif.org/ver10/network/wsdl/Hello%22/>
<wsdl:input>
<soap:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body parts="parameters" use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Bye">
<soap:operation soapAction="http://www.onvif.org/ver10/network/wsdl/Bye%22/>
<wsdl:input>
<soap:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body parts="parameters" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="DiscoveryLookupBinding" type="dn:DiscoveryLookupPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http%22/>
<wsdl:operation name="Probe">
<soap:operation soapAction="http://www.onvif.org/ver10/network/wsdl/Probe%22/>
<wsdl:input>
<soap:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body parts="parameters" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
完畢之後,再將產生出來的*.nsmap檔加上這行
{"dn", "http://www.onvif.org/ver10/network/wsdl", NULL, NULL},
保證你的discovery就大功告成了!!
相關文章:Onvif ws-discovery
2011年8月4日 星期四
2011年5月29日 星期日
當講師課程有感~
為了經濟上的需要,有時候會去客串當講師,把自己工作上的經驗,拿來換成「金幣」
當講師,除了口條是基本要求,還得把想講的內容關鍵完整的講出來,卻又不能傷害到原公司或是原單位,還要加上sample code,及講義的製作‥一切都得拿捏到好處。
最近去當了某某課程的講師,講義上的內容可以讓學生按步就班的做出結果~當然身為講師的我,也準備了「標準答案」,但是我想問題是:來上課的是工程師,應該就要有追根究柢的精神。
缺乏了這樣的精神,只求「標準答案」,今天是XXXX明天又會是什麼?很多的答案是要自己去找出來的~是否我們都中了「基測」的毒?
自己的講義也搞了個「建構式」教學,把解題的想法寫了出來,希望學員明白整個的解決問題的思考過程,中間過程中有了很多的枝葉‥事實上這也是做專案子會碰到的問題。
(明明要解這個問題,卻又先牽拖到別的問題‥),反而忽略了主題?真是有點順了姑意,逆了嫂意~
期許「工程師」們要有挑戰自己的精神!除了要有基本「解題」的能力,最好還有「創新」和「發明」的能力‥共勉之~
當講師,除了口條是基本要求,還得把想講的內容關鍵完整的講出來,卻又不能傷害到原公司或是原單位,還要加上sample code,及講義的製作‥一切都得拿捏到好處。
最近去當了某某課程的講師,講義上的內容可以讓學生按步就班的做出結果~當然身為講師的我,也準備了「標準答案」,但是我想問題是:來上課的是工程師,應該就要有追根究柢的精神。
缺乏了這樣的精神,只求「標準答案」,今天是XXXX明天又會是什麼?很多的答案是要自己去找出來的~是否我們都中了「基測」的毒?
自己的講義也搞了個「建構式」教學,把解題的想法寫了出來,希望學員明白整個的解決問題的思考過程,中間過程中有了很多的枝葉‥事實上這也是做專案子會碰到的問題。
(明明要解這個問題,卻又先牽拖到別的問題‥),反而忽略了主題?真是有點順了姑意,逆了嫂意~
期許「工程師」們要有挑戰自己的精神!除了要有基本「解題」的能力,最好還有「創新」和「發明」的能力‥共勉之~
訂閱:
意見 (Atom)