如何在 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)