小编And*_*tel的帖子

WCF客户端返回空数组 - XML响应似乎没问题

我正在尝试为我们的Intranet上托管的Web服务创建一个简单的WCF客户端(C#).使用Fiddler和SoapUI我可以看到请求和响应似乎没问题,但是当我运行代码时,返回一个空数组.

我会尝试只粘贴相关的行(但是会有很多东西),但随意问我是否错过了一些东西:

WSDL:

<s0:definitions name="Workforce_2_1_0" targetNamespace="ld:Logical/Workforce_2_1_0_ws" xmlns:s0="http://schemas.xmlsoap.org/wsdl/" xmlns:s1="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:s2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:s3="ld:Logical/Workforce_2_1_0_ws" xmlns:s4="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
   <s0:documentation>Oracle Data Service Integrator Web Service</s0:documentation>
   <s1:Policy s2:Id="Mtom.xml">
      <wsoma:OptimizedMimeSerialization xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
   </s1:Policy>
   <wsp:UsingPolicy s0:Required="true"/>
   <s0:types>
      <xs:schema elementFormDefault="qualified" targetNamespace="ld:Logical/Workforce_2_1_0_ws" xmlns:dsns0="http://schemata.enterprise.biz/hr/2.1" xmlns:s1="ld:Logical/Workforce_2_1_0_ws" xmlns:s2="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:stns="ld:Logical/Workforce_2_1_0_ws" xmlns:tns="ld:Logical/Workforce_2_1_0_ws" xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:import namespace="http://schemata.enterprise.biz/hr/2.1" schemaLocation="http://server123.enterprise.com:31900/MyService/Services/Workforce_2-1-0?SCHEMA%2FMyService%2FResources%2FSchemas%2FWorkForce_2.1"/>
         <xs:element name="getByKey">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="key" type="xs:string"/>
               </xs:sequence>
            </xs:complexType>
         </xs:element>
      </xs:schema>
   </s0:types>
   <s0:message name="getByKeyIn">
      <s0:part element="s3:getByKey" name="parameters"/>
   </s0:message>
   <s0:message name="getByKeyOut">
      <s0:part element="s3:getByKeyResponse" name="parameters"/>
   </s0:message>
   <s0:portType name="Workforce_2_1_0PT">
      <s0:operation name="getByKey">
         <s0:input message="s3:getByKeyIn"/>
         <s0:output message="s3:getByKeyOut"/>
      </s0:operation>
   </s0:portType>
   <s0:binding name="Workforce_2_1_0SoapBinding" type="s3:Workforce_2_1_0PT">
      <s4:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> …
Run Code Online (Sandbox Code Playgroud)

c# wcf web-services

6
推荐指数
1
解决办法
5483
查看次数

选择子元素具有值的XElement

给出以下XML:

<platforms>
  <platform>
    <id>1</id>
    <price>2.99</price>
  </platform>
</platforms>
Run Code Online (Sandbox Code Playgroud)

如何根据值为"1"的子元素"id"选择"platform"元素作为XElement对象?

我到目前为止:

XDocument xPlatformXml = new XDocument();
XElement xel = xPlatformXml.Element("platforms").Elements("platform").Where(x => x.Value == "1").SingleOrDefault();
Run Code Online (Sandbox Code Playgroud)

但这是在"平台"元素而不是"id"中寻找价值.

c# linq linq-to-xml

6
推荐指数
1
解决办法
3万
查看次数

SSRS报告使用RESTful Web服务

我正在尝试使用SSRS通过REST Web服务使用XML。我打算使用LINQ创建XML,然后将其转储到Web服务位置。

该Web服务位于Azure下

https:// ... azurewebsites.net/api/simpleXmlData?name=Test

在该报告中,我创建了一个数据类型为XML和连接字符串的数据源,如上所述,其参​​数分别确定如下。

“ https:// ... azurewebsites.net/api/simpleXmlData?name=”&参数!Id.Value

然后,我创建了一个数据集,该数据集尝试使用方法XML查询类型调用它: XML查询类型

<Query>
   <Method Name="Club" 
Namespace="http://schemas.microsoft.com/2003/10/Serialization/">
   <Parameters>
       <Parameter Name="Item">
           <DefaultValue>/</DefaultValue>
       </Parameter>
   </Parameters>
   </Method>
   <ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>
Run Code Online (Sandbox Code Playgroud)

但是,当我调试报告时,打开后会看到这个 错误

我对此并不陌生,并已尽我所能阅读,主要是基于以下看到的报告:

我们更喜欢使用REST而不是SOAP,因为后者似乎更耗时。

有解决方案吗?还是Reporting Services不支持REST?

xml rest reporting-services restful-url ssrs-2017

6
推荐指数
0
解决办法
1754
查看次数

chrome 调度轮事件

我正在尝试在 chrome 中发送轮子事件,但仍然无法成功。我正在使用 WheelEvent 对象,但似乎无法正确“初始化”它。无论我做什么,delta 总是 0。我查看了规范,但没有帮助。更有趣的是,当我实际用鼠标滚轮滚动并尝试调度该事件时,我捕获了该事件,但增量再次为 0。有人遇到过这样的问题吗?这可能是一个错误吗?任何帮助都会很棒!

//dispatching the wheel event
var evt = document.createEvent("WheelEvent");
evt.initEvent("mousewheel", true, true, null, 0, 0, 0, 0, 0, false, false, false, false, 0, null, -120);
window.dispatchEvent(evt)

// catching the wheel event
window.addEventListener('mousewheel', callback, true);
callback = function(evt){
       console.log(evt)
}
Run Code Online (Sandbox Code Playgroud)

events google-chrome mousewheel dispatch

5
推荐指数
1
解决办法
5073
查看次数

自定义节点图标在 Fancytree 中不起作用

我一直在我正在从事的一个项目中使用“Fancytree”,直到今天为止我对它非常满意。我需要在树中的某些节点上显示不同的图标,但到目前为止,还无法让它们显示在树上。

我在 JSON 字符串中指定自定义节点图标,我用它来加载树:

[{
    "title": "Inventory",
    "key": "DocFolders/1026",
    "folder": true,
    "data": {
        "icon": "LockedFolder.gif",
        "isLocked": true
    }
}, {
    "title": "Telemetry",
    "key": "DocFolders/1027",
    "folder": true,
    "data": {
        "icon": "LockedFolder.gif",
        "isLocked": true
    }
}, {
    "title": "Well Documents",
    "key": "DocFolders/1028",
    "folder": true,
    "data": {
        "icon": "LockedFolder.gif",
        "isLocked": true
    },
    "expanded": true,
    "children": [{
        "title": "4-13 Spectrum Core PG&E Data.xlsx",
        "key": "SpectrumDocs/961"
    }]
}, {
    "title": "Well Photos",
    "key": "DocFolders/1029",
    "folder": true,
    "data": {
        "icon": "LockedFolder.gif",
        "isLocked": true
    }
}]
Run Code Online (Sandbox Code Playgroud)

以下是加载树的 …

css jquery json fancytree

5
推荐指数
1
解决办法
4707
查看次数

如何禁用 AVPlayerView 中的鼠标滚轮事件?

当 AVPlayerView 观看时,滑动鼠标滚轮可以暂停电影然后快进或快退。这会导致过程错误。

顺便说一句,我将 AVPlayerView 模式设置为 NONE。

让我知道如何禁用 AVPlayerView 上的鼠标滚轮事件。

mouse cocoa objective-c mousewheel avplayerview

5
推荐指数
1
解决办法
579
查看次数

在.Net Core 2.0上获得网络成本的最佳方式

有没有办法在.Net Core 2.0上找到网络成本?
这就是我在c ++代码中获得网络成本的方法:

hr = pNetworkCostManager->GetCost(&dwCost, NULL);
if (hr == S_OK) {
    switch (dwCost) {
    case NLM_CONNECTION_COST_UNRESTRICTED:  
    case NLM_CONNECTION_COST_FIXED:         
    case NLM_CONNECTION_COST_VARIABLE:      
    case NLM_CONNECTION_COST_OVERDATALIMIT: 
    case NLM_CONNECTION_COST_CONGESTED:    
    case NLM_CONNECTION_COST_ROAMING:     
    case NLM_CONNECTION_COST_APPROACHINGDATALIMIT:
    case NLM_CONNECTION_COST_UNKNOWN:
    }
}
Run Code Online (Sandbox Code Playgroud)

.Net Core(2.0)的一个特点是NetworkInterfaceType(https://docs.microsoft.com/en-us/dotnet/api/system.net.networkinformation.networkinterfacetype?view=netcore-1.0)

基于NetworkInterfaceType I可以看看它是否有wifi,网络或移动连接,但这不会转化为成本.
有没有办法在.Net Core 2.0上找到网络成本?

.net .net-core .net-standard

5
推荐指数
1
解决办法
188
查看次数

如果通过 mousedown 事件打开弹出窗口,则会被阻止

我想当有人用鼠标右键单击某个区域时打开一个弹出窗口。我现在正在使用这个:

$("#popup").bind('mousedown', function(e) {
    var w;
    if(e.which==3) {
        w=window.open('link','_blank','options');
    } else {
        return false;
    }
    if(w!=null){
        w.focus();
    }
    event.preventDefault();
});
Run Code Online (Sandbox Code Playgroud)

当与 Firefox 一起使用时(尽管尚未在其他浏览器上进行测试),弹出窗口被阻止。我注意到“点击”事件根本不起作用。

有什么方法可以在右键单击某个内容时打开弹出窗口而不被浏览器阻止吗?

javascript jquery popup right-click window.open

4
推荐指数
1
解决办法
1218
查看次数

将整数列表 (IEnumerable&lt;int&gt;) 转换为特定长度的元组列表 (IEnumerable&lt;IEnumerable&lt;int&gt;&gt;)

我尝试解决下一个练习:

输入:带有count >= 1;一些正整数的整数列表k

输出: 这个整数的所有可能的元组,长度k;

例如

输入: {1, 2}; k = 4

输出:

{
 {1, 1, 1, 1},
 {1, 1, 1, 2},
 {1, 1, 2, 1},
 {1, 1, 2, 2},
 {1, 2, 1, 1},
 {1, 2, 1, 2},
 {1, 2, 2, 1},
 {1, 2, 2, 2},
 {2, 1, 1, 1},
 {2, 1, 1, 2},
 {2, 1, 2, 1},
 {2, 1, 2, 2},
 {2, 2, 1, 1},
 {2, 2, 1, …
Run Code Online (Sandbox Code Playgroud)

c# algorithm statistics

4
推荐指数
1
解决办法
84
查看次数

可以实现empty()的对象处理

我知道我们可以实现PHP的可数接口来确定函数count()的工作方式以及使用像数组这样的对象的Iterator接口.

是否可以实现某种接口(或任何其他方式)来更改对象上的empty()行为?

从本质上讲,这是我希望能够做到的:

<?php
class test {
    function __empty() {
        if (count($this->data) > 0) {
            return false;
        }
        return true;
    }
}
Run Code Online (Sandbox Code Playgroud)

真是个不错的选择!

php interface is-empty

3
推荐指数
2
解决办法
2776
查看次数