我知道什么是//Start and configure server 1.
IWebHostBuilder server1 = new WebHostBuilder()
.UseStartup < Project1.Startup > ()
.UseKestrel(options => options.Listen(IPAddress.Any, 80))
.UseConfiguration(new ConfigurationBuilder()
.AddJsonFile("appsettings_server1.json")
.Build()
);
TestServer testServer1 = new TestServer(server1);
//Get HttpClient that's able to connect to server 1.
HttpClient client1 = server1.CreateClient();
IWebHostBuilder _server2 = new WebHostBuilder()
.UseStartup < Project2.Startup > ()
.ConfigureTestServices(
services => {
//Inject HttpClient that's able to connect to server 1.
services.AddSingleton(typeof(HttpClient), client1);
})
.UseKestrel(options => options.Listen(IPAddress.Any, 81))
.UseConfiguration(new ConfigurationBuilder()
.AddJsonFile("appsettings_server2.json")
.Build()
);
TestServer testServer2 = new TestServer(server2);
错误...但是我不知道为什么会发生。
我正在使用wss4j对带有证书的请求进行签名,但是当我发出请求时,应用程序会因以下错误而失败:
java.lang.NoClassDefFoundError
GatewayController类中的第92行是对java.lang.NoClassDefFoundError: org/apache/jcp/xml/dsig/internal/dom/DOMSignatureMethod$SHA1withRSA
at org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.newSignatureMethod(DOMXMLSignatureFactory.java:262)
at org.apache.ws.security.message.WSSecSignature.computeSignature(WSSecSignature.java:508)
at org.apache.ws.security.action.SignatureAction.execute(SignatureAction.java:114)
at org.apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java:232)
at org.springframework.ws.soap.security.wss4j.Wss4jHandler.doSenderAction(Wss4jHandler.java:120)
at org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor.secureMessage(Wss4jSecurityInterceptor.java:546)
at org.springframework.ws.soap.security.AbstractWsSecurityInterceptor.handleRequest(AbstractWsSecurityInterceptor.java:210)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:596)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390)
at com.mpay.hub.pagos.controllers.GatewayController.getSession(GatewayController.java:92)
的调用,我知道这是一个依赖项混合/缺失问题,请帮助我解决。这是我的org.springframework.ws.client.core.WebServiceTemplate
pom.xml
在“依赖关系”树中,我可以看到库中的类