Gourab Sarkar
Gourab Sarkar

Reputation: 80

wslite SOAPClient.send()

I am using wslite(groovy-wslite-0.8.0.jar) from groovy to call a soap service.

Request: (String) SOAP XML-Request

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

The above code was working till today morning and now causing exception without any code changes.

I am getting an exception like:

[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)

What could be the possible solution for this

Upvotes: 1

Views: 1655

Answers (1)

sensei
sensei

Reputation: 621

Have you tried client.allowDocTypeDeclaration = false before calling send()? It looks like SOAPClient passes this property to XmlSlurper on instanciating it, and it is set to true by default (see SOAPClient.groovy).

Upvotes: 1

Related Questions