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 Steve Maring <ba...@yahoo.com> on 2003/09/29 12:03:06 UTC

accepting a return type of Void

What is the proper way to specify a return type of
void?

I'm writing a doc/literal web service.  One of the
operations has a void return type.  I had not
specified a Response wrapper in the types of my WSDL. 
So I end up getting:

org.xml.sax.SAXException: Deserializing parameter
'addPersonRequestResponse':  could not find
deserializer for type
{http://xml.apache.org/axis/}Void

I figured that maybe the BeanSerializer might help
here, so I tried to specify a Response wrapper type
containing xsd:anyType, but that didn't generate the
proper typemapping.

Sample WSDL follows.

Many Thanks.
Steve Maring


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
	targetNamespace="http://ws.addressbook.maring.org"
	xmlns:impl="http://ws.addressbook.maring.org"
	xmlns:intf="http://ws.addressbook.maring.org"
	xmlns:apachesoap="http://xml.apache.org/xml-soap"

xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:data="http://data.addressbook.maring.org"
	xmlns:wrapper="http://data.ws.addressbook.maring.org"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns="http://schemas.xmlsoap.org/wsdl/">
	
	<wsdl:types>
     
		<schema 
			xmlns="http://www.w3.org/2001/XMLSchema"
		
targetNamespace="http://data.addressbook.maring.org">
			
			<include schemaLocation="../meta/persons.xsd" />

		</schema>
		
		<schema
			xmlns="http://www.w3.org/2001/XMLSchema"
			xmlns:data="http://data.addressbook.maring.org"
		
xmlns:wrapper="http://data.ws.addressbook.maring.org"
		
targetNamespace="http://data.ws.addressbook.maring.org">
			
			<element name="addPersonRequest"
type="wrapper:AddPersonRequest"/>
			<complexType name="AddPersonRequest">
			    <sequence>
			        <element ref="data:person"/>
			    </sequence>
			</complexType>
			
			<element name="getPersonRequest"
type="xsd:string"/>
			<element name="getPersonResponse"
type="wrapper:GetPersonResponse"/>
			<complexType name="GetPersonResponse">
			    <sequence>
			        <element ref="data:person"/>
			    </sequence>
			</complexType>			
			
			<element name="getAddressBookResponse"
type="wrapper:GetAddressBookResponse"/>
			<complexType name="GetAddressBookResponse">
			    <sequence>
			        <element ref="data:persons"/>
			    </sequence>
			</complexType>

		</schema>
		
	</wsdl:types>

	<wsdl:message name="addPersonRequest">
		<wsdl:part name="addPersonRequest"
element="wrapper:addPersonRequest"/>
	</wsdl:message>
	<wsdl:message name="addPersonResponse"/>
	
	<wsdl:message name="getPersonRequest">
		<wsdl:part name="getPersonRequest"
element="wrapper:getPersonRequest"/>
	</wsdl:message>
	<wsdl:message name="getPersonResponse">
		<wsdl:part name="getPersonResponse"
element="wrapper:getPersonResponse"/>
	</wsdl:message>

	<wsdl:message name="getAddressBookRequest"/>
	<wsdl:message name="getAddressBookResponse">
		<wsdl:part name="getAddressBookResponse"
element="wrapper:getAddressBookResponse"/>
	</wsdl:message>


	<wsdl:portType name="AddressBookPortType">
	    
		<wsdl:operation name="addPerson"
parameterOrder="addPersonRequest">
			<wsdl:input name="addPersonRequest"
message="impl:addPersonRequest"/>
			<wsdl:output name="addPersonResponse"
message="impl:addPersonResponse"/>
		</wsdl:operation>
		
		<wsdl:operation name="getPerson"
parameterOrder="getPersonRequest">
			<wsdl:input name="getPersonRequest"
message="impl:getPersonRequest"/>
			<wsdl:output name="getPersonResponse"
message="impl:getPersonResponse"/>
		</wsdl:operation>
		
		<wsdl:operation name="getAddressBook">
			<wsdl:input name="getAddressBookRequest"
message="impl:getAddressBookRequest"/>
			<wsdl:output name="getAddressBookResponse"
message="impl:getAddressBookResponse"/>
		</wsdl:operation>
      
	</wsdl:portType>

	<wsdl:binding name="AddressBookSoapBinding"
type="intf:AddressBookPortType">
		<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
		
		<wsdl:operation name="addPerson">
			<wsdlsoap:operation soapAction="addPerson"/>
			<wsdl:input name="addPersonRequest">
				<wsdlsoap:body use="literal"
namespace="http://ws.addressbook.maring.org"/>
			</wsdl:input>
			<wsdl:output name="addPersonResponse">
				<wsdlsoap:body use="literal"
namespace="http://ws.addressbook.maring.org"/>
			</wsdl:output>
		</wsdl:operation>
      
		<wsdl:operation name="getPerson">
			<wsdlsoap:operation soapAction="getPerson"/>
			<wsdl:input name="getPersonRequest">
				<wsdlsoap:body use="literal"
namespace="http://ws.addressbook.maring.org"/>
			</wsdl:input>
			<wsdl:output name="getPersonResponse">
				<wsdlsoap:body use="literal"
namespace="http://ws.addressbook.maring.org"/>
			</wsdl:output>
		</wsdl:operation>
		
		<wsdl:operation name="getAddressBook">
			<wsdlsoap:operation soapAction="getAddressBook"/>
			<wsdl:input name="getAddressBookRequest">
				<wsdlsoap:body use="literal"
namespace="http://ws.addressbook.maring.org"/>
			</wsdl:input>
			<wsdl:output name="getAddressBookResponse">
				<wsdlsoap:body use="literal"
namespace="http://ws.addressbook.maring.org"/>
			</wsdl:output>
		</wsdl:operation>
      
	</wsdl:binding>
	
	
	<wsdl:service name="AddressBookPortTypeService">
		<wsdl:port name="AddressBook"
binding="impl:AddressBookSoapBinding">
			<wsdlsoap:address
location="http://http.server:http.port/AddressBook/services/AddressBook"/>
		</wsdl:port>
	</wsdl:service>

</wsdl:definitions>


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com