我有一個(gè) SOAP Web 服務(wù)。我嘗試在我的請求中傳遞實(shí)體?;愋停òㄗ址┱鬟f。但是,如果我想發(fā)送實(shí)體,我的實(shí)體是空的。我可能有什么問題嗎?所有類都是由 maven 生成的。TestUserRequest package soap.test.spring_boot_soap_example;import javax.xml.bind.annotation.*;@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "", propOrder = { "user"})@XmlRootElement(name = "testUser")public class TestUserRequest { @XmlElement(required = true) private User user; public User getUser() { return user; } public void setUser(User name) { this.user = name; }}getters/setters用戶package soap.test.spring_boot_soap_example;import javax.xml.bind.annotation.XmlAccessType;import javax.xml.bind.annotation.XmlAccessorType;import javax.xml.bind.annotation.XmlElement;import javax.xml.bind.annotation.XmlType;@XmlAccessorType(XmlAccessType.FIELD)@XmlType(name = "user", propOrder = { "name", "empId", "salary"})public class User { @XmlElement(required = true) protected String name; @XmlElement(required = true) protected int empId; @XmlElement(required = true) protected double salary;getters/setters;端點(diǎn) package soap.test.springbootsoapexample.endpoint;import soap.test.spring_boot_soap_example.TestUserRequest;import org.springframework.ws.server.endpoint.annotation.Endpoint;import org.springframework.ws.server.endpoint.annotation.PayloadRoot;import org.springframework.ws.server.endpoint.annotation.RequestPayload;@Endpointpublic class UserEndpoint { @PayloadRoot(namespace = "http://soap.test", localPart = "testUser") public void testUser(@RequestPayload TestUserRequest saveUserRequest) { System.out.println(saveUserRequest.getUser()); }}
春季 WS.肥皂請求為空
30秒到達(dá)戰(zhàn)場
2022-08-17 10:46:20