如何在Delphi Web服务中创建复杂类型,特别是soapenc:Array,在与使用它的类型定义相同的命名空间中可用。目前,如果我尝试使用Delphi应用程序生成的wsdl在Java中创建新的Web服务,Java会出现以下错误:
Error resolving component 'soapenc:Array'. It was detected that 'soapenc:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document...........
如果我分析wsdl,我的所有方法和类型都使用namepsace'targetNamespace =“urn:WebserviceIntf”',但使用soapenc:Array的类型定义如下:
<xs:complexType name="ArrayOfClientDetailAcc">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence/>
<xs:attribute xmlns:n1="http://schemas.xmlsoap.org/wsdl/" ref="soapenc:arrayType" n1:arrayType="ns2:TClientDetailAccArray[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
如果无法改变这种情况,我将非常感谢您提供有关在Java中复制我的Delphi Web服务而不改变界面的最佳方法的建议,这会破坏连接到它的客户端。
感谢您的帮助!
我已尝试按照建议的链接使用Axis,但也会出错:
C:\axis>java org.apache.axis.wsdl.WSDL2Java http://mywebservice?wsdl
- Unable to find required classes (javax.activation.DataHandler and javax.mail.i
nternet.MimeMultipart). Attachment support is disabled.
WSDLException (at /definitions/binding/operation[1]/input): faultCode=INVALID_WS
DL: Element '{http://schemas.xmlsoap.org/wsdl/}input' contained unexpected attri
butes: 'message':
at com.ibm.wsdl.util.xml.DOMUtils.throwWSDLException(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseBindingInput(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseBindingOperation(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseBinding(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:516)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Unknown Source)
答案 0 :(得分:0)
抱歉 - 基于您的评论(“在Netbeans中,使用”来自WSDL的新Web服务“),很明显您不想创建Java Web服务客户端而是创建Web服务服务器。所以我的回答当然没有用。
另请参阅:Delphi SOAP Server - Document/Literal - Possible?
要解决这个问题,一个解决方案是:
然后
或
然而,这两种方式都会使您的新服务与旧的Delphi客户端不兼容。
答案 1 :(得分:0)
同样在maven axistools:1.4
。旧的wsdl4j
&lt; = 1.5.3抛出此异常。升级到至少1.6.1
或等待更新的netbeans。