在Spring-ws SOAP Web服务中找不到端点

时间:2015-05-14 09:27:03

标签: soap wsdl spring-ws endpoint

我正在尝试使用Spring-ws创建Web服务。它部署在tomcat 7上。当我通过SOAP UI请求Web服务时,我在响应帧中没有收到任何内容(RAW:HTTP / 1.1 404 Not Found Server:Apache-Coyote / 1。1日期:星期四,2015年5月14日09:00:29 GMT内容长度:0)。

TomCat日志文件中有下一个信息:

14.05.2015 11:44:02.719 ws.server.EndpointNotFound [WARN]找不到[SaajSoapMessage {http://abc.mayacomp.com.ru/power-appl} internalHistRequest]的端点映射

My Endpoint类看起来像:

package com.mayacomp.endpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;

import com.mayacomp.mayaserv.InternalHistRequest;
import com.mayacomp.mayaserv.InternalHistResponse;
import com.mayacomp.services.PAppService;


@Endpoint
public class WsEndpoint {


    private static final String TARGET_NAMESPACE = "http://abc.mayacomp.com/power-appl";

    @Autowired 
    public PAppService PAppService_i;
    @PayloadRoot(localPart = "interHistRequest", namespace = TARGET_NAMESPACE)
    public @ResponsePayload interHistResponse getinterHist(@RequestPayload interHistRequest request) {
           interHistResponse _return = new interHistResponse();
          _return.setClientID(new java.math.BigInteger("428239 22945935239155481381"));   
          try
          {
          /*stubs for return obeject */            
            return _return;
          }
       catch (java.lang.Exception ex) {
        ex.printStackTrace();
        throw new RuntimeException(ex);
    }
    }
          public void setPAppService(PAppService PAppService_p)
    {
    this.PAppService_i = PAppService_p;
    }
}  

弹簧config.xml中:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:sws="http://www.springframework.org/schema/web-services"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
                            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                            http://www.springframework.org/schema/web-services
                            http://www.springframework.org/schema/web-services/web-services-2.0.xsd
                            http://www.springframework.org/schema/context
                            http://www.springframework.org/schema/context/spring-context-3.0.xsd">


    <context:component-scan base-package="com.mayacomp.services"/> 
    <!--<context:component-scan base-package="com.mayacomp.endpoint"/>--> 
    <sws:annotation-driven />

    <bean id="interCreditService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
        <property name="schemaCollection">
            <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
                <property name="inline" value="true" />
                <property name="xsds">
                    <list>
                        <value>schemas/power-appl.xsd</value>
                    </list>
                </property>
            </bean>
        </property>
        <property name="portTypeName" value="interCreditService"/>
        <property name="serviceName" value="PowerApplServices" />
        <property name="locationUri" value="/endpoints"/>
    </bean>
</beans>

SOAP请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pow="http://abc.mayacomp.com/power-appl" xmlns:end="http://localhost:8080/abc-power-appl-ws/endpoints" xmlns:abc="http://localhost:8080/abc-power-appl-ws">
   <soapenv:Header/>
   <soapenv:Body>
      <pow:interHistRequest>
         <pow:requestHeader>
            <pow:requestUID>?</pow:requestUID>
            <pow:requestTimestamp>?</pow:requestTimestamp>
            <pow:systemID>?</pow:systemID>
         </pow:requestHeader>
         <pow:clientID>?</pow:clientID>
      </pow:interHistRequest>
   </soapenv:Body>
</soapenv:Envelope>

如何设置返回响应的服务并避免无端点映射错误?

0 个答案:

没有答案