日期:2014-05-17  浏览次数:20723 次

build.xml运行报错,求指点
<?xml version="1.0" encoding="UTF-8"?>
<project name="xfireExample" default="help" basedir=".">


<!-- =================================================================== -->
<!-- 设置属性 -->
<!-- =================================================================== -->
<property name="optimize" value="false" />
<property name="debug" value="on" />
<property name="deprecation" value="false" />


<property name="build.lib" value="${basedir}/../lib" />
<property name="sources" value="${basedir}/src" />
<property name="build.classes" value="${basedir}/bin" />


<!-- =================================================================== -->
<!-- 设置类路径========================================================= -->
<!-- =================================================================== -->
<path id="classpath">
<pathelement location="${build.classes}" />
<fileset dir="${build.lib}">
<include name="*.jar" />
</fileset>
</path>

<taskdef name="wsgen" classname="org.codehaus.xfire.gen.WsGenTask" classpathref="classpath" />


<!-- ================================================ -->
<!-- 帮助 -->
<!-- ================================================ -->
<target name="help" description="显示帮助信息">
<echo message="target 描述" />
<echo message="-----------------------------"/>
<echo message="compile 编译 " />
<echo message="create_code 创建代码" />
</target>


<!-- =============================================== -->
<!-- 编译代码 -->
<!-- =============================================== -->
<target name="compile" description="编译代码">
<echo>编译程序代码</echo>
<javac srcdir="${sources}" destdir="${build.classes}" classpathref="classpath" debug="${debug}" optimize="${optimize}" deprecation="${deprecation}" />
</target>
<!-- =============================================== -->
<!-- 创建客户端代码 -->
<!-- =============================================== -->
<target name="create_code" description="创建代码">
<echo>创建代码</echo>
<wsgen outputDirectory="${sources}" wsdl="${basedir}/HelloService.wsdl" package="com.googlepages.smallnest.facet" overwrite="true" />
</target>


</project>

这是我的build.xml,运行ant的时候报下面这个错
BUILD FAILED
D:\workspace1\xfireClient\lib\build.xml:54: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/D:/workspace1/xfireClient/lib/HelloService.wsdl'.: Content is not allowed in prolog.: org.xml.sax.SAXParseException: Content is not allowed in prolog.

这里提到的第54行是
<wsgen outputDirectory="${sources}" wsdl="${basedir}/HelloService.wsdl" package="com.googlepages.smallnest.facet" overwrite="tru