具有事件的dpws Web服务-WCF客户端示例或建议 [英] Dpws web service with event - Wcf client example or suggestions sought

查看:99
本文介绍了具有事件的dpws Web服务-WCF客户端示例或建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的设备具有一个DPWS Web服务,该服务具有单个输出(wsdl:output),我需要通过Wcf客户端进行订阅

My device has a DPWS web service with a single output (wsdl:output) that I need to subscribe to with a Wcf client

客户端是常规的.Net 4.0应用程序-不是.net-micro-framework.

The client is a regular .Net 4.0 application - not .net-micro-framework.

我需要一个示例或教程或其他资源,以与此类客户建立此类服务.

I need an example or tutorial or other resource relating to building such a client to such a service.

添加服务参考"产生无效的代码,添加Web参考"挂起.

'Add Service Reference' produces non-working code, 'Add Web Reference' hangs.

WSDL在下面.

如果需要进一步的信息来回答这个问题,请告诉我.

If there's any further information required to answer this question please let me know.

非常感谢

<?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之上实现此功能.您仍然对该主题感兴趣吗?

Single Output means that this service generates Events. You will want to look for WS-Eventing. It is not supported in stock .Net 4.0 WCF, but a project on CodeProject is implementing this functionality on top of WCF. Are you still interested in this topic?

这篇关于具有事件的dpws Web服务-WCF客户端示例或建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