wslite SOAPClient.send()

时间:2016-10-05 14:13:52

标签: soap groovy soap-client doctype

我正在使用来自 groovy wslite (groovy-wslite-0.8.0.jar)来调用肥皂服务。

请求:(字符串)SOAP XML-Request

def client = new SOAPClient(URL)
response = client.send(requestSOAPBody)

上面的代码工作到今天早上,现在导致异常而没有任何代码更改。

我得到一个例外:

[Fatal Error] :1:10: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
wslite.soap.SOAPClientException: 500 Internal Server Error
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
            at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
            at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:202)
            at wslite.soap.SOAPClient.generateSOAPFaultException(SOAPClient.groovy:118)
            at wslite.soap.SOAPClient.this$2$generateSOAPFaultException(SOAPClient.groovy)
            at wslite.soap.SOAPClient$this$2$generateSOAPFaultException$10.callCurrent(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
            at wslite.soap.SOAPClient.send(SOAPClient.groovy:59)

这可能是什么解决方案

1 个答案:

答案 0 :(得分:1)

在致电client.allowDocTypeDeclaration = false之前,您是否尝试过send()?看起来SOAPClient在实例化时将此属性传递给XmlSlurper,默认情况下它设置为true(参见SOAPClient.groovy)。