SOAP 인터페이스에서 String 객체를 반환하기 만하면됩니다. 반환 값으로 XML을 String으로 반환하면 클라이언트는 원하는 방식으로 XML을 사용할 수 있습니다. 클라이언트 측이 때문에 XML의 자바 객체를 원하는 경우
, 그것은 물론 그 작업이 같은 것을 사용할 수 있습니다
String responseXml = WebServiceStuff.getXmlFromWebservice(); // this is your webservice
try
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
// factory.setNamespaceAware(true); // if you need it
// factory.setValidating(true); // if you need it
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(responseXml);
Node rootNode = document.getDocumentElement();
// do something more with the XMLDocument
}
catch (Exception e)
{
// handle exception that happend while building the DOM
}
을 나는 SOAP에 String 변수에 XML을 반환하는 경우 응답은 xml 문자열이 내에 포함되는 반면, 문자열을 CDATA로 묶지 않고 부모 응답 태그 바로 아래에 넣기를 원합니다. – user1754530
어느 도서관을 이용하십니까? 서비스를 어떻게 구현했는지 몇 가지 코드를 게시하는 방법은 무엇입니까? – Akku