model error: element "{http://...}foo" not found

As I got some reply off-line, on my previous post, it's time to gives the explanation for the first invalid WSDL.

First, here is my ANT script (build.xml), that can be used to validate any WSDL in JDeveloper 10.1.3:
<project name="blog-demo" default="all" basedir="." xmlns:o="antlib:oracle">
<property file="build.properties"/>
<target name="analyze">
<o:analyze wsdl="http://www.rajkovic.org/ws/wsdl/bads/annotatedBank.wsdl"/>
</target>
</project>
and the output
analyze:
model error: element "{http://ws.rajkovic.org/demo/annotatedBank}create-account" not found.
In annotatedBank.wsdl, there is a missing element: <types>. The <schema> element cannot be a direct child of the <definitions> element. In my broken sample, the schema is invisible, and therefore the element 'create-account' cannot be found. Check the valid WSDL.

To challenge your knowledge, here is another broken WSDL: http://www.rajkovic.org/ws/wsdl/bads/annotatedBank2.wsdl . This is another common error that you may encounter while trying to author WSDL files by hand.

Let see who can find the error...

Comments

Anonymous said…
What is the error point in annotatedBank2.wsdl, Seems I made a same mistake.
Pls contract me via email.thanks.
zhujiawei1122@gmail.com
Eric said…
For annotatedBank2.wsdl, the issue is in the re-use of the same tns prefix in two contexts.

Inside the schema element, tns means http://ws.rajkovic.org/demo/annotatedBank/types while it means http://ws.rajkovic.org/demo/annotatedBank elsewhere.

In other words, we are referencing {http://ws.rajkovic.org/demo/annotatedBank}create-account and defining {http://ws.rajkovic.org/demo/annotatedBank/types}create-account

Popular posts from this blog

Changing the version of JDK used by JDeveloper

Connection reset from a WCF Web Service

Test locally first, then deploy to the cloud.