繁体   English   中英

在Spring Boot SOAP端点中接收字符串

[英]Receive String in Spring Boot SOAP Endpoint

我需要在Spring-boot中创建一个Endpoint来接收SOAP请求,但是我需要该请求是Java String。 我有这样的事情:

配置:

@Bean(name = "myService")
    public DefaultWsdl11Definition receiveM2Definition(XsdSchema mySchema) {
        DefaultWsdl11Definition wsdl11Definition = new 
        DefaultWsdl11Definition();
        wsdl11Definition.setPortTypeName("testPort");
        wsdl11Definition.setLocationUri("/my");
        wsdl11Definition.setTargetNamespace("http://test/me");
        wsdl11Definition.setSchema(mySchema);
        return wsdl11Definition;
}

终点:

@PayloadRoot(
namespace       = "http://test/me", 
localPart       = "getMyRequest"
)
@ResponsePayload
    public JAXBElement<String> getReq(@RequestPayload 
JAXBElement<String> request) {
 .......   }

这个工作正常,但是我需要我的端点为我的客户端接收一个String而不是一个JAXBElement。 这可能吗? 提前致谢。

在我的Schema.xsd中这样做可以正常工作:

<!-- Operations -->
<xs:element name="getRequest" type="xs:string">
</xs:element>

<xs:element name="getResponse" type="xs:string">
</xs:element>

暂无
暂无

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

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