开发者

SoapUI API: WsdlProject unable to load a 'composite' project

开发者 https://www.devze.com 2023-03-06 13:47 出处:网络
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-Direct

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.ja开发者_Go百科va: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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号