简体   繁体   中英

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. Currently if I try create a new webservice in Java from the wsdl generated from the Delphi app, Java gives the following error:

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:

<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.

Your help is appreciated!

I've tried using Axis as per the link suggested but that also gives an error:

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. So my answer is not helpful of course.


See also: Delphi SOAP Server - Document/Literal - Possible?

To solve this problem, one solution would be:

  • implement a new web service server with C# (WCF) or Java (JAX-WS)

and then

  • build a simple messaging layer between your existing Delphi app and the web service

or

Both ways however will make your new service incompatible with old Delphi clients.

Same in maven axistools:1.4 . This exception is thrown by an old wsdl4j <= 1.5.3. Upgrade to at least 1.6.1 or wait for a newer netbeans.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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