`
charliebrown
  • 浏览: 34217 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

生成web service client时Error generating services

阅读更多
基于xfire的机制编写webservice是一种常见的开发手段,我也已经用此方法进行了近两个月的开发

无奈周一遇到个严重错误……在客户端生成过程中,WSDL文件能通过有效性验证,但在点击下一步时,error就出现了

Error generating services

java.lang.StringIndexOutOfBoundsException: String index out of range: 4

at java.lang.StringBuffer.charAt(StringBuffer.java:162)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.replaceAndUpperCase(JAXBSchemaSupport.java:235)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.getWrapperType(JAXBSchemaSupport.java:204)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.getType(JAXBSchemaSupport.java:191)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.getType(JAXBSchemaSupport.java:125)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generateOperation(AbstractServiceGenerator.java:240)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:123)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:67)
    at org.codehaus.xfire.gen.jsr181.ServiceInterfaceGenerator.generate(ServiceInterfaceGenerator.java:49)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:54)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:167)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:246)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)



eclipse.buildId=unknown
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
Command-line arguments:  -os win32 -ws win32 -arch x86 -clean





这是个挺罕见的bug,如上面myeclipse报错的位置,是由xFire的string转换代码产生的错误,WSDL中惹麻烦的语句如下

<xsd:element maxOccurs="1" minOccurs="1" name="xURI" nillable="true" type="xsd:string" />

报错的字符串长度就是"xURI"的长度,那么,当我把其中的某些字母改为小写"xUri",问题就解决了。

经过测试,xFire不支持三个及以上字母的连续大写,这算是一个bug吧,希望在新的版本中能够修复。

但是后面有一个3大写字母连续的

<xsd:element maxOccurs="1" minOccurs="1" name="pkgDataOrURL" nillable="true" type="xsd:string" />

居然没有报错,我彻底迷惑了……

嘛,反正知道以后报这个错我知道去哪找了……

欢迎大家多多指教~

--
黄震宁
北京邮电大学电子工程学院ICN&CAD中心
Zhenning Huang,
ICN&CAD Center,
School of Electronic Engineering,
Beijing University of Posts and Telecommunications,
10 Xitucheng Road,
Haidian District.
Beijing, 100876
People's Republic of China
Email: echo aHVhbmd6aG5AZ21haWwuY29tIA0K | base64 -d


This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/2.5/

For other licenses contact author.
分享到:
评论

相关推荐

    Professional C# 3rd Edition

    Active Directory Service Interfaces (ADSI) 847 Programming Active Directory 848 Classes in System.DirectoryServices 849 Binding 849 Getting Directory Entries 854 Object Collections 855 Cache 857 ...

    Beginning Microsoft Visual CSharp 2008 Wiley Publishing(english)

    Creating a Simple ASP.NET Web Service 757 Testing the Web Service 759 Implementing a Windows Client 761 Calling the Service Asynchronously 765 Implementing an ASP.NET Client 768 ...

    Beginning Python (2005).pdf

    Chapter 21: Web Applications and Web Services 459 REST: The Architecture of the Web 460 Characteristics of REST 460 A Distributed Network of Interlinked Documents 461 A Client-Server Architecture ...

    SAP PO/PI教程 Process Orchestration The Comprehensive Guide

    12.1.1 Generating a Web Dynpro User Interface 12.1.2 Post-Configuration Steps 12.2 Integrating SAPUI5 into an SAP BPM Process 12.2.1 SAPUI5 Technology Platform 12.2.2 Model-View-Controller Concept...

    spring-boot-reference.pdf

    45. Web Services 46. Creating Your Own Auto-configuration 46.1. Understanding Auto-configured Beans 46.2. Locating Auto-configuration Candidates 46.3. Condition Annotations 46.3.1. Class Conditions ...

    计算机网络第六版答案

    It adds header to each chunk, thereby generating multiple packets from the file. The header in each packet includes the IP address of the destination (end system B). The packet switch uses the ...

    Python Cookbook英文版

    6.6 Capturing the Output and Error Streams from a Unix Shell Command 6.7 Forking a Daemon Process on Unix 6.8 Determining if Another Instance of a Script Is Already Running in Windows 6.9 ...

    WordPress Top Plugins.pdf

    Configuring third party Taxonomy Services 211 Redirection 212 Widget Logic 213 Commonly used logic 214 Summary 214 Chapter 10: Time for Action 215 The open source business model 215 WordPress ...

    python3.6.5参考手册 chm

    PEP 3333: Python Web Server Gateway Interface v1.0.1 Other Language Changes New, Improved, and Deprecated Modules email elementtree functools itertools collections threading datetime and time ...

    php.ini-development

    data to the client. If your application's output exceeds this setting, PHP ; will send that data in chunks of roughly the size you specify. ; Turning on this setting and managing its maximum buffer ...

    pro_apache_third_edition..pdf

    Web Services: Well-Known Ports......................................................................23 Internet Daemon: The Networking Super Server...........................................24 The ...

    Thinking in Java 4th Edition

    provides services ................... 18 The hidden implementation .................... 19 Reusing the implementation ................... 20 Inheritance............................ 21 Is-a vs. is-like...

Global site tag (gtag.js) - Google Analytics