Forum Discussion

Aidan365's avatar
Aidan365
New Contributor
15 years ago

SoapUI : How to deal with DataHandler in WSDL ?

Hi,

I suspect this is a common problem, but after much searching on this and other forums I would really appreciate some help from the community here.

Basically I want to use SoapUI to test a WSLD which attempts to define a complex type that contains
<element name="in3" type="apachesoap:DataHandler"/>

Granted, I suspect this may be bad practice (to use DataHandler in the WSDL) but is there any way I can create a new SoapUI project from this wsdl without major refactoring of the WSDL or server-side webservice operations?

As you probably know, SoapUI currently will return : Error: type 'DataHandler@http://xml.apache.org/xml-soap' not found.

The webservice uses axis 1.3. We can run org/apache/axis/wsdl/WSDL2Java on the same WSDL, but really want to run SoapUI on the WSDL, hence this question.

I have looked into a few options with no success:
- Can I modify the schema definition part of my wsdl?
- Configure SoapUI to deal with (or ignore Datahandler)
- Provide the schema to SoapUI
- etc ?

At the moment I can generate test requests for the other operations if I save wsdl as a file and comment out the offennding DataHandler reference (or replace with type="xsd:string" etc.) but this is far from ideal.

Any help would be greatly appreciated. I have attached an example WSLD to illustrate the problem. It's not exactly same as my WSDL under test as that can't be shared here, but it highlights the problem. What options do I have, or can you point me to a good reference to solve this problem

Many Thanks,
Aidan

Note: I don't expect to be able to call the operations that have DataHandler (unless you think that is possible!?) but I'd really like to be able to generate a SoapUI project like I could before this complex type (with DataHandler) was added to the WSDL.

4 Replies

  • Aidan365's avatar
    Aidan365
    New Contributor
    Hi,

    This is still a problem. At this point any help would be greatly appreciated.

    I may not have been clear, but if SoapUI simply can't process the WSDL in it's current state, and suggestions on modifying the WSDL itself would be great. e.g. Do I need to import a schema, or define the DataHandler in the WSDL.

    Thanks again.
    Aidan
  • Hi Aidan,

    DataHandler is a platform-specific type, only used by Apache Soap

    This means that those APIs have to be called from Java using the Apache Soap jar, and not (eg) C++, .NET or SoapUI

    No platform other than Apache Soap is going to understand it. Apache Soap was a non-standards project that was abandoned in about 2002, and was superseded by Apache Axis; links from Apache Axis to Apache Soap in 2004 are dead, and Apache Soap has no web presence.

    Even though SoapUI is Java, it does not implement Apache Soap.

    I've compiled SoapUI from source, and it would not be easy to update to include an abandoned standard, even unofficially.

    SoapUI has hard-coded validation of the wsdl against the wc3 standards, and so DataHandler won't pass.

    I believe that you could continue to use DataHandler server-side, exposing it using MTOM and Base64Binary which IS a standard, but that there is no alternative to changing the wsdl extensively.

    Regards

    Paul
  • Got it.

    1. Copy this schema to a file, in an otherwise empty directory (I suggest directory = schema_directory, file dh.xsd) ..

    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema targetNamespace="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:simpleType name="DataHandler">
    <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    </xsd:schema>

    This lets SoapUI ignore DataHandler.

    2. In SoapUI, open File/Preferences

    3. Select the "WSDL Settings" tab

    4. Set "Schema Directory" to be your schema_directory

    The wsdl should now load from the url. However DataHandler for attachments functionality won't work.