2012-11-29 134 views
1

我試圖創建Web服務客戶端,然後我看到該編碼錯誤。Apache Cxf Wsdl2java創建Web服務客戶端編碼錯誤

我更改了eclipse編碼屬性,JVM編碼屬性和文件編碼屬性並設置了UTF-8,但這並沒有改變任何東西!

WSDLToJava Error: Schema Error : s4s-att-invalid-value: Invalid attribute value for 'attributeFormDefault' in element 'schema'. Recorded reason: cvc-enumeration-valid: Value 'unqualıfıed' is not facet-valid with respect to enumeration '(qualified | unqualified)'. It must be a value from the enumeration. 

org.apache.cxf.tools.common.ToolException: Schema Error : s4s-att-invalid-value: Invalid attribute value for 'attributeFormDefault' in element 'schema'. Recorded reason: cvc-enumeration-valid: Value 'unqualıfıed' is not facet-valid with respect to enumeration '(qualified | unqualified)'. It must be a value from the enumeration. 
    at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.validateSchema(JAXBDataBinding.java:911) 
    at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.addSchemas(JAXBDataBinding.java:588) 
    at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:391) 
    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:589) 
    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:242) 
    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:139) 
    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286) 
    at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103) 
    at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113) 
    at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86) 
    at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184) 
Caused by: org.xml.sax.SAXParseException: s4s-att-invalid-value: Invalid attribute value for 'attributeFormDefault' in element 'schema'. Recorded reason: cvc-enumeration-valid: Value 'unqualıfıed' is not facet-valid with respect to enumeration '(qualified | unqualified)'. It must be a value from the enumeration. 
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) 
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSAttributeChecker.reportSchemaError(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSAttributeChecker.checkAttributes(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSAttributeChecker.checkAttributes(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDocumentInfo.<init>(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source) 
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source) 
    at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source) 
    at javax.xml.validation.SchemaFactory.newSchema(Unknown Source) 
    at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.validateSchema(JAXBDataBinding.java:906) 
    ... 10 more 

謝謝。

+0

你爲什麼認爲這是編碼錯誤? –

+0

當我創建wsdl和schema時,在xsd文件中attributeFormDefault的attr值看起來像「unqualfied」,這不是編碼問題嗎? – saitakyuz

+0

您是否正在嘗試解析WSDL的控制權? –

回答

1
  • 刪除attributeFormDefault = 「不合格」 將elementFormDefault = 「不合格」從WSDL
  • 更改所有區域設置美國/英國
  • 當您導入WSDL選擇Apache的CXF嚮導開發客戶端