急!!Axis2问题

北漂稻草人 2011-05-26 03:39:43
本人最近用Axis2用一个小的服务系统,用作两个不同系统之间进行数据同步,服务端部署成功,当用客户端去测试时,出现如下错误,请各位大侠多多指教!!!!!

Exception in thread "main" org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ' ' (code 32) in content after '<' (malformed start element?).
at [row,col {unknown-source}]: [1,283]
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at com.swe.wipn.services.loadingpreparation.LoadingPreparationStub.fromOM(LoadingPreparationStub.java:370)
at com.swe.wipn.services.loadingpreparation.LoadingPreparationStub.LoadingPreparationRequest(LoadingPreparationStub.java:183)
at lsl.test.Test.main(Test.java:41)
Caused by: java.lang.Exception: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ' ' (code 32) in content after '<' (malformed start element?).
at [row,col {unknown-source}]: [1,283]
at com.swe.wipn.services.loadingpreparation.types.LoadingPreparationRequestResponse$Factory.parse(LoadingPreparationRequestResponse.java:928)
at com.swe.wipn.services.loadingpreparation.LoadingPreparationStub.fromOM(LoadingPreparationStub.java:365)
... 2 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ' ' (code 32) in content after '<' (malformed start element?).
at [row,col {unknown-source}]: [1,283]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:623)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2852)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
at org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:981)
at com.swe.wipn.services.loadingpreparation.types.LoadingPreparationRequestResponse$Factory.parse(LoadingPreparationRequestResponse.java:813)
... 3 more
...全文
660 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
北漂稻草人 2011-05-26
  • 打赏
  • 举报
回复
问题终于找到了,,原来是我的WSDL文件里面有空格造成的!!还是要感谢大家给我支持!!!
XiangZhiLiu 2011-05-26
  • 打赏
  • 举报
回复
服务器端返回的xml中有一个" ",它认为是空格吧~~找找看~~
北漂稻草人 2011-05-26
  • 打赏
  • 举报
回复
我提交给服务端的数据没有带<符合的数据,都是一些简单的整形和字符串类型的值,没有其他特殊的字符。
fengyun817 2011-05-26
  • 打赏
  • 举报
回复
你这个类体现不出错误啊。还要看其他的类
你检查下数据里是不是带 < 符号?
北漂稻草人 2011-05-26
  • 打赏
  • 举报
回复
数据应该没有问题,

public class Test {

public static void main(String[] args) throws RemoteException {

com.zznode.ipnm.services.loadingpreparation.LoadingPreparationStub stub = new com.zznode.ipnm.services.loadingpreparation.LoadingPreparationStub();//the default implementation should point to the right endpoint

//com.zznode.ipnm.services.loadingpreparation.types.LoadingPreparationRequest loadingPreparationRequest14 = (com.zznode.ipnm.services.loadingpreparation.types.LoadingPreparationRequest) getTestObject(com.zznode.ipnm.services.loadingpreparation.types.LoadingPreparationRequest.class);
// TODO : Fill in the loadingPreparationRequest14 here
String url="http://localhost:9080/axis2/services/LoadingPreparation";
LoadingPreparationStub stub1=new LoadingPreparationStub(url);

LoadingPreparationRequest loadingPreparationRequest14=new LoadingPreparationRequest();
loadingPreparationRequest14.setEventID("002");
Calendar c = Calendar.getInstance();
loadingPreparationRequest14.setSendTime(c);
loadingPreparationRequest14.setSuggestCharSet(2);
loadingPreparationRequest14.setSuggestFileFormat(2);
loadingPreparationRequest14.setSuggestWorkMode(1);
loadingPreparationRequest14.setSystemID("IRMS");

//System.out.println(stub.SayHello(request).getSayHelloResponse());

// todo Fill in the param14 here

//assertNotNull(stub.SayHello(request));




stub1.LoadingPreparationRequest(loadingPreparationRequest14);
}
}
fengyun817 2011-05-26
  • 打赏
  • 举报
回复
初步估计是你的测试数据有问题,
把lsl.test.Test代码贴出来看看(尤其是Test.java:41 行)
1 下载 Myeclipse Axis2 插件 http: archive apache org dist ws axis2 tools 1 4 1 下载 axis2 eclipse codegen wizard zip 和 axis2 eclipse service archiver wizard zip http: labs xiaonei com apache mirror ws axis2 1 5 axis2 1 5 war zip 下载 axis2 1 5 war zip 2 .解压插件 $ECLIPSE HOME 表示你安装的 myeclipse 主目录 将上述两个插件都解压到 $ECLIPSE HOME eclipse plugins 目录中; Axis2 Codegen Wizard 1 3 0 和 Axis2 Service Archiver 1 3 0 3 在 $ECLIPSE HOME eclipse links 目录下增加文件 axis eclipse plugin link 写入 path $ECLIPSE HOME eclipse plugins 千万不要直接复制 4 重新启动 myeclipse 在 file >new >other 中即可看到 Axis2 Wizards 至此 axis2 插件安装成功 GXGX 5 赶快试下用 wsdl 文件生成 java 源文件吧 是不是有错误出现 对 事情就是这样发展的 6 An error occurred while completing process java lang reflect InvocationTargetException 的错误 嗯不用 有得解 不过我当初很惨弄了一个晚上 解决方法如下: step 1 从 AXIS2 的 LIB 库中复制 "geronimo stax api 1 0 spec 1 0 1 jar" 和 "backport util concurrent 3 1 jar" 文件到 Axis2 Codegen Wizard 1 3 0 的 lib 目录中 同时修改 Axis2 Codegen Wizard 1 3 0 下的 plugin xml 文件 在 <runtime> 中添加 <library name "lib geronimo stax api 1 0 spec 1 0 1 jar"> <export name " " > < library> <library name "lib backport util concurrent 3 1 jar"> <export name " " > < library> 到 plugin xml 文件中 保存 step 2 将 $workspace 位置 metadata plugins 下目录 Axis2 Codegen Wizard 删除 step 3 在命令行下切换至 $ECLIPSE HOME 目录 然后执行: eclipse –clear step 4 除了上面步骤还要: (4 1) 把Axis2 Codegen wizard 1 3 0 eclipse plugins Axis2 Codegen wizard 1 3 0 的名字改成Axis2 Codegen wizard 1 4 0 (4 2) 在plugin xml中在<plugin>中 把Axis2 Codegen wizard的version "1 3 0"改成version "1 4 0" 到plugin xml文件中 保存后重新启动Eclipse即可 ">1 下载 Myeclipse Axis2 插件 http: archive apache org dist ws axis2 tools 1 4 1 下载 axis2 eclipse codegen wizard zip 和 axis2 eclipse service archiver wizard zip http: labs xiaonei com apache mirror ws axis2 1 5 axis2 1 5 war zip 下载 axis2 1 5 war zip 2 .解压插件 $E [更多]

67,549

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