Hello all,

 

I'm having trouble using my own schemas in WSDL.  Part of it may be related
to the Axis2 code generation.

 

So, I've made my own "HelloWorld" example.  Here's my process:

 

1) Make WSDL file (attached)

2) Process with Axis2 code generation to build client/server code.  Fill in
a little of the skeleton code.

3) Build inside Eclipse using Ant

4) Package with the Axis2 Service Archiver.

 

I've attached my WSDL and Schema.  The schema has little more than a type
definition based on "xs:string".

 

I've placed my XSD file on a local server.  This is reflected in the
attached WSDL here:

 

<xs:import namespace="HW"
schemaLocation="http://strawberry/schema/HelloWorldSimple.xsd"; />

 

By the time the service gets placed on the Axis server, the reference to the
schema in "HelloWorldExternalSchemaService?wsdl" becomes:

 

<xs:import namespace="HW"
schemaLocation="HelloWorldExternalSchemaService?xsd=http://strawberry/schema
/HelloWorldSimple.xsd" />

 

Unfortunately, Axis can't seem to resolve my schema with the "xsd" option.
Because of this, the schema and all of its types are unresolved.

 

As a side note, I've also toyed with locale schema (i.e. the XSD file is in
the same directory as the WSDL file), though I haven't had much success with
that route either.

 

Questions.  Are there:

Any ideas or advice for integrating schemas with WSDL?  

Any ideas why the code generator is changing the schema location? 

Any glaring mistakes (e.g. namespace problems or DOC/RPC stuff) in my
WSDL/XSD?

 

 

Thank you!

 

Matt

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="HW" xmlns:xs="http://www.w3.org/2001/XMLSchema"; targetNamespace="HW" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="HelloWorldRoot">
		<xs:annotation>
			<xs:documentation>Hello World Root</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="MyString" type="HelloWorldStringType"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="HelloWorldStringType">
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 (http://www.altova.com) by Matthew Fadoul (My3D, LLC) -->
<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"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:tns="http://new.webservice.namespace"; xmlns:ns="HW" targetNamespace="http://new.webservice.namespace";>
	<wsdl:types>
		<xs:schema targetNamespace="http://new.webservice.namespace"; elementFormDefault="qualified">
			<xs:import namespace="HW" schemaLocation="http://strawberry/schema/HelloWorldSimple.xsd"/>
			<xs:element name="myWsdl_HelloStringElement" type="ns:HelloWorldStringType"/>
		</xs:schema>
	</wsdl:types>
	<wsdl:message name="HelloWorldExternalSchemaRequest">
		<wsdl:part name="inputParameter" element="tns:myWsdl_HelloStringElement"/>
	</wsdl:message>
	<wsdl:message name="HelloWorldExternalSchemaResponse">
		<wsdl:part name="outputParameter" element="tns:myWsdl_HelloStringElement"/>
	</wsdl:message>
	<wsdl:portType name="HelloWorldExternalSchemaSoap">
		<wsdl:operation name="HelloWorldExternalSchema">
			<wsdl:input message="tns:HelloWorldExternalSchemaRequest"/>
			<wsdl:output message="tns:HelloWorldExternalSchemaResponse"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="HelloWorldExternalSchemaSoap" type="tns:HelloWorldExternalSchemaSoap">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="HelloWorldExternalSchema">
			<soap:operation soapAction="urn:#HelloWorldExternalSchema" style="document"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="HelloWorldExternalSchemaService">
		<wsdl:port name="HelloWorldExternalSchemaPort" binding="tns:HelloWorldExternalSchemaSoap">
			<soap:address location="http://blackberry:8080/axis2/services/HelloWorldExternalSchemaService"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

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

Reply via email to