问题列表 - 第15555页

Spring + SOAPExceptionImpl:保存多部分消息时出错

我有一个带有jsp页面的spring web应用程序,它调用不同的Web服务并在jsp页面中显示结果.spring web应用程序附带了用户名/登录spring security.

我正在添加一个处理安全性的Web服务的调用.对于WebServiceGateway,我添加了一个安全拦截器.(见下文)

<bean id="securityInterceptor"
    class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
    <property name="securementActions" value="UsernameToken Timestamp" />
    <property name="securementUsername" value="Bert" />
    <property name="securementPassword" value="Ernie" />
    <property name="timestampPrecisionInMilliseconds" value="true" />
</bean>
Run Code Online (Sandbox Code Playgroud)

当我将wss4j添加到我的pom文件中时,我现在在Web服务端出现以下错误:

[28-13:46:26]DEBUG: org.springframework.web.servlet.FrameworkServlet.processRequest(): Could not complete request [http-8080-2]
org.springframework.ws.soap.saaj.SaajSoapMessageException: Could not write message to OutputStream: Error during saving a multipart message; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
    at org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(SaajSoapMessage.java:163)
    at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:172)
    at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88)
    at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
    at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:230)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at …
Run Code Online (Sandbox Code Playgroud)

spring spring-ws wss4j

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

vb.net:清除字符串数组的所有内容

我有这个:

    Dim split As String() = temp_string.Split(",")

    ''#feed all info into global variables
    patient_id = split(0)
    doc_name = split(1)
    lot__no = split(2)
    patient_name = split(3)
Run Code Online (Sandbox Code Playgroud)

我该如何清除split()的所有内容?

vb.net

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

Vs类纯阵列表示

我们需要在我们的应用程序中代表大量数字.我们使用整数数组来做这个.最终的生产应该是性能最大化.我们考虑将数组封装在一个类中,这样我们就可以添加与数组相关的属性,如isNegative,numberBase等.

但是,我们担心使用课程会使我们的表现明智.我们做了一个测试,我们创建了一个固定数量的数组,并通过纯数组使用设置它的值,并创建一个类,并通过类访问数组:

