简体   繁体   中英

No endpoint mapping found for [SaajSoapMessage {http://com.springbootsoap.allapis}addProductRequest]

I have been having issues trying to get endpoint mapping to work for my web service. I am using Tomcat to host my web service and I am using soapUI to send test messages to it. 

Endpoint


@Endpoint
public class ProductEndpoint {
    
    private static final String NAMESPACE_URL="http://com.springbootsoap.allapis";
    
    @Autowired
    ProductService productService;
    
    @PayloadRoot(namespace = NAMESPACE_URL, localPart = "addProductRequest")
    @ResponsePayload
    public AddProductResponse addProduct(@RequestPayload AddProductRequest request) {
        
        AddProductResponse response= new AddProductResponse();
        ServiceStatus servicestatus=new ServiceStatus();
        
        Product product=new Product();
        
        BeanUtils.copyProperties(request.getProductInfo(),product);
        productService.addProduct(product);
        servicestatus.setStatus("Success");
        servicestatus.setMessage("Content Added Successfully");
        response.setServiceStatus(servicestatus);
        return response;
    }
    @PayloadRoot(namespace = NAMESPACE_URL, localPart = "getProductByIdRequest")
    @ResponsePayload
    public GetProductResponse GetProduct(@RequestPayload GetProductByIdRequest request) {
        GetProductResponse response=new GetProductResponse();
        ProductInfo productInfo=new ProductInfo();
        BeanUtils.copyProperties(productService.getProductById(request.getProductId()),productInfo);
        response.setProductInfo(productInfo);
        
        return response;
        
    }
}

SoapUI

enter image description here

here is what I got in soapUi.

I do not have any idea what should I do to make it correct, I saw many questions regarding this problem but did not find any solution.

I also had the same issue. At that time I change the version of java to 1.8 in pom.xml file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM