小编Raj*_*esh的帖子

我们可以创建自定义HTTP状态代码吗?

我有一个REST和WCF服务,并希望根据操作发送自定义状态代码.

某些验证失败然后我想发送HTTP 444的示例,当授权失败时,我想发送HTTP 455

问题是我们如何对SOAP和REST Web服务进行验证.

在客户端上,错误代码如何起作用,因为当您从WCF服务(使用SOAP)发送HTTP 400/500时,会在显示状态代码的客户端上抛出异常.

现在,如果我发送一个新的自定义状态代码,客户端如何处理这个?

c# asp.net wcf http wcf-rest

77
推荐指数
6
解决办法
7万
查看次数

从.Net调用使用List <T>的Java Web Service

我正在开发一个将由.Net客户端使用的Java Web服务.该服务公开了一个接受一个对象作为参数的方法,该对象有一个List类型的字段,Row类也有一个List类型的字段.

现在,当Java客户端使用此服务时,它正确地将类型视为List,但是当.Net客户端使用该服务时,我最终会调用期望数组类型为Value的数组(例如Value [] [])而不是List.

版本兼容性已设置为".Net 3.5/METRO 1.3".

有谁知道如何让它与.Net和Java客户端一样工作,因为它们接受List而不是Value [] []?

减少Web服务的版本是:

服务:

    @WebService(serviceName = "Test")
    public class Test {

    @WebMethod(operationName = "DataRequest")
    public DataResponse DataRequest(DataRequest req) {
        return new DataResponse();
    } 

}
Run Code Online (Sandbox Code Playgroud)

DataRequest:

public class DataRequest {
    public DataType datType;
    public String source;
    public List<RowInfo> rows;
    public String loginId;
}
Run Code Online (Sandbox Code Playgroud)

RowInfo:

public class RowInfo {
   public List<Value> valueList;
}
Run Code Online (Sandbox Code Playgroud)

值:

public class Value {    
    public String name;
    public String value;
}
Run Code Online (Sandbox Code Playgroud)

在我的.Net客户端上,当我尝试构建请求对象时,它将FeeDataRequest的rows字段视为Value [] []而不是List.

已配置.Net中的服务引用,以便集合类型为System.Collections.Generic.List.

关于如何使.Net正确看到这一点的想法?

.net c# java web-services

8
推荐指数
1
解决办法
2184
查看次数

找不到带有ID的UpdatePanel

我最近将项目更新为DNN 6.0.1.我从6.0.1安装开始,并从那里添加了我的桌面模块.从5.6.3移动到6.0.1时出现了一个问题,在我的一些用户控件中有一些功能.在我深入了解之前,我会承认我有点不舒服.

快速概述我有一个ascx,其中包含另一个控件中的所有功能,其中包含asp向导中的其他几个控件.
(这么多嵌套控件的原因是隐藏了许可目的的功能,以及另一个模块[也许可]依赖于第一个子控件中的功能)

它就像这样父:ViewReportRisk.ascx >> Child:ReportRiskWizard.ascx >> Second-Child:Attachments.ascx(许可 - 隐藏功能)(主要功能)(支持功能的控件)

向导(在子控件中)位于Telerik RadMultiPage内.我遇到麻烦的控件(第二个子控件)包含一个包含在asp更新面板中的RadUploader.

当我单击向导中的"下一步"以使用RadUploader查看控件时,我收到此错误:

Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'dnn_ctr445_ViewReportIssue_wzAddRisk_AttachmentsAddTemp_UpdatePanel1'. If it is being updated dynamically then it must be inside another UpdatePanel.' when calling method: [nsIDOMEventListener::handleEvent]
Run Code Online (Sandbox Code Playgroud)

Id很好.我没有动态创建控件,当我删除更新面板时,控件出现,但上传功能丢失.

控件的简要概述(缩写):

ViewReportIssue.ascx

    <%@ Control Language="C#" Inherits="NWDS.Modules.ReportIssue.ViewReportIssue" AutoEventWireup="true"
        CodeBehind="ViewReportIssue.ascx.cs" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register src="ReportIssueWizard.ascx" tagname="ReportIssueWizard" tagprefix="uc2" %>
    <%@ Register src="../Utils/LicensingInfo.ascx" tagname="LicensingInfo" tagprefix="uc1" %>

    <uc1:LicensingInfo ID="LicensingInfo1" runat="server" />

    <asp:Panel runat="server" ID="pnlContainer">
        <uc2:ReportIssueWizard ID="ReportIssueWizard1" runat="server" />   
    </asp:Panel> …
Run Code Online (Sandbox Code Playgroud)

dotnetnuke asp.net-ajax

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

如何配置TeamCity以同时运行测试而不是逐个运行?

我有一些使用NUnit,C#和Seleium编写的UI /系统测试,我正在使用TeamCity自动运行这些测试,例如每天一次.

问题是每个测试需要1-10分钟才能完成,而TeamCity会按顺序运行它们,因此需要很长时间才能完成所有测试.

(请不要担心或评论为什么测试需要这么长时间,因为它们是系统测试并为多个站点的多个用户运行)

测试是独立的,并且不依赖于彼此,因此它们可以同时运行.

如何将TeamCity配置为同时运行测试而不是逐个运行?

c# teamcity selenium nunit unit-testing

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

如何在 JSON 格式的 AWS CloudFormation 模板中将 google 添加为 AWS cognito 身份提供商