for (int i = 0; i < 10000; i++)
{
    if (createClass)
    {
        BigNumber b = new BigNumber(new int[5000], 10);
        for (int j = 0; j < b.Number.Length; j++)
        {
            b[j] = 5;
        }
    }
    else
    {
        int[] test = new int[5000];
        for (int j = 0; j < test.Length; j++)
        {
            test[j] = 5;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

并且似乎使用类几乎将上述代码的运行时间减慢了6倍.我们通过将数组封装在结构中来尝试上述操作,这导致运行时间几乎等于纯数组使用.

与结构相比,使用类时导致这种巨大开销的原因是什么?当你使用堆栈而不是堆时,它真的只是你获得的性能提升吗?

编辑: BigNumber只将数组存储在属性公开的私有变量中.简化:

public class BigNumber{
  private int[] number;

  public BigNumber(int[] number) { this.number = …
Run Code Online (Sandbox Code Playgroud)

c# arrays performance code-design

0
推荐指数
1
解决办法
982
查看次数

如何使用ghci在lambda中编写数字

我是Haskell的新手,使用Ghci.

我有一个函数,叫做三,我想写成

let three =  \x->(\y->(x(x(x y)))) 
Run Code Online (Sandbox Code Playgroud)

好的,这很有效,但是当我尝试的时候

three (2+) 4
Run Code Online (Sandbox Code Playgroud)

这是行不通的.相反,我得到了一些"无法构造无限类型"的错误.

请帮我.

haskell ghci

0
推荐指数
1
解决办法
807
查看次数

WCF:无法满足安全令牌请求,因为身份验证失败

我在同一台机器上有两个WCF服务.一个是出版商,一个是听众.

发布者基于和端点动态创建代理.我在这样的代码中配置代理:

            WSHttpBinding binding = new WSHttpBinding(SecurityMode.Message, true);
            binding.Security.Message.NegotiateServiceCredential = true;
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
            binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
            binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
            binding.Security.Message.EstablishSecurityContext = true;
            binding.ReliableSession.Enabled = true;
            binding.TransactionFlow = true;
            return binding;
Run Code Online (Sandbox Code Playgroud)

然后...

            Binding binding = GetBindingFromAddress(address);

            ChannelFactory<T> factory = new ChannelFactory<T>(binding);
            factory.Credentials.UserName.UserName = "an account on the machine";
            factory.Credentials.UserName.Password = "a password for that account";

            T proxy = factory.CreateChannel(new EndpointAddress(address));
Run Code Online (Sandbox Code Playgroud)

当我去打电话时,我收到上述错误.这是我的监听器配置文件:

   <service behaviorConfiguration="MEX Enabled" name="InvoiceSubscriber">
<endpoint binding="wsHttpBinding"
          bindingConfiguration="ReliableTransactionalHTTP"
          contract="AtlanticBT.SubscriptionService.Contracts.v1.IAtlanticEvents">
 <identity>
  <dns value="localhost" />
 </identity>
</endpoint>
Run Code Online (Sandbox Code Playgroud)

        <bindings>
        <wsHttpBinding>
            <binding name="ReliableTransactionalHTTP" transactionFlow="true"> …
Run Code Online (Sandbox Code Playgroud)

c# wcf wshttpbinding channelfactory .net-3.5

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

PHP:从日期算起来接下来的13个日期?

我想获得一个日期加上接下来的13个日期的数组,以便从给定日期开始获得14天的日程安排.

这是我的功能:

$time = strtotime($s_row['schedule_start_date']); // 20091030
$day = 60*60*24;
for($i = 0; $i<14; $i++)
{
    $the_time = $time+($day*$i);
    $date = date('Y-m-d',$the_time);
    array_push($dates,$date);
}
Run Code Online (Sandbox Code Playgroud)

但它似乎重复了月份转换的日期..

这就是我得到的:

2009-10-30 | 2009-10-31 | 2009-11-01 | 2009-11-01 | 2009-11-02 | 2009-11-03 | 2009-11-04 | 2009-11-05 | 2009- 11-06 | 2009-11-07 | 2009-11-08 | 2009-11-09 | 2009-11-10 | 2009-11-11

请注意,重复2009-11-01.我想不通为什么?

我究竟做错了什么?

谢谢!!

php time php4 date

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

实体框架4与NHibernate

很多人已经在网上讨论过Entity Framework的第一个版本(也在stackoverflow上),很明显,当我们已经拥有像NHibernate这样的更好的替代品时,它不是一个好的选择.但我找不到实体框架4和NHibernate的良好比较.我们可以说今天NHibernate是所有.NET ORM中的领导者,但是我们可以期待Entity Framework 4从这个位置取代NHibernate.我认为如果微软真的在EF4中注入了非常好的功能,它可以给NHibernate带来很好的竞争,因为它具有Visual Studio集成,更易于使用,并且在大多数商店中总是优先考虑MS产品.

.net nhibernate orm entity-framework

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

Scintilla .NET - 找不到库

我正在努力让Scintilla .NET以我正在制作的C#形式工作.我按照自述文件中提供的指示,例如将Scintilla组件添加到工具箱中,但是当我尝试将组件拖到C#表单时,我得到以下错误:http: //tinypic.com/r/152m7wx/ 4

我已将两个包括dll(SciLexer.dll,ScintillaNET.dll)放在我的system32文件夹中.我似乎无法弄清楚出了什么问题.

我正在使用VS 2008和Windows 7.

任何想法为什么我会得到一个文件未找到错误?

c# scintilla visual-studio-2008

7
推荐指数
2
解决办法
3659
查看次数

vb.net:从"a123"到"b123"提取字符串

我有一个看起来像这样的字符串:

sodjfoisdfsdf sdofij sodiosifosf fsdi a123 sdfoi sdofi osdi foi sdofd oi b123 sdfoijsfdoifsdiosfdoifsoifsdofjssfdoji

我如何从a123到b123提取所有内容?

vb.net

0
推荐指数
1
解决办法
1086
查看次数

提取数据网页

伙计们,我正在尝试使用C#从网页中提取数据..目前我使用了WebReponse中的Stream,并将其解析为一个大字符串.这是漫长而痛苦的.有人知道从网页中提取数据的更好方法吗?我说WINHTTP但不适合c#..

.net c#

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