简体   繁体   English

从wsdl创建Java代码的axis2错误

[英]axis2 error creating java code from wsdl

i have to create a client for a given wsdl ... 我必须为给定的wsdl创建一个客户端...

<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:base="http://www.impresainungiorno.gov.it/schema/base" xmlns:bus="http://www.cnipa.it/schemas/2003/eGovIT/Busta1_0/" xmlns:eb="http://www.metaware.it/geofront2/estensioni_busta.xsd" xmlns:ns0="http://www.impresainungiorno.gov.it/schema/suap/ri/spc/ws" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:spc="http://www.impresainungiorno.gov.it/schema/suap/ri/spc" targetNamespace="http://www.impresainungiorno.gov.it/schema/suap/ri/spc/ws">
  <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pi="http://www.impresainungiorno.gov.it/schema/base" xmlns:ri="http://www.impresainungiorno.gov.it/schema/suap/ri/spc" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.impresainungiorno.gov.it/schema/suap/ri/spc" version="1.0.0" xmlns:spc="http://www.impresainungiorno.gov.it/schema/suap/ri/spc">
    <!--  
    -->
    <xs:import namespace="http://www.impresainungiorno.gov.it/schema/base"/>

........

    <xsd:element name="Intestazione">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element ref="IntestazioneMessaggio"/>
                <xsd:element minOccurs="0" ref="ListaRiscontri"/>
                <xsd:element minOccurs="0" ref="ListaTrasmissioni"/>
                <xsd:element minOccurs="0" ref="ListaEccezioni"/>
            </xsd:sequence>
            <xsd:attribute fixed="http://www.cnipa.it/eGov_it/portadominio" ref="SOAP_ENV:actor" use="required"/>
            <xsd:attribute fixed="1" ref="SOAP_ENV:mustUnderstand" use="required"/>
        </xsd:complexType>
    </xsd:element>

........

i'm using axis2 1.6.2 wsdl2java tool from comand line but i'm experiencing the following error: 我正在从comand行使用axis2 1.6.2 wsdl2java工具,但是遇到以下错误:

Retrieving document at 'richiesta-iscrizione-impresa-RI.wsdl'.
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:126)
    at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246)
    ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:115)
    ... 3 more
Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error: src-resolve: attribute 'actor@http://schemas.xmlsoap.org/soap/envelope/' not found.
    at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325)
    ... 8 more
Caused by: org.apache.xmlbeans.XmlException: error: src-resolve: attribute 'actor@http://schemas.xmlsoap.org/soap/envelope/' not found.
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
    at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:189)
    ... 8 more

I checked the schema and the "actor" attribute exists .... 我检查了架构,并且“角色”属性存在。

What's the problem? 有什么问题?

Thanks 谢谢

andrea 安德里亚

There are different encoding types of WSDLs like RPC/encoded, RPC/literal, Document/encoded, Document/literal. WSDL的编码类型不同例如RPC /编码,RPC /文字,文档/编码,文档/文字。 I think your WSDL is using RPC/encoded. 我认为您的WSDL正在使用RPC /编码。 RPC/encoded encoding style is not supported directly by Axis2. Axis2不直接支持RPC /编码的编码样式。

This article is about using RPC/encoded WSDLs with Axis2 . 本文是关于将RPC /编码的WSDL与Axis2一起使用的 I hope this will help. 我希望这将有所帮助。

axis 2 does not support rpc/encoded style webservices. 轴2不支持rpc /编码样式的Web服务。 You will have to use axis 1 您将必须使用轴1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM