我正在运行 jboss-4.2.1.GA 来生成 WS 请求。
我在 JWSDP-2.0/JAXRPC 的帮助下创建了 WS 客户端。我已将客户端部署到 Jboss,现在我正在尝试发送请求。
当我尝试初始化客户端服务时:javax.xml.rpc.Service service = servicefactory.createService(new URL(wsdlURL), serviceQN)
,Jboss 开始提示。
Jboss 产生的错误是:
ERROR [JBossXSErrorHandler] JBossWS_targetnamespace1.com7796329154971783225.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve.4.2]::Message=src-resolve.4.2: Error resolving component 'tns2:SimpleSerialiser'. It was detected that 'tns2:SimpleSerialiser' is in namespace 'http://targetnamespace2.com', but components from this namespace are not referenceable from schema document 'file:/home/jbossPath/jboss-4.2.1.GA/server/default/tmp/jbossws/JBossWS_targetnamespace1.com7796329154971783225.xsd'. If this is the incorrect namespace, perhaps the prefix of 'tns2:SimpleSerialiser' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/home/jbossPath/mobaq/jboss-4.2.1.GA/server/default/tmp/jbossws/JBossWS_targetnamespace1.com7796329154971783225.xsd'.
后跟警告:
WARN [WSDL11Reader] Encoding style 'http://schemas.xmlsoap.org/soap/encoding/' not supported for: {urn:namespace}doTask
最后显示如下错误:
ERROR [STDERR] org.jboss.ws.WSException: Cannot obtain java type mapping for: {urn:namespace}ArrayOf_tns2_TagType ERROR [STDERR] at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildInputParameter(JAXRPCMetaDataBuilder.java:266) ... ...
我知道 similar error 过去曾在 community.jboss.org 中发布过,但用于不同的任务。我不确定所提供的补丁是否能解决我的问题,我也不知道如何实现所提供的补丁。
除此之外,我发现有人有类似的问题:JAX-RPC in JBoss 4.2.3但建议的解决方案对我不起作用。
我也知道 JbossWS 不支持 RPC/Encoded,但我使用 jboss 作为我的解决方案。 有没有办法解决这个问题,我不能让 Jboss 创建客户端服务来发送请求吗?我不确定请求 RPC/Literal WSDL 文件是否可行,所以这就是我问的原因。
如有任何建议,我们将不胜感激。
最佳答案
http://schemas.xmlsoap.org/soap/encoding/是非常古老的 Web 服务堆栈使用的遗留样式(太糟糕了,even Microsoft recommend against it)。它存在严重缺陷,因此被排除在WS-I interoperability spec之外。 ,这是大多数现代 Java Web 服务堆栈实现的。
据我所知,处理这些旧编码的唯一 Java 堆栈是 Axis 1 ,它本身存在严重缺陷,但可能是您唯一的选择。您应该能够从 JBoss 内部将 Axis 作为客户端运行。
关于java - RPC/Encoded Jboss 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2095847/