Search code examples
soapwsdlsoapuinusoapcomplextype

Soap UI doesn't recognize complex type


I've been in a project and we developed and are using a php NuSOAP web service. I was going to use SoapUI software to test it. But the problem is while creating a new project in SoapUI, after entering the address of the initial WSDL, it says:

Error loading WSDL

There was something wrong with the WSDL you are trying to import.

It's working fine, the problem is only with SoapUI.

The error took it's source from the following complex types:

$server->wsdl->addComplexType(
   'stringArray',
   'complexType',
   'array',
   '',
   'SOAP_ENC:Array',
   array(),
   array(
      array('ref' => 'SOAP-ENC:arrayType',
            'wsdl:arrayType' => 'xsd:string[]')
   ),
   'xsd:string'
);

$server->wsdl->addComplexType(
   'stringMatrix',
   'complexType',
   'array',
   '',
   'SOAP_ENC:Array',
   array(),
   array(
      array('ref' => 'SOAP-ENC:arrayType',
            'wsdl:arrayType' => 'tns:stringArray[]')
   ),
   'tns:stringArray'
);

When I checked the error log, I saw:

org.apache.xmlbeans.XmlException: Invalid QName value: Can't resolve prefix 'SOAP_ENC'

As I said before, the service itself works just fine. But I'm supposed to test it with this software and just can't figure out why it gave an error.

What am I missing, what should I do to make it work?


Solution

  • The problem was a very silly tiny thing. 'SOAP_ENC' should be 'SOAP-ENC', with a dash, not an underscore. It was working fine so I was tricked. I'm sorry.