一、No write method for property {http://vo.aa.com}new in class com.aa.vo.TA
使用xfire的ws調用時,會將對象與xml進行捆綁。整體的大概流程是:
1、 通過傳遞對象的get、is方法獲取需要傳遞的屬性(屬性私有)
2、 與xml捆綁並網絡傳輸
3、 解綁參數,並調用set方法將參數設置進去。
所以在TA和TA的父類中應該有一個isNew或者getNew的方法,但是沒有setNew,所以報錯
二、xfire發布接口報錯
log4j:WARN No appenders could be found for logger (org.codehaus.xfire.transport.DefaultTransportManager).
log4j:WARN Please initialize the log4j system properly.
org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
at [row,col {unknown-source}]: [1,730]
org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
at [row,col {unknown-source}]: [1,730]
at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at org.codehaus.xfire.client.Client.onReceive(Client.java:410)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
at org.codehaus.xfire.client.Client.invoke(Client.java:336)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.getInternalEmails(Unknown Source)
at com.wetalk.wbs.test.Test.xfire(Test.java:23)
at com.wetalk.wbs.test.Test.main(Test.java:16)
為什么呢? 經過漫長的調試發現,發現我的webservice服務端自定義對象有問題,在自定義對象中有字段的類型為char,就是因為對char類型無法傳遞導致這個錯,但不一定報這個錯的就一定和我這次的原因一樣