You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Wes Devauld <we...@devauld.ca> on 2003/01/28 00:57:46 UTC

Setting namespace in returned Element

Hello,


   I'm having a problem with the namespace that is set on a returned
Element.  The element appears on the wire with an empty namespace, but it's
children elements have the proper namespace. ie:


---------------


<?xml version="1.0" encoding="UTF-8"?>


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


 <soapenv:Body>


  <connectivityReturn xmlns="">


   <ns1:GMML xmlns:ns1="http://blah/GMML">


    <!-- Deleted -->


   </ns1:GMML>


  </connectivityReturn>


 </soapenv:Body>


</soapenv:Envelope>


------------------




   I have a class:




---------------


//import stuff and package name chopped




public class ConnectivityTest {


   public ConnectivityReturn connectivity () {


           GMML toReturn = new GMML();


           //Set a bunch of stuff on the GMML object


             ...


           ConnectivityReturn CR = new ConnectivityReturn();


           CR.setGMML(toReturn);


           return CR;


   }


}


---------------


I deployed using this deployment descriptor:




---------------


<deployment xmlns="http://xml.apache.org/axis/wsdd/">


   <service name="Connectivity" provider="java:RPC" style="document"
use="literal">


      <parameter name="className" value="GMML.ConnectivityTest"/>


      <parameter name="allowedMethods" value="*"/>


      <namespace>http://blah/GMML/</namespace>


   </service>


</deployment>


------------------


And the WSDL2Java was done with this WSDL :




-------------------


<?xml version="1.0" encoding="UTF-8"?>


<wsdl:definitions targetNamespace="http://blah/GMML"
xmlns:impl="http://blah/GMML" xmlns:intf="http://blah/GMML"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">


<wsdl:types>


<xs:schema elementFormDefault="qualified"
targetNamespace="http://blah/GMML">


<xs:element name="ConnectivityReturn">


	<xs:complexType>


		<xs:sequence>


		<xs:element minOccurs="1" maxOccurs="1" ref="intf:GMML"/>


		</xs:sequence>


	</xs:complexType>


</xs:element>


	<xs:element name="GMML">


		<xs:complexType>


			<xs:choice minOccurs="0" maxOccurs="unbounded">


				<xs:element name="Protected" minOccurs="0"
maxOccurs="unbounded">


					<xs:complexType>


						<xs:sequence>


								<!-- SNIP! -->


		</xs:schema>


	</wsdl:types>


	<wsdl:message name="connectivityResponse">


		<wsdl:part name="connectivityReturn"
element="intf:ConnectivityReturn"/>


	</wsdl:message>


	<wsdl:message name="connectivityRequest"/>


	<wsdl:portType name="ConnectivityTest">


		<wsdl:operation name="connectivity">


			<wsdl:input name="connectivityRequest"
message="impl:connectivityRequest"/>


			<wsdl:output name="connectivityResponse"
message="impl:connectivityResponse"/>


		</wsdl:operation>


	</wsdl:portType>


	<wsdl:binding name="ConnectivitySoapBinding"
type="impl:ConnectivityTest">


		<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>


		<wsdl:operation name="connectivity">


			<soap:operation soapAction=""/>


			<wsdl:input name="connectivityRequest">


				<soap:body use="literal" namespace="http://blah/GMML/"/>


			</wsdl:input>


			<wsdl:output name="connectivityResponse">


				<soap:body use="literal" namespace="http://blah/GMML/"/>


			</wsdl:output>


		</wsdl:operation>


	</wsdl:binding>


	<wsdl:service name="ConnectivityTestService">


		<wsdl:port name="Connectivity"
binding="impl:ConnectivitySoapBinding">


			<soap:address
location="http://localhost:8080/axis/services/Connectivity"/>


		</wsdl:port>


	</wsdl:service>


</wsdl:definitions>


-------------------------


Can someone tell me why the <connectivityReturn> element gets a ""
namespace, and how I can set it.  Does it need to be set?  Any other bad
programming habits? :)  (Axis 1.1b on Tomcat 4.1.18)




Thanks,


-W