Dpws web service with event - Wcf client example or suggestions sought
我的设备具有一个DPWS Web服务,该服务具有单个输出(wsdl:output),我需要使用Wcf客户端进行预订
客户端是常规的.Net 4.0应用程序-不是.net-micro-framework。
我需要有关为此类服务构建此类客户端的示例或教程或其他资源。
"添加服务参考"产生无效的代码,"添加Web参考"挂起。
WSDL在下面。
如果需要进一步的信息来回答这个问题,请告诉我。
非常感谢
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p="http://schemas.xmlsoap.org/ws/2006/02/devprof" xmlns:po="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:tns="http://www.test.fi/wsdl/THLGateway" xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/" name="THLGateway" targetNamespace="http://www.test.fi/wsdl/THLGateway"> <po:Policy Id="EventingServicePolicy"> <p:profile /> <p:PushDelivery /> <p:DurationExpiration /> <p:ActionFilter /> </po:Policy> <types> <xsd:schema targetNamespace="http://www.test.fi/wsdl/THLGateway" elementFormDefault="qualified"> <xsd:element name="thlChangeEvent"> <xsd:complexType> <xsd:sequence> <xsd:element name="gatewayID" type="xsd:string" nillable ="true" minOccurs="0"/> <xsd:element name="nodeID" type="xsd:string" minOccurs="0" nillable ="true"/> <xsd:element name="temperature" nillable ="true" minOccurs="0" type="xsd:double"/> <xsd:element name="humidity" nillable ="true" minOccurs="0" type="xsd:double"/> <xsd:element name="light" nillable ="true" minOccurs="0" type="xsd:double"/> <xsd:element name="battery" nillable ="true" minOccurs="0" type="xsd:double"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> </types> <wsdl:message name="thlChangeResponse"> <wsdl:part name="parameters" element="tns:thlChangeEvent"/> </wsdl:message> <wsdl:portType name="THLGatewayPortType" wse:EventSource="true"> <wsdl:operation name="thlChange"> <wsdl:output message="tns:thlChangeResponse"/> </wsdl:operation> </wsdl:portType> <binding name="THLGatewayPortType" type="tns:THLGatewayPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <po:PolicyReference URI="#EventingServicePolicy" wsdl:required="true" /> <wsdl:operation name="thlChange"> <soap:operation style="document"/> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </binding> <service name="THLGateway"> <port name="THLGatewayPortType" binding="tns:THLGatewayPortType"> <soap:address location="http://192.168.0.93:80/dpws/ws01"/> </port> </service> </definitions> |
单输出表示该服务生成事件。您将需要寻找WS-Eventing。 .Net 4.0 WCF股票中不支持此功能,但是CodeProject上的一个项目正在WCF之上实现此功能。您仍然对该主题感兴趣吗?