开发者

GPathResult to org.w3c.dom.Node

开发者 https://www.devze.com 2023-03-01 13:14 出处:网络
This might be a very simple, but I\'ll ask anyway. I have the following code that does a post to a web service. I am using HttpBuilder to build the request and post the payload. The method returns a

This might be a very simple, but I'll ask anyway.

I have the following code that does a post to a web service. I am using HttpBuilder to build the request and post the payload. The method returns a GPathResult that I need to change into a org.w3c.dom.Node

I am using the Node for xpath evaluation, and need the result to be a org.w3c.dom.Node.

def开发者_高级运维 responseXml
def onResponseHandler = { resp, content ->
            def soapResponse = content instanceof java.io.InputStreamReader ? content.getText() : content
            responseXml = soapResponse.Body
        }

http.post(body: payload, headers: ['Content-Type:': 'text/xml'], onResponseHandler)

return responseXml

I've searched quite extensively for this, but couldn't figure it out. Any ideas?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号