Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java &引用;前缀为空";尝试设置web服务客户端时出错_Java_Web Services_Wsdl_Rad_Qnames - Fatal编程技术网

Java &引用;前缀为空";尝试设置web服务客户端时出错

Java &引用;前缀为空";尝试设置web服务客户端时出错,java,web-services,wsdl,rad,qnames,Java,Web Services,Wsdl,Rad,Qnames,我有一个WSDL和一些用于生成JAX-WSWeb服务客户端的模式文件。当我尝试获取客户端实例时,我得到以下堆栈跟踪: Caused by: java.lang.IllegalArgumentException: The specified prefix was null. at com.ibm.xml.xlxp.api.stax.msg.StAXMessageProvider.throwIllegalArgumentException(StAXMessageProvider.java:4

我有一个WSDL和一些用于生成JAX-WSWeb服务客户端的模式文件。当我尝试获取客户端实例时,我得到以下堆栈跟踪:

Caused by: java.lang.IllegalArgumentException: The specified prefix was null. at com.ibm.xml.xlxp.api.stax.msg.StAXMessageProvider.throwIllegalArgumentException(StAXMessageProvider.java:42) at com.ibm.xml.xlxp.api.stax.XMLStreamReaderImpl.getNamespaceURI(XMLStreamReaderImpl.java:721) at com.ibm.xml.xlxp.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxy.getNamespaceURI(XMLInputFactoryImpl.java:212) at com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter.getNamespaceURI(XMLStreamReaderFilter.java:242) at com.sun.xml.internal.ws.wsdl.parser.ParserUtil.getQName(ParserUtil.java:78) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parsePortTypeOperationInput(RuntimeWSDLParser.java:721) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parsePortTypeOperation(RuntimeWSDLParser.java:694) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parsePortType(RuntimeWSDLParser.java:668) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:305) at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:136) at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:227) at com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:190) at com.sun.xml.internal.ws.client.WSServiceDelegate.(WSServiceDelegate.java:160) at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:92) at javax.xml.ws.Service.(Service.java:67) ... 不过,错误消息并不太清楚。在
“MyService”
之前是否需要前缀,或者是否需要对WSDL进行更改(我不是WSDL所有者,因此很难将更改推送到其他团队)


(WAS7.0的环境是RAD 7.5)

如果检查堆栈跟踪的详细信息,您会注意到问题在于WSDL中输入的端口类型操作的名称:

<wsdl:definitions .... > 
  <wsdl:portType .... >
    <wsdl:operation>
       <wsdl:input message="qname"/>    <--- your problem is here
    </wsdl:operation>
  </wsdl:portType >
</wsdl:definitions>


你说得对,这是一个端口类型的问题。所有操作的格式都是:
,它们都没有前缀。但是,我不认为前缀在这种情况下是必要的。只有在默认名称空间实际上是正确的情况下,前缀才是必要的。有趣。我为默认名称空间添加了名称空间前缀,然后添加了前缀,这样输入现在看起来像:
。重新生成客户端。完全相同的错误…但这是在运行时发生的,对吗?正在读取的WSDL不是用于生成客户端的WSDL,而是公共URL上可用的WSDL。请注意,所有这些都可能是IBM实现的一个错误,它可能是在错误的假设下工作的,即所有内容都将使用命名空间前缀。
<wsdl:definitions .... > 
  <wsdl:portType .... >
    <wsdl:operation>
       <wsdl:input message="qname"/>    <--- your problem is here
    </wsdl:operation>
  </wsdl:portType >
</wsdl:definitions>