1
spring-ws 응용 프로그램의 soap 요청에서 soap body를 추출하려고합니다. 내 비누 요청 나는 다음과 같은 코드를 사용하여 비누 몸을 추출하려고Spring-WS : Soap Message Body를 추출하는 방법
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org /soap/envelope/" xmlns:sch="http://www.manager.cts.com/schema">
<soapenv:Header/>
<soapenv:Body>
<sch:addManagerRequest>
<sch:name>shivani</sch:name>
<sch:salary>1231231</sch:salary>
<sch:developer>
<sch:firstName>asd</sch:firstName>
<sch:lastName>asdasd</sch:lastName>
<sch:salary>123123</sch:salary>
</sch:developer>
</sch:addManagerRequest>
</soapenv:Body>
</soapenv:Envelope>
입니다 :
@Override
public boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception {
SoapMessage message = (SoapMessage) messageContext.getRequest();
SoapBody soapBody = message.getSoapBody();
Source bodySource = soapBody.getSource();
DOMSource bodyDomSource = (DOMSource) bodySource;
Node bodyNode = bodyDomSource.getNode();
System.out.println(bodyNode.getNodeValue());
System.out.println(bodyNode.getChildNodes());
}
출력은 다음과 같습니다
null
[soapenv:Body: null]
내가이 문제를 해결 도와주세요. 나는 봄에 익숙하지 않다.
감사합니다 많이. 효과가있다. – user2332505