//We use an existing XML file for the response from the
//Web service operation. We’ll load this XML file from
//the WEB-INF/classes directory, and use the JAXB API
//to create the JAXB object of our response.
inputstream = Thread.currentThread().getContextClassLoader().getResourceAsStream("SampleDataStagingResponseDocument.xml");
jc = JAXBContext.newInstance(DataStagingResponse.class);
Unmarshaller unmarshaller = jc.createUnmarshaller();
dataStagingResponse = (DataStagingResponse)unmarshaller.unmarshal(inputstream);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
finally
{
if (inputstream != null) try {} catch (Exception e){}
}
return dataStagingResponse.getOutputURIs();
}
其中的代码注释很好地解释了其过程,因此我在此处就不再赘述了。
编译JAX-WS服务端点
BEA jwsc Ant任务用于编译JAX-WS服务端点并生成待部署的WAR文件。
<target name="run-jwsc">
<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask"
classpathref="compile.classpath" />
<jwsc
destdir="${domain.home}/deployments/${project.name}"
srcdir="${src.dir}/${package.path}"
classpath="WebContent/WEB-INF/lib/${wsdl.file.name}_wsdl.jar"
keepGenerated="${keep}"
文章来源于领测软件测试网 https://www.ltesting.net/