简体   繁体   English

为什么程序在通过Soap Service进行调用时返回无法识别的回调

[英]Why is program returning Unrecognised Callback while making Call through Soap Service

I have a new spring boot application that is attempting to make a soap call by extending Springs WebServiceGatewaySupport class, but receive "Unrecognised Callback" error. 我有一个新的spring启动应用程序试图通过扩展Sp​​rings WebServiceGatewaySupport类来进行soap调用,但是收到“无法识别的回调”错误。

I've tried modifying my getWebService method to use different varieties of getWebServiceTemplate implementations but continue to receive the error. 我已经尝试修改我的getWebService方法以使用不同种类的getWebServiceTemplate实现,但继续收到错误。

public class SOAPConnector extends WebServiceGatewaySupport {

    public Object callWebService(String url, Object request) {
        setInterceptor();
        setMarshallerAndUnmarshaller();


    //      return getWebServiceTemplate().marshalSendAndReceive(url, request);

        return getWebServiceTemplate().marshalSendAndReceive(
                url, request, new WebServiceMessageCallback() {

                    @Override
                    public void doWithMessage(WebServiceMessage message) throws IOException, TransformerException {
                        logger.info(message);

                    }
                });
    }

    public void setInterceptor() {
        Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
        interceptor.setSecurementActions("UsernameToken Timestamp");
        interceptor.setSecurementUsername("username");
        interceptor.setSecurementPassword("password");
        interceptor.setSecurementUsernameTokenNonce(true);
        this.setInterceptors(new ClientInterceptor[]{interceptor});
    }

    public Jaxb2Marshaller marshaller() {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setContextPath("com.widget.api.job");
        return marshaller;
    }

    public void setMarshallerAndUnmarshaller() {
        this.setMarshaller(marshaller());
        this.setUnmarshaller(marshaller());
    }
}

Here's a few lines from the stacktrace: 这是堆栈跟踪的几行:

org.springframework.ws.soap.client.SoapFaultClientException: Unrecognised Callback; nested exception is: 
javax.security.auth.callback.UnsupportedCallbackException: Unrecognised Callback
at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:38)
at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:830)
at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:624)
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555)
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390)
at com.test.service.SOAPConnector.callWebService(SOAPConnector.java:23)
at com.test.service.ClientImpl.springCall(ClientImpl.java:77)
at com.test.service.ClientImpl.previewDocument(ClientImpl.java:102)
at com.test.processor.ProcessorImpl.processEvent(ProcessorImpl.java:61)
at com.test.service.ServiceImpl.processMessage(ServiceImpl.java:33)
at com.test.controller.Endpoint.test(Endpoint.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.ws.server.endpoint.MethodEndpoint.invoke(MethodEndpoint.java:134)
at org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter.invokeInternal(DefaultMethodEndpointAdapter.java:291)
at org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter.invoke(AbstractMethodEndpointAdapter.java:55)
at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:236)
at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:176)
at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:89)
at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:61)
at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:293)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

Turns out this was a data related issue. 事实证明这是一个与数据相关的问题。 For some reason the sever was returning back this generic message. 由于某种原因,服务器返回此通用消息。 Seems like it was doing some sort of validation or something, not absolutely sure. 似乎它正在进行某种验证或某种东西,而不是绝对肯定。 But I updated some of the info being passed and it's working now. 但我更新了一些传递的信息,现在正在运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Reactive Spring WebClient - 进行 SOAP 调用 - Reactive Spring WebClient - Making a SOAP call 如何从 Spring Boot 调用 SOAP 服务 - How to call SOAP service from Spring boot Spring Boot 2异步进行调用但不返回响应 - Spring Boot 2 Async making the call but not returning a response 获取 java.io.IOException:获取服务帐户的访问令牌时出错:调用数据存储时连接超时 - Getting java.io.IOException: Error getting access token for service account: connect timed out while making a call to datastore 单元测试-如何使用Spring MockMVC调用Soap服务 - Unit tests - How to use Spring MockMVC to call soap service 在SpringBoot客户端中使用WebServiceTemplate进行SOAP Web服务调用 - SOAP web service call using WebServiceTemplate in SpringBoot client 建议:从我的服务并行调用另一个微服务 - Suggestion : Making parallel call from my service to another micro service 如何在从 spring 集成调用 SOAP 服务时添加超时 - How to add timeout while calling SOAP Service from spring integration 使用 spring boot # SOAP 服务调用多个并行调用 SOAP 服务 - Calling multiple parallel call to SOAP services using spring boot # SOAP Service 从后台运行引导服务程序的命令(通过命令行) - Command to run boot service program from background (through command line)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM