This is an error:

<wsdl:import namespace="http://www.liquid.com/ns/keystone/asset "
location="asset.xsd"></wsdl:import>

You can only use <wsdl:import> to import a WSDL namespace. If you want to import a schema namespace, you must use <xsd:import>.

You must add a <wsdl:types> section to you WSDL, define a schema and import the schema there.

Anne

On 5/26/06, Gopal Patwa < [EMAIL PROTECTED]> wrote:

Is this is a BUG

I have used WSDL2Java to generate code and test class,

Axis2 1.0,

I get this error when I run it,  I have copied schema and wsdl to can
recreate this problem after generating code from WSDL2Java  and running test

I get this problem with all my wsdl??

Even I tried with sample Axis2SampleDocLit.wsdl from axis2 distribution

Testcase: testHelloWorldOperation took 1.059 sec
        Caused an ERROR
java.lang.IllegalStateException
org.apache.axiom.om.OMException : java.lang.IllegalStateException
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:206)
        at
org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java :144)
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:322)
        at org.apache.axis2.HelloWorldStub.toOM(HelloWorldStub.java:302)
        at org.apache.axis2.HelloWorldStub.toEnvelope (HelloWorldStub.java:317)
        at
org.apache.axis2.HelloWorldStub.HelloWorldOperation(HelloWorldStub.java:119)
        at
org.apache.axis2.HelloWorldTest.testHelloWorldOperation(HelloWorldTest.java:30)
Caused by: java.lang.IllegalStateException
        at
org.apache.xmlbeans.impl.store.Jsr173$XMLStreamReaderForString.next(Jsr173.java:1110)
        at
org.apache.xmlbeans.impl.store.Jsr173$SyncedJsr173.next(Jsr173.java:1138)
        at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:123)
        ... 21 more

--------------------------------------------------
HelloWorld.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/ "
                                xmlns:tns="http://www.liquid.com/ns/keystone/helloworld"
                                xmlns:wsdl=" http://schemas.xmlsoap.org/wsdl/"
                                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                                name="HelloWorld"
                                targetNamespace="http://www.liquid.com/ns/keystone/helloworld"
                                xmlns:ass=" http://www.liquid.com/ns/keystone/asset">

        <wsdl:import namespace="http://www.liquid.com/ns/keystone/asset"
location="asset.xsd "></wsdl:import>

        <wsdl:message name="HelloWorldOperationResponse">
                <wsdl:part element="ass:Asset" name="HelloWorldOperationResponse"/>
        </wsdl:message>
        <wsdl:message name="HelloWorldOperationRequest">
                <wsdl:part element="ass:Asset" name="HelloWorldOperationRequest"/>
        </wsdl:message>
        <wsdl:portType name="HelloWorld">
                <wsdl:operation name="HelloWorldOperation">
                        <wsdl:input message="tns:HelloWorldOperationRequest"/>
                        <wsdl:output message="tns:HelloWorldOperationResponse"/>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="HelloWorldSOAP" type="tns:HelloWorld">
                <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="HelloWorldOperation">
                        <soap:operation soapAction="HelloWorldOperation"/>
                        <wsdl:input>
                                <soap:body parts="HelloWorldOperationRequest" use="literal"/>
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body parts="HelloWorldOperationResponse" use="literal"/>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="HelloWorld">
                <wsdl:port binding="tns:HelloWorldSOAP" name="HelloWorldSOAP">
                        <soap:address
location="http://la00771.liquid.com:8080/axis2/services/helloWorld"/>
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>


asset.xsd

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U ( http://www.altova.com) by Brad
Neighbors (Liquid Digital Media) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1=" http://www.liquid.com/ns/keystone/asset"
targetNamespace="http://www.liquid.com/ns/keystone/asset"
elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:element name="Asset" type="ns1:AssetType"/>
        <xs:complexType name="AssetType">
                <xs:sequence>
                        <xs:choice>
                                <xs:element name="Audio" type="ns1:AudioAssetType"/>
                                <xs:element name="Video" type="ns1:VideoAssetType"/>
                                <xs:element name="Image" type="ns1:ImageAssetType"/>
                        </xs:choice>
                </xs:sequence>
                <xs:attribute name="id" type="xs:string" use="optional"/>
                <xs:attribute name="size" type="xs:long" use="optional"/>
        </xs:complexType>
        <xs:complexType name="AudioAssetType">
                <xs:sequence>
                        <xs:element name="Duration" type="xs:positiveInteger"/>
                        <xs:element name="Profile" type="ns1:AudioProfileType"/>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="VideoAssetType">
                <xs:sequence>
                        <xs:element name="Duration" type="xs:positiveInteger"/>
                        <xs:element name="Profile" type="ns1:VideoProfileType"/>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="ImageAssetType">
                <xs:sequence>
                        <xs:element name="Profile" type="ns1:ImageProfileType"/>
                </xs:sequence>
        </xs:complexType>
        <xs:complexType name="AudioProfileType">
                <xs:sequence>
                        <xs:element name="BitRate" type="ns1:BitRateType"/>
                        <xs:element name="Format" type="ns1:FormatType"/>
                        <xs:element name="SampleRate" type="xs:decimal"/>
                </xs:sequence>
                <xs:attribute name="id" type="xs:integer"/>
        </xs:complexType>
        <xs:complexType name="VideoProfileType">
                <xs:sequence>
                        <xs:element name="AudioBitRate" type="ns1:BitRateType"/>
                        <xs:element name="VideoBitRate" type="ns1:BitRateType"/>
                        <xs:element name="Format" type="ns1:FormatType"/>
                </xs:sequence>
                <xs:attribute name="id" type="xs:integer"/>
        </xs:complexType>
        <xs:complexType name="ImageProfileType">
                <xs:sequence>
                        <xs:element name="Format" type="ns1:FormatType"/>
                        <xs:element name="Height" type="xs:positiveInteger"/>
                        <xs:element name="Width" type="xs:positiveInteger"/>
                </xs:sequence>
                <xs:attribute name="id" type="xs:integer"/>
        </xs:complexType>
        <xs:complexType name="FormatType">
                <xs:sequence>
                        <xs:element name="Name" type="xs:string"/>
                        <xs:element name="Extension" type="xs:string"/>
                </xs:sequence>
                <xs:attribute name="id" type="xs:integer"/>
        </xs:complexType>
        <xs:complexType name="BitRateType">
                <xs:sequence>
                        <xs:element name="RateKbps" type="xs:positiveInteger"/>
                        <xs:element name="Type" type="ns1:ConstOrVar"/>
                </xs:sequence>
                <xs:attribute name="id" type="xs:integer"/>
        </xs:complexType>
        <xs:complexType name="ConstOrVar">
                <xs:choice>
                        <xs:element name="CONSTANT"/>
                        <xs:element name="VARIABLE"/>
                </xs:choice>
        </xs:complexType>
</xs:schema>


--
View this message in context: http://www.nabble.com/Axis2-1.0-+BUG+in+WSDL2Java+Error+running+test-t1685417.html#a4571923
Sent from the Axis - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to