首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SOAP请求在智能服务器2.2上无效

SOAP请求在智能服务器2.2上无效
EN

Stack Overflow用户
提问于 2022-01-10 17:21:56
回答 1查看 13关注 0票数 0

我是新来的。我是一家很小的公司的开发人员。我负责开发一个软件(asp.net/c#),以便通过智能服务器监视街道照明(旧版本: 2.2)。我使用SOAP消息来更改每个灯的配置和值(通过数据池)。

我主要成功地创建了调度程序,也成功地添加了数据点。但是,当我想向数据池中添加预设时,我将面临一个问题。

例如,调度程序可以使用以下3种预置来控制灯的功率(nviLampValue):

  • ON,其电灯值为100%,由格式化值'100.0 1‘
  • 表示,电灯值为0%,以格式化值'0.0 0'
  • PRESET1表示,80%为格式化值'80.0 1'

我创建了一个SOAP请求(SET)来配置数据池(即Net/LON/P68/OLC/nviLampValue_1)的预设集,但是经过多次试验,尽管没有错误,智能服务器仍然忽略我的请求。

如果有人知道这个请求有什么问题,它会对我有很大帮助。

提前致谢

致以敬意,

下面是我提出的SOAP请求:

代码语言:javascript
复制
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
   <soapenv:Header>
      <mes:messageProperties>
         <!--Optional:-->
         <mes:UCPTuniqueId>cid:38089712644</mes:UCPTuniqueId>
         <!--Optional:-->
         <mes:UCPTipAddress>192.168.1.222</mes:UCPTipAddress>
         <!--Optional:-->
         <mes:UCPTport>8080</mes:UCPTport>
      </mes:messageProperties>
   </soapenv:Header>
   <soapenv:Body>
      <mes:Set xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
        <mes:iLonItem xsi:type="Item_Coll" xmlns:xsi="xsi">
          <!--Zero or more repetitions:-->
          <mes:Item xsi:type="Dp_Cfg" xmlns:xsi="xsi">
             <mes:UCPTname>Net/LON/P68/OLC[0]/nviLampValue_1</mes:UCPTname>
             <!--Optional:-->
             <mes:UCPTannotation>Dp_In;xsi:type=\"LON_Dp_Cfg\"</mes:UCPTannotation>
             <mes:UCPTbaseType LonFormat="#8000010128000000[4].UCPTbaseType">BT_STRUCT</mes:UCPTbaseType>
            <UCPTformatDescription>#0000000000000000[0].SNVT_switch</UCPTformatDescription>
            <mes:ValueDef>
                <mes:UCPTindex>0</mes:UCPTindex>
                <mes:UCPTname>OFF</mes:UCPTname>
                <mes:UCPTvalue LonFormat='#0000000000000000[0].SNVT_switch'>0.0 0</mes:UCPTvalue>
            </mes:ValueDef>
            <mes:ValueDef>
                <mes:UCPTindex>1</mes:UCPTindex>
                <mes:UCPTname>ON</mes:UCPTname>
                <mes:UCPTvalue LonFormat='#0000000000000000[0].SNVT_switch'>100.0 1</mes:UCPTvalue>
            </mes:ValueDef>
            <mes:ValueDef>
                <mes:UCPTindex>2</mes:UCPTindex>
                <mes:UCPTname>PRESET1</mes:UCPTname>
                <mes:UCPTvalue LonFormat='#0000000000000000[0].SNVT_switch'>80.0 1</mes:UCPTvalue>
            </mes:ValueDef>
          </mes:Item>
        </mes:iLonItem>
      </mes:Set>
   </soapenv:Body>
</soapenv:Envelope>

以下是智能服务器的响应(似乎没有错误,但也没有处理)

代码语言:javascript
复制
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <SOAP-ENV:Header>
      <p:messageProperties xmlns:p="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
         <p:UCPTtimeStamp>2022-01-10T17:33:18.040+01:00</p:UCPTtimeStamp>
         <p:UCPTuniqueId>0300003B44F2</p:UCPTuniqueId>
         <p:UCPTipAddress>192.168.1.222</p:UCPTipAddress>
         <p:UCPTport>8080</p:UCPTport>
         <p:UCPTlastUpdate>2022-01-10T16:23:36Z</p:UCPTlastUpdate>
         <p:UCPTprocessingTime>21</p:UCPTprocessingTime>
      </p:messageProperties>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <SetResponse xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
         <iLonItem xsi:type="Item_Coll">
            <UCPTfaultCount>0</UCPTfaultCount>
            <UCPTcurrentConfig>4.0</UCPTcurrentConfig>
         </iLonItem>
      </SetResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EN

回答 1

Stack Overflow用户

发布于 2022-01-11 17:15:50

好吧,我找到了一个可行的解决方案。我分享,以防有人可能面临同样的(或类似的)问题。

这就是我在使用SOAPUI发送请求后发现的工作原理:

  • --我不得不用正确的名称空间编辑< except >、< MessageProperties >和< Set >标记。
  • --我还在标记中添加了更多的参数,但是除了UCPTname、UCPTannotation、UCPTFormatDescription、UCPTDirection和UCPTbaseType之外,没有检查它们是否都是必需的,这对于定义预置非常重要。

致以敬意,

以下是对我有用的请求:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <Header>
        <messageProperties xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/"/>
    </Header>
    <Body>
        <Set xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
            <iLonItem>
                <Item xsi:type="Dp_Cfg">
                    <UCPTname>Net/LON/P68/OLC[0]/nviLampValue_1</UCPTname>
                    <UCPTannotation>Dp_In;xsi:type=\"LON_Dp_Cfg\"</UCPTannotation>
                    <UCPThidden>0</UCPThidden>
                    <UCPTformatDescription>#0000000000000000[0].SNVT_switch</UCPTformatDescription>
                    <UCPTlength>2</UCPTlength>
                    <UCPTdirection LonFormat="#8000010128000000[4].UCPTdirection">DIR_IN</UCPTdirection>
                    <UCPTbaseType LonFormat="#8000010128000000[4].UCPTbaseType">BT_STRUCT</UCPTbaseType>
                    <UCPTmaxFields>2</UCPTmaxFields>
                    <SCPTmaxSendTime>0</SCPTmaxSendTime>
                    <SCPTminSendTime>0</SCPTminSendTime>
                    <SCPTmaxRcvTime>0</SCPTmaxRcvTime>
                    <ValueDef>
                        <UCPTindex>0</UCPTindex>
                        <UCPTname>OFF</UCPTname>
                        <UCPTvalue LonFormat="#0000000000000000[0].SNVT_switch">0.0 0</UCPTvalue>
                    </ValueDef>
                    <ValueDef>
                        <UCPTindex>1</UCPTindex>
                        <UCPTname>ON</UCPTname>
                        <UCPTvalue LonFormat="#0000000000000000[0].SNVT_switch">100.0 1</UCPTvalue>
                    </ValueDef>
                    <ValueDef>
                        <UCPTindex>2</UCPTindex>
                        <UCPTname>PRESET1</UCPTname>
                        <UCPTvalue LonFormat="#0000000000000000[0].SNVT_switch">80.0 1</UCPTvalue>
                    </ValueDef>
                </Item>
            </iLonItem>
        </Set>
    </Body>
</Envelope>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70656455

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档