我正在使用亚马逊网络服务。在 AWS CloudFormation 中,我正在创建一个 JSON 模板,其中必须添加身份池作为资源,并且必须使用 Google 作为 Cognito 身份提供商。如果我们在 CognitoIdentityProvider 中使用 Google,那么对象中的值应该是什么?IE

"CognitoIdentityProvider":[
{
  "ClientId": String,
  "ProviderName": String,
  "ServerSideTokenCheck": Boolean
}
]
Run Code Online (Sandbox Code Playgroud)

如果我们使用 Google 作为 CognitoIdentityProvider ,任何人都可以帮助我了解此对象属性的值吗?请帮忙。

amazon-web-services aws-cloudformation amazon-cognito

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

如何在C++中调用Rest服务?

我想从我的C++应用程序中调用用WCF编写的休息服务(它可以支持XML和JSON Web消息格式).

实现这一目标的最佳解决方案是什么?我见过一些实用程序(gsoap),它们为您创建用于调用Web服务的代理类.

我可以在不使用任何中间工具的情况下实现相同的功能 作为一个休息服务,它使用GET/PUT函数作为基本的HTTP函数,是否有任何C++库/解决方案可用于直接从c ++应用程序调用这些函数?

c++ rest wcf web-services

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

找不到 Docker Entrypoint.sh

按照概述的说明将 Duo CloudMapper 部署到 AWS 环境并收到错误

Docker 文件

FROM python:3.7-slim as cloudmapper

LABEL maintainer="https://github.com/0xdabbad00/"
LABEL Project="https://github.com/duo-labs/cloudmapper"

WORKDIR /opt/cloudmapper
ENV AWS_DEFAULT_REGION=us-east-1 

RUN apt-get update -y
RUN apt-get install -y build-essential autoconf automake libtool python3.7-dev python3-tk jq awscli

COPY cloudmapper/. /opt/cloudmapper
COPY entrypoint.sh /opt/cloudmapper/entrypoint.sh

# Remove the demo data
RUN rm -rf /opt/cloudmapper/account-data/demo

# Install the python libraries needed for CloudMapper
RUN cd /opt/cloudmapper && pip install -r requirements.txt


ENTRYPOINT /opt/cloudmapper/entrypoint.sh
Run Code Online (Sandbox Code Playgroud)

现在构建 docker 镜像

C:\> docker build -t cloudmapper .
Run Code Online (Sandbox Code Playgroud)

当我使用以下命令运行 …

windows amazon-web-services docker dockerfile

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

无法找到作为ServiceHost指令中的Service属性值提供的类型'RestService.weddingservice'

我正在尝试创建我的第一个WCF restful服务.在VS2010中,我打开weddingservice.svc,然后点击F5.浏览器打开到http:// localhost:50043/weddingservice.svc 但是,这是我得到的错误:

Server Error in '/' Application.

The type 'RestService.weddingservice', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The type 'RestService.weddingservice', provided as the Service attribute value in the ServiceHost …
Run Code Online (Sandbox Code Playgroud)

asp.net wcf

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

WCF中超出了最大请求长度

我目前正在使用Wcf应用程序并在跟踪日志中获得上面的mentiooned错误.

下面是Wcf服务的Web.Config.

<bindings>
          <wsHttpBinding>
              <binding name="NewBinding0" closeTimeout="00:50:00" openTimeout="00:50:00" sendTimeout="00:50:00" receiveTimeout="00:50:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
                  <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                  <reliableSession enabled="true" />
                  <security mode="None">
                      <transport clientCredentialType="None" />
                      <message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="false" />
                  </security>
              </binding>
          </wsHttpBinding>
      </bindings>       

<diagnostics wmiProviderEnabled="true">
  <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<services>
  <service behaviorConfiguration="DBSyncWcfService.Service1Behavior" name="DBSyncWcfService.DBSyncService">
    <endpoint binding="wsHttpBinding" bindingConfiguration="NewBinding0" name="ABC" contract="DBSyncWcfService.IDBSyncContract" address="http://192.168.5.170:9999/" />
    <host>
      <baseAddresses>
Run Code Online (Sandbox Code Playgroud)

以下是客户端配置.

        WSHttpBinding binding = new WSHttpBinding();
        //binding.ReaderQuotas.MaxArrayLength = 10485760;

        //binding.MaxReceivedMessageSize = 10485760;
        binding.Security.Mode = SecurityMode.None;
        binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
        binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
        binding.Security.Message.EstablishSecurityContext …
Run Code Online (Sandbox Code Playgroud)

wcf wcf-binding wshttpbinding

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

3个窗格布局(不是3列)

我希望有布​​局,类似于Thunderbird经典视图的结构(http://kmgerich.com/pinstripe/screenshots/mail/classic-view.png) - 标题宽度为100%,第一个窗格 - 左侧 - 高度 -全屏(除了标题,ofc),第二个窗格 - 右上 - 屏幕高度的50%(标题除外),右下角 - 屏幕高度的50%.窗格应该具有固定的高度 - 如果内容具有较大的高度,则应显示滚动条.现在我像这样:

#header {
    height:30px;  
}

#left {
    position: absolute;
    left: 0;
    width: 50%;   
}

#right-top {
    position: absolute;
    right: 0;
    width: 50%;
    height:50%;
    overflow: auto;
}

#right-bottom {
    position: absolute;
    right: 0;
    width: 50%;
    bottom: 1px;
    height:50%;   
}
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/MCC5E/

当前问题:左窗格不是全高,右窗格重叠右下窗格(可以在Firebug中查看).

有没有办法实现这样的布局?

html css

2
推荐指数
1
解决办法
344
查看次数