Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 带有Spring的JAX-WS——can';t执行方法_Java_Spring_Web Services_Soap_Jax Ws - Fatal编程技术网

Java 带有Spring的JAX-WS——can';t执行方法

Java 带有Spring的JAX-WS——can';t执行方法,java,spring,web-services,soap,jax-ws,Java,Spring,Web Services,Soap,Jax Ws,我读了《春天在行动》一书。在这一章中,您可以看到如何将远程处理与Spring结合使用。我决定采用后一种选择——JAX-WS。我在书中做了所有这些,但我无法执行方法(在链接中留出空间): ServerSOAPFaultException:客户端从服务器接收到SOAP错误:找不到{http://service.client1.mrchebik.ru/}getHelloWorld的分派方法请查看服务器日志以查找有关故障确切原因的更多详细信息 因此,我有以下服务端点: @Component @WebSe

我读了《春天在行动》一书。在这一章中,您可以看到如何将远程处理与Spring结合使用。我决定采用后一种选择——JAX-WS。我在书中做了所有这些,但我无法执行方法(在链接中留出空间):

ServerSOAPFaultException:客户端从服务器接收到SOAP错误:找不到{http://service.client1.mrchebik.ru/}getHelloWorld的分派方法请查看服务器日志以查找有关故障确切原因的更多详细信息

因此,我有以下服务端点:

@Component
@WebService(serviceName = "exampleService")
public class ExampleServiceEndpoint {
@Autowired
private ExampleService exampleService;

@WebMethod
public String getHelloWorld() {
    return exampleService.getHelloWorld();
}

@WebMethod
public String getMessage(String message) {
    return exampleService.getMessage(message);
}

@WebMethod
public String calculate(String condition) {
    return exampleService.calculate(condition);
}
}

以及设置JAX导出器:

@Bean
public SimpleJaxWsServiceExporter jaxWsServiceExporter() {
    SimpleJaxWsServiceExporter jaxWsServiceExporter = new SimpleJaxWsServiceExporter();
    jaxWsServiceExporter.setBaseAddress("http://localhost:10000/ws/");

    return jaxWsServiceExporter;
}
在客户端,我有以下设置:

@Bean
public JaxWsPortProxyFactoryBean exampleService() throws IOException {
    JaxWsPortProxyFactoryBean proxyFactoryBean = new JaxWsPortProxyFactoryBean();
    proxyFactoryBean.setWsdlDocumentUrl(new URL("http://localhost:10000/ws/exampleService?wsdl"));
    proxyFactoryBean.setServiceName("exampleService");
    proxyFactoryBean.setPortName("ExampleServiceEndpointPort");
    proxyFactoryBean.setServiceInterface(ExampleService.class);
    proxyFactoryBean.setNamespaceUri("http://endpoint.service.client0.mrchebik.ru/");

    return proxyFactoryBean;
}
所以,当我试图从服务器输出hello world时,我得到了异常,这是在本主题的开头考虑的

这是一个wsdl:

解决方案:

怎么注意到@efekctive,在这方面也有同样的问题。所以,我明白了,问题大概是由于名称空间,而它没有使用Spring。 我决定将接口更改为客户端(client1)

发件人:

致:


运行之后,我从服务器获取数据

异常具有uri…client1。。您的代码有…client0…因为client0--server和client1--clienthmm。。。我怎样才能在我的事业中解决这个问题?我有这个链接:
http://service.client1.mrchebik.ru/
,但我需要
http://endpoint.service.client0.mrchebik.ru/
?@efekActive谢谢!我在我的帖子里写了一个解决方案。
@WebService
public interface ExampleService {
    String getHelloWorld();
    String getMessage(String message);
    String calculate(String condition);
}
@WebService(targetNamespace = "http://endpoint.service.client0.mrchebik.ru/")
public interface ExampleService {
    String getHelloWorld();
    String getMessage(String message);
    String calculate(String condition);
}