这几乎不是一个复杂的函数!!
import wslite.soap.SOAPClient
import wslite.soap.*
import groovy.xml.Namespace
proxy = new SOAPClient("http://www.predic8.com:8080/crm/CustomerService?wsdl")
/*
// THIS WORKS
list = proxy.send(
'''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ns="http://predic8.com/wsdl/crm/CRMService/1/">
<soapenv:Header/>
<soapenv:Body>
<ns:get>
<id>99</id>
</ns:get>
</soapenv:Body>
</soapenv:Envelope>'''
)
*/
//return list.getText()
//THIS DOES NOT
list = proxy.send(SOAPAction:'http://www.predic8.com:8080/crm/CustomerService'){
body{
get(xmlns:ns="http://predic8.com/wsdl/crm/CRMService/1/"){
id(99)
}
} //end body
} //end proxy
return list.getText()有没有人能弄明白为什么?
发布于 2013-07-19 00:39:54
属性应该作为Map传递,因此对代码所做的以下更改应该有效。
...
'ns:get'('xmlns:ns': "http://predic8.com/wsdl/crm/CRMService/1/"){
...或
...
get('xmlns': "http://predic8.com/wsdl/crm/CRMService/1/"){
...https://stackoverflow.com/questions/17728656
复制相似问题