Corticon WSDL and XMLBeans

Posted by yunakao on 23-Oct-2014 02:52

Anyone has any idea why I got this error when try to create WebService Client Using XMLBean ?

command:

-uri http://localhost:8082/axis/WSDL/SmartPhonePrice_contract.wsdl -sn SmartPhonePriceDecisionService -pn

SmartPhonePriceDecisionServiceSoap -s -d xml beans --noBuildXML -o c:/work/out

My Error Message:

org.apache.axis2.wsdl.codegen.CodeGenerationException:

java.lang.RuntimeException:java.lang.reflect.InvocationTargetException
     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)                     
     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)                     
     at jp.co.canon_soft.wp.runtime.webservice_impl.WSProxyCreator.main(WSProxyCreator.java:146)
 Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
     at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:126)
 Java Result: 1                                                                  
     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
     ... 3 more                                                                     
 Caused by: java.lang.reflect.InvocationTargetException                          
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)                 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)             
     at java.lang.reflect.Method.invoke(Unknown Source)                             
     at org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:115)
     ... 4 more                                                                     
 Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error: cvc-complex-type.3.2.2: Attribute not

allowed: value in element attribute@http://www.w3.org/2001/XMLSchema
     at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:325)
     ... 9 more                                                                     
 Caused by: org.apache.xmlbeans.XmlException: error: cvc-complex-type.3.2.2: Attribute not allowed:value in element

attribute@http://www.w3.org/2001/XMLSchema
     at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                 
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)                 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)             
     at java.lang.reflect.Method.invoke(Unknown Source)                             
     at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)             
     at org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:189)
     ... 9 more

