Hi all,

Ok I just looked at the wsdl and sorry for the delay. Adding the target
namespace simply fix the problem. Pls try with the attached WSDL. Don't
think this is a bug rather an error in the WSDL. I am not so sure how they
do it in Axis though.

Are we gonna support this scenario??

Chathura Herath 



> -----Original Message-----
> From: Sanjiva Weerawarana [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 06, 2005 12:32 PM
> To: Venkat Reddy
> Cc: [email protected]
> Subject: Re: [Axis2] Code Emitter Broken?
> 
> On Wed, 2005-07-06 at 11:00 +0530, Venkat Reddy wrote:
> > The WSDL works with Axis 1.2.1. Namespace for "testType" is taken as
> > "http://test.wsdl";. For example, the generated stub code has this line
> >  :
> > param = new org.apache.axis.description.ParameterDesc(new
> > javax.xml.namespace.QName("", "testParam"),
> > org.apache.axis.description.ParameterDesc.IN, new
> > javax.xml.namespace.QName("http://test.wsdl";, "testType"),
> > wsdl.test.TestType.class, false, false);
> 
> Why does it take that namespace? If a schema is declared without a
> target namespace then it doesn't have a namespace .. you can't take the
> default namespace of the enclosing element as the namespace for which
> the schema is defined.
> 
> So basically if the schema doesn't have a "targetNamespace" attribute
> then that schema cannot be used in WSDL. IIRC WSDL 1.1 didn't spell this
> out explicitly but it was clarified in the WS-I basic profile:
> 
> http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-
> 24.html#Schema_targetNamespace_Structure
> 
> WSDL 2.0 also clarifies this by declaring this attribute mandatory:
> 
> http://www.w3.org/TR/wsdl20/#xsd-types
> 
> This a bug in Axis1.
> 
> Of course, a better error message from Axis2 would be appreciated by
> users I'm sure :-).
> 
> Sanjiva.
> 
> 

<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Dan Kador (Lockheed Martin Info Systems) -->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; targetNamespace="http://test.wsdl"; xmlns:y="http://test.wsdl"; xmlns:types="http://test.wsdl/types";>
	<wsdl:types>
		<xs:schema  targetNamespace="http://test.wsdl";>
			<xs:complexType name="testType">
				<xs:sequence>
					<xs:element name="testElement" type="xs:normalizedString"/>
				</xs:sequence>
				<xs:attribute name="testAttribute" type="xs:normalizedString"/>
			</xs:complexType>
			<xs:simpleType name="testAttribute">
				<xs:restriction base="xs:string"/>
			</xs:simpleType>	
			<xs:element name="testAction">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="testParam" type="y:testType"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="testActionResp">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="testResp" type="xs:string"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:schema>
	</wsdl:types>
	<wsdl:message name="testActionRequest">
		<wsdl:part name="parameters" element="y:testAction"/>
	</wsdl:message>
	<wsdl:message name="testActionResponse">
		<wsdl:part name="parameters" element="y:testActionResp"/>
	</wsdl:message>
	<wsdl:portType name="testPortType">
		<wsdl:operation name="testAction">
			<wsdl:input message="y:testActionRequest"/>
			<wsdl:output message="y:testActionResponse"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="testSoapBinding" type="y:testPortType">
		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
		<wsdl:operation name="testAction">
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="testService">
		<wsdl:port name="testPort" binding="y:testSoapBinding">
			<soap:address location="http://localhost:8080/axis/services/testPort"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

Reply via email to