简体   繁体   English

Delphi Web服务中的复杂类型

[英]Complex types in Delphi web service

How do I make complex types in a Delphi webservice, specifically soapenc:Array, available within the same namespace as the type defintions that use it. 如何在Delphi Web服务中创建复杂类型,特别是soapenc:Array,在与使用它的类型定义相同的命名空间中可用。 Currently if I try create a new webservice in Java from the wsdl generated from the Delphi app, Java gives the following error: 目前,如果我尝试使用从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...........

If I analyse the wsdl, all my method and types use the namepsace 'targetNamespace="urn:WebserviceIntf"' but the types using soapenc:Array are defined as follows: 如果我分析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>

If it's not possible to change this, I would appreciate advise on the best approach to duplicating my Delphi webservice in Java without changing the interface at all, which would disrupt our clients that connect to it. 如果不可能改变这一点,我将非常感谢建议在不改变界面的情况下在Java中复制我的Delphi web服务的最佳方法,这会破坏连接到它的客户端。

Your help is appreciated! 非常感谢您的帮助!

I've tried using Axis as per the link suggested but that also gives an error: 我已经尝试按照建议的链接使用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)

Sorry - based on your comment ("in Netbeans, using the "New web service from WSDL"") it is clear that you do not want to create a Java web service client but a web service server. 抱歉 - 基于您的评论(“在Netbeans中,使用”来自WSDL的新Web服务“),很明显您不想创建Java Web服务客户端而是创建Web服务服务器。 So my answer is not helpful of course. 所以我的回答当然没有用。


See also: Delphi SOAP Server - Document/Literal - Possible? 另请参阅: Delphi SOAP服务器 - 文档/文字 - 可能吗?

To solve this problem, one solution would be: 要解决这个问题,一个解决方案是:

  • implement a new web service server with C# (WCF) or Java (JAX-WS) 使用C#(WCF)或Java(JAX-WS)实现新的Web服务服务器

and then 接着

  • build a simple messaging layer between your existing Delphi app and the web service 在现有的Delphi应用程序和Web服务之间构建一个简单的消息传递层

or 要么

Both ways however will make your new service incompatible with old Delphi clients. 但是,这两种方式都会使您的新服务与旧的Delphi客户端不兼容。

Same in maven axistools:1.4 . 同样在maven axistools:1.4 This exception is thrown by an old wsdl4j <= 1.5.3. wsdl4j <= 1.5.3抛出此异常。 Upgrade to at least 1.6.1 or wait for a newer netbeans. 升级到至少1.6.1或等待更新的netbeans。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM