我是使用 Web 服务的新手,我正在尝试使用 ws 客户端插件为第 3 方 Web 服务开发客户端。我尝试了文档中的示例,一切正常,但是当我尝试使用上述 Web 服务时,出现以下异常
| Error 2013-05-06 11:03:22,853 [http-bio-8080-exec-1] ERROR errors.GrailsExceptionResolver - DOMException occurred when processing request: [GET] /webgains/webgains/index
NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.. Stacktrace follows:
Message: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
Line | Method
->> 2530 | checkDOMNSErr in com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 117 | setName in com.sun.org.apache.xerces.internal.dom.AttrNSImpl
| 78 | <init> . . . . . . . . . . . . . . in ''
| 2142 | createAttributeNS in com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl
| 659 | setAttributeNS . . . . . . . . . . in com.sun.org.apache.xerces.internal.dom.ElementImpl
| 470 | serializeAttribute in org.apache.ws.commons.schema.XmlSchemaSerializer
| 832 | serializeComplexContentRestriction in ''
| 682 | serializeComplexContent in ''
| 903 | serializeComplexType . . . . . . . in ''
| 2400 | serializeSchemaChild in ''
| 1659 | serializeSchemaElement . . . . . . in ''
| 132 | serializeSchema in ''
| 478 | addSchemas . . . . . . . . . . . . in org.apache.cxf.endpoint.dynamic.DynamicClientFactory
| 316 | createClient in ''
| 235 | createClient . . . . . . . . . . . in ''
| 214 | createClient in ''
| 198 | createClient . . . . . . . . . . . in groovyx.net.ws.AbstractCXFWSClient
| 107 | initialize in groovyx.net.ws.WSClient
| 19 | getClient . . . . . . . . . . . . in org.grails.plugins.wsclient.service.WebService
| 10 | index in webgains.WebgainsController
| 195 | doFilter . . . . . . . . . . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 1110 | runWorker . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . . . . . . . . . . . . . in java.lang.Thread
我环顾四周,发现在某些情况下添加 xalan-2.7.0.jar 可以解决问题。我试过了,还是不行。
有任何想法吗?
编辑:
我正在使用以下代码:
def wsdlURL = "http://ws.webgains.com/aws.php"
def proxy = webService.getClient(wsdlURL)
def result = proxy.getFullUpdatedEarnings(new GregorianCalendar(),new GregorianCalendar(),1,"a","b")
在 webService.getClient(wsdlURL) 中抛出异常