MY Corticon WSDL 

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://localhost:8082/axis/services/Corticon/untitled_1" xmlns:cc="urn:decision:untitled_1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://localhost:8082/axis/services/Corticon/untitled_1">
  <types>
    <xsd:schema xmlns:tns="urn:decision:untitled_1" targetNamespace="urn:decision:untitled_1" elementFormDefault="qualified">
      <xsd:element name="CorticonRequest" type="tns:CorticonRequest" />
      <xsd:element name="CorticonResponse" type="tns:CorticonResponse" />
      <xsd:complexType name="CorticonRequest">
        <xsd:sequence>
          <xsd:element name="ExecutionProperties" type="tns:ExecutionPropertiesRequest" minOccurs="0" maxOccurs="1" />
          <xsd:element name="WorkDocuments" type="tns:WorkDocumentsRequest" />
        </xsd:sequence>
        <xsd:attribute name="decisionServiceName" use="required" fixed="untitled_1" type="xsd:string" />
      </xsd:complexType>
      <xsd:complexType name="CorticonResponse">
        <xsd:sequence>
          <xsd:element name="ExecutionProperties" type="tns:ExecutionPropertiesResponse" minOccurs="0" maxOccurs="1" />
          <xsd:element name="WorkDocuments" type="tns:WorkDocumentsResponse" />
          <xsd:element name="Messages" type="tns:Messages" />
        </xsd:sequence>
        <xsd:attribute name="decisionServiceName" use="required" fixed="untitled_1" type="xsd:string" />
      </xsd:complexType>
      <xsd:complexType name="ExecutionProperties">
        <xsd:sequence>
          <xsd:element name="ExecutionProperty" type="tns:ExecutionProperty" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="ExecutionProperty">
        <xsd:sequence />
        <xsd:attribute name="executionPropertyName" use="required" type="xsd:string" />
        <xsd:attribute name="executionPropertyValue" use="required" type="xsd:string" />
      </xsd:complexType>
      <xsd:complexType name="WorkDocumentsRequest">
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="contract_entity" type="tns:contract_entityRequest" />
        </xsd:choice>
        <xsd:attribute name="messageType" fixed="HIER" use="required" type="xsd:string" />
      </xsd:complexType>
      <xsd:complexType name="WorkDocumentsResponse">
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="contract_entity" type="tns:contract_entityResponse" />
        </xsd:choice>
        <xsd:attribute name="messageType" fixed="HIER" use="required" type="xsd:string" />
      </xsd:complexType>
      <xsd:complexType name="Messages">
        <xsd:sequence>
          <xsd:element name="Message" type="tns:Message" minOccurs="0" maxOccurs="unbounded" />
        </xsd:sequence>
        <xsd:attribute name="version" type="xsd:string" />
      </xsd:complexType>
      <xsd:complexType name="Message">
        <xsd:sequence>
          <xsd:element name="severity">
            <xsd:simpleType>
              <xsd:restriction base="xsd:string">
                <xsd:enumeration value="Info" />
                <xsd:enumeration value="Warning" />
                <xsd:enumeration value="Violation" />
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
          <xsd:element name="text" type="xsd:string" />
          <xsd:element name="entityReference">
            <xsd:complexType>
              <xsd:attribute name="href" type="xsd:anyURI" />
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="contract_entityRequest">
        <xsd:sequence>
          <xsd:element name="contractid" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="contracttype" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="monthlyprice" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="priceplan" type="xsd:long" nillable="true" minOccurs="1" />
          <xsd:element name="申込日" type="xsd:date" nillable="true" minOccurs="1" />
          <xsd:element name="オプション" type="tns:option_entityRequest" minOccurs="0" maxOccurs="unbounded" />
          <xsd:element name="サービス" type="tns:service_entityRequest" minOccurs="0" maxOccurs="unbounded" />
          <xsd:element name="割引" type="tns:discount_entityRequest" minOccurs="0" maxOccurs="unbounded" />
          <xsd:element name="契約機種別割引" type="tns:契約機種別割引Request" minOccurs="0" />
          <xsd:element name="契約別割引" type="tns:契約別割引Request" minOccurs="0" />
          <xsd:element name="携帯電話" type="tns:mobilephone_entityRequest" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="discount_entityRequest">
        <xsd:sequence>
          <xsd:element name="discountname" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="discountprice" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="maxdiscountapplymonth" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="mobilephone_entityRequest">
        <xsd:sequence>
          <xsd:element name="diskvolume" type="xsd:string" nillable="true" minOccurs="1" />
          <xsd:element name="mobilephonename" type="xsd:string" nillable="true" minOccurs="1" />
          <xsd:element name="price" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="option_entityRequest">
        <xsd:sequence>
          <xsd:element name="maxoptionapplymonth" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="optionname" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="optionprice" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="service_entityRequest">
        <xsd:sequence>
          <xsd:element name="maxserviceapplymonth" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="serviceprice" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="サービス名" type="xsd:string" nillable="true" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="契約別割引Request">
        <xsd:sequence>
          <xsd:element name="契約別割引名" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="契約別割引料" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="契約別最大割引期間月" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="契約機種別割引Request">
        <xsd:sequence>
          <xsd:element name="契約機種別割引適用期間月" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="契約機種別割引料" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="contract_entityResponse">
        <xsd:sequence>
          <xsd:element name="contractid" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="contracttype" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="monthlyprice" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="priceplan" type="xsd:long" nillable="true" minOccurs="1" />
          <xsd:element name="申込日" type="xsd:date" nillable="true" minOccurs="1" />
          <xsd:element name="オプション" type="tns:option_entityResponse" minOccurs="0" maxOccurs="unbounded" />
          <xsd:element name="サービス" type="tns:service_entityResponse" minOccurs="0" maxOccurs="unbounded" />
          <xsd:element name="割引" type="tns:discount_entityResponse" minOccurs="0" maxOccurs="unbounded" />
          <xsd:element name="契約機種別割引" type="tns:契約機種別割引Response" minOccurs="0" />
          <xsd:element name="契約別割引" type="tns:契約別割引Response" minOccurs="0" />
          <xsd:element name="携帯電話" type="tns:mobilephone_entityResponse" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
      <xsd:complexType name="discount_entityResponse">
        <xsd:sequence>
          <xsd:element name="discountname" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="discountprice" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="maxdiscountapplymonth" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
      <xsd:complexType name="mobilephone_entityResponse">
        <xsd:sequence>
          <xsd:element name="diskvolume" type="xsd:string" nillable="true" minOccurs="1" />
          <xsd:element name="mobilephonename" type="xsd:string" nillable="true" minOccurs="1" />
          <xsd:element name="price" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
      <xsd:complexType name="option_entityResponse">
        <xsd:sequence>
          <xsd:element name="maxoptionapplymonth" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="optionname" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="optionprice" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
      <xsd:complexType name="service_entityResponse">
        <xsd:sequence>
          <xsd:element name="maxserviceapplymonth" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="serviceprice" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="サービス名" type="xsd:string" nillable="true" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
      <xsd:complexType name="契約別割引Response">
        <xsd:sequence>
          <xsd:element name="契約別割引名" type="xsd:string" nillable="true" minOccurs="0" />
          <xsd:element name="契約別割引料" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="契約別最大割引期間月" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
      <xsd:complexType name="契約機種別割引Response">
        <xsd:sequence>
          <xsd:element name="契約機種別割引適用期間月" type="xsd:long" nillable="true" minOccurs="0" />
          <xsd:element name="契約機種別割引料" type="xsd:long" nillable="true" minOccurs="0" />
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID" use="optional" />
      </xsd:complexType>
    </xsd:schema>
  </types>
  <message name="CorticonRequestIn">
    <part name="parameters" element="cc:CorticonRequest" />
  </message>
  <message name="CorticonResponseOut">
    <part name="parameters" element="cc:CorticonResponse" />
  </message>
  <portType name="untitled_1Soap">
    <operation name="processRequest">
      <input message="tns:CorticonRequestIn" />
      <output message="tns:CorticonResponseOut" />
    </operation>
  </portType>
  <binding name="untitled_1Soap" type="tns:untitled_1Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <operation name="processRequest">
      <soap:operation soapAction="urn:decision:untitled_1" style="document" />
      <input>
        <soap:body use="literal" namespace="urn:decision:untitled_1" />
      </input>
      <output>
        <soap:body use="literal" namespace="urn:decision:untitled_1" />
      </output>
    </operation>
  </binding>
  <service name="untitled_1">
    <documentation />
    <port name="untitled_1Soap" binding="tns:untitled_1Soap">
      <soap:address location="http://localhost:8082/axis/services/Corticon" />
    </port>
  </service>
</definitions>

All Replies

Posted by Jan Krishnamurthy on 23-Oct-2014 09:04

I see the error:

Caused by: org.apache.xmlbeans.XmlException: error: cvc-complex-type.3.2.2: Attribute not allowed:value in element

XMLBeans is complaining about an invalid schema

From the exception stack trace  it looks like Corticon WSDL is not compliant with XMLBeans standard.

You probably have to modify the WSDL to make it compliant with XMLBeans.

This thread is closed