首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

100分WEB Service 非string数据类型总是报错

2014-01-21 
100分求助:WEB Service 非string数据类型总是报错在构建Web Service. 环境:JBoss 5.1 企业版 + Jdk1.6.问

100分求助:WEB Service 非string数据类型总是报错
在构建Web Service. 
环境:JBoss 5.1 企业版 + Jdk1.6.
问题:当XML里面的字段设成非string 类型如integer时,如果这个字段的值为空或者输入一个非数字字符时,就会出现以下的错误。本来是想在代码里做验证的,实际上好象根本就没有进入到我的代码,而是在Jbss就报错了。求大虾们指教。

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
         <faultcode>S:Server</faultcode>
         <faultstring>Failed to read a response: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.bind.UnmarshalException: For input string: ","
 - with linked exception:
[java.lang.NumberFormatException: For input string: ","]]</faultstring>
         <detail>
            <ns2:exception class="com.sun.xml.ws.encoding.soap.DeserializationException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
               <message>Failed to read a response: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.bind.UnmarshalException: For input string: ","
 - with linked exception:
[java.lang.NumberFormatException: For input string: ","]]</message>
               <ns2:stackTrace>
                  <ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="235" method="invoke"/>
                  <ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="75" method="processRequest"/>
                  <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" 

。。。。。。。。。。。
                              <ns2:frame class="org.apache.catalina.valves.ErrorReportValve" file="ErrorReportValve.java" line="102" method="invoke"/>
                              <ns2:frame class="org.jboss.web.tomcat.service.jca.CachedConnectionValve" file="CachedConnectionValve.java" line="158" method="invoke"/>
                              <ns2:frame class="org.apache.catalina.core.StandardEngineValve" file="StandardEngineValve.java" line="109" method="invoke"/>
                              <ns2:frame class="org.apache.catalina.connector.CoyoteAdapter" file="CoyoteAdapter.java" line="330" method="service"/>
                              <ns2:frame class="org.apache.coyote.http11.Http11AprProcessor" file="Http11AprProcessor.java" line="905" method="process"/>
                              <ns2:frame class="org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler" file="Http11AprProtocol.java" line="593" method="process"/>
                              <ns2:frame class="org.apache.tomcat.util.net.AprEndpoint$Worker" file="AprEndpoint.java" line="2036" method="run"/>
                              <ns2:frame class="java.lang.Thread" file="Thread.java" line="662" method="run"/>
                           </ns2:stackTrace>
                        </ns2:cause>
                     </ns2:cause>
                  </ns2:cause>


               </ns2:cause>
            </ns2:exception>
         </detail>
      </S:Fault>
   </S:Body>
</S:Envelope> 贴出报错信息

热点排行