5

We are using SoapUI's APIs for running automatic tests during our build. I tried changing our project to be a composite project ( meaning it is not a single XML file but a Directory with a Sub-Directory per Test Case). Ever since that I'm receiving this error when trying to load the project:

Error at line 1, column 1
   org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA
   at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3486)
   at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1276)
   at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1263)
   at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
   at com.eviware.soapui.config.SoapuiProjectDocumentConfig$Factory.parse(Unknown Source)
   at com.eviware.soapui.impl.wsdl.WsdlProject.loadProject(WsdlProject.java:297)
   at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:212)
   at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:179)
   at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:174)
   at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:159)

This is the code I use to cause this exception (excerpt):

SoapUI.setSoapUICore(new StandaloneSoapUICore(true));
WsdlProject project = new WsdlProject(pathToProjectRoot);

Has anyone experienced it and knows how to solve it? I did not find any indication about this in Eviware's forum.

RonK
  • 9,472
  • 8
  • 51
  • 87
  • I suppose you have seen this: http://stackoverflow.com/questions/1407101/what-does-the-org-apache-xmlbeans-xmlexception-with-a-message-of-unexpected-elem ? – fretje May 19 '11 at 07:54
  • @fretje - I haven't seen it, but I'm very familiar with the approach. In this case I feel it is a mistake to use it since the input is valid. Using the `SoapUI Tool` has no problem in opening the input. Using the `SoapUI API` fails to do so. It seems to me like a configuration/API usage problem - not the input. – RonK May 19 '11 at 08:05
  • and this one http://www.soapui.org/forum/viewtopic.php?f=13&t=6410&p=19376#p18930 ? (it doesn't seem solved, but it points to a potential bug in SoapUI). – fretje May 19 '11 at 08:11
  • @fretje - Indeed, I just ran into it myself. Seems like it has been open for several months with not being resolved. I'll try to download the newest version (should be v4) and try with it instead. – RonK May 19 '11 at 08:18
  • 1
    Just saw that v3.6.1 is still the latest and the user who posted the question tried it. I guess I'll have to remain with a non-composite project for the time being ... – RonK May 19 '11 at 08:20

1 Answers1

2

After much frustration I tried the old trial and error approach - creating an empty project and trying to load it - even that failed.

After remembering that on a different post I got to know that SoapUI has two Javadoc sections - Regular and Pro - I checked the Pro javadoc for clues.

I immediately noticed that there is a class named WsdlProjectPro that can load a project. In our code, we used the following:

project = new WsdlProject(pathToSoapUiProject);

Changing it to be:

project = new WsdlProjectPro(pathToSoapUiProject);

Solved the problem immediately.

It appears that the Composite project is a Pro only feature - so only the WsdlProjectPro can load it.

Community
  • 1
  • 1
RonK
  • 9,472
  • 8
  • 51
  • 87