服务启动后,wsdl能正确访问,但使用生成的客户端代码执行时出现异常。通过soapui发现返回的soap消息中如果有多个字段,
字段部分的xml属性的xmlns只有第一个有,
比如
<return>
<id xmlns=".....">1000</id>
<name>a</name>
</return>
正确的应该name标签也有xmlns属性。
这部分webservice在weblogic8 或者tomcat上发布都没出现这种情况。
怀疑是weblogic9的jar与应用中的有冲突,后经过调试证实。
结果是在web应用的web-inf下加一个weblogic.xml
内容:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<wls:container-descriptor>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
</wls:weblogic-web-app>
另外在startWeblogic.cmd中,将我们应用中的xmlbean.jar放在pre_classpath中
set PRE_CLASSPATH = %WEBAPP_LIB%\xbean.jar
字段部分的xml属性的xmlns只有第一个有,
比如
<return>
<id xmlns=".....">1000</id>
<name>a</name>
</return>
正确的应该name标签也有xmlns属性。
这部分webservice在weblogic8 或者tomcat上发布都没出现这种情况。
怀疑是weblogic9的jar与应用中的有冲突,后经过调试证实。
结果是在web应用的web-inf下加一个weblogic.xml
内容:
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
<wls:container-descriptor>
<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
</wls:container-descriptor>
</wls:weblogic-web-app>
另外在startWeblogic.cmd中,将我们应用中的xmlbean.jar放在pre_classpath中
set PRE_CLASSPATH = %WEBAPP_LIB%\xbean.jar