axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ebert, Chris" <chris.eb...@hp.com>
Subject RE: WSDL2Java problem with complexType response
Date Mon, 14 Nov 2005 18:20:00 GMT
You might try twiddling your WSDL, if you can. I've run into similar
problems. Sometimes switching from 'sequence' to 'all' worked for me. So
far, I've always been able to work it out but I *do* consider it a
little annoying.

When I stepped through the WSDL2Java code, Axis was doing something
clever to 'unwrap' a doc-lit call into a method call that looked like an
RPC-encoded call. I found the 'nowrapped' flag worked for one method,
but it changed some of the others in ways I didn't like. I wanted calls
with *no* arguments to be of the form +foo():FooResponse, and the
nowrapped flag made them take the form +foo(FooParams):FooResponse,
where FooParams has no fields. :-P.

Chris 

-----Original Message-----
From: Anne Thomas Manes [mailto:atmanes@gmail.com] 
Sent: Saturday, November 12, 2005 05:33
To: axis-user@ws.apache.org
Subject: Re: WSDL2Java problem with complexType response

Hmmm...

Doesn't make sense to me why it isn't producing the signature you want,
but you might try adding another layer of wrapping in your response
message, so that when Axis unwraps the request, it returns a return
value rather than a set of parameters. e.g.:

    <xs:element name="FlightAvailabilityResponse">
       <xs:complexType>
          <xs:sequence>
              <xs:element name="FlightAvailabilityReturn">
                 <xs:complexType>
                    <xs:sequence>
                        <xs:element name="FlightNo" type="xs:string"/> 
                        <xs:element name="TravelClass2"
type="xs:string"/>
                        <xs:element name="Price" type="xs:string"/>
                        <xs:element name="DepartureDateTime"
type="xs:string"/> 
                        <xs:element name="ReturnDateTime"
type="xs:string"/>
                        <xs:element name="Approved" type="xs:string"/>
                    </xs:sequence> 
                 </xs:complexType> 
              </xs:element>
            </xs:sequence> 
          </xs:complexType> 
       </xs:element>

Anne



On 11/11/05, LiChung Liu <lichungliu@gmail.com> wrote:

	Hi, I've written a wrapped-style service WSDL, but have been
unable to
	get the WSDL2Java to generate the right method signature. In the
wsdl,
	I've specified a complexType for the request and response.
However the 
	generated method always result in a 'void method(param1, param2,
param3...)'.
	I would appreciate another set of eyes on this, thank you.
	
	WSDL2Java generated method signature:
	public void flightAvailability(String p1, String p2, String
p3...) {..} 
	
	Desired method signature:
	public FlightAvailabilityResponse flightAvailibility(String p1,
String p2, String p3...) {..}
	
	
	WSDL in question:
	-----------------------------
	<?xml version="1.0 " encoding="utf-8"?>
	<wsdl:definitions
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/ " xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/
<http://schemas.xmlsoap.org/wsdl/soap/> "
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> "
xmlns:tns="http://localhost:8081/axis/services/airline/ " xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/ <http://schemas.xmlsoap.org/wsdl/> "
targetNamespace="http://localhost:8081/axis/services/airline/ ">
	    <wsdl:types>
	        <xs:schema elementFormDefault="qualified"
targetNamespace=" http://localhost:8081/axis/services/airline/">
	            <xs:element name="FlightAvailability"> 
	                <xs:complexType> 
	                    <xs:sequence>
	                        <xs:element name="OriginFrom"
type="xs:string"/>
	                        <xs:element name="DestinationTo"
type="xs:string"/> 
	                        <xs:element name="DesiredDepartureDate"
type="xs:date"/>
	                        <xs:element name="DesiredReturnDate"
type="xs:date"/>
	                        <xs:element name="TravelClass1"
type="xs:string"/>
	                    </xs:sequence>
	                </xs:complexType>
	            </xs:element> 
	            <xs:element name="FlightAvailabilityRespons
	e">
	                <xs:complexType>
	                    <xs:sequence>
	                        <xs:element name="FlightNo"
type="xs:string"/> 
	                        <xs:element name="TravelClass2"
type="xs:string"/>
	                        <xs:element name="Price"
type="xs:string"/>
	                        <xs:element name="DepartureDateTime"
type="xs:string"/> 
	                        <xs:element name="ReturnDateTime"
type="xs:string"/>
	                        <xs:element name="Approved"
type="xs:string"/>
	                    </xs:sequence> 
	                </xs:complexType>
	            </xs:element>
	        </xs:schema>
	    </wsdl:types>
	    <wsdl:message name="FlightRequestMessage">
	        <wsdl:part name="parameters"
element="tns:FlightAvailability"/> 
	    </wsdl:message>
	    <wsdl:message name="FlightResponseMessage">
	        <wsdl:part name="parameters"
element="tns:FlightAvailabilityResponse"/>
	    </wsdl:message> 
	    <wsdl:portType name="FlightAvailabilityPT">
	        <wsdl:operation name="FlightAvailability">
	            <wsdl:input message="tns:FlightRequestMessage"/>
	            <wsdl:output message="tns:FlightResponseMessage"/>
	        </wsdl:operation>
	    </wsdl:portType>
	    <wsdl:binding name="AirlineServiceBinding"
type="tns:FlightAvailabilityPT"> 
	        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/
<http://schemas.xmlsoap.org/soap/http%22/> >
	        <wsdl:operation name="FlightAvailability"> 
	            <soap:operation soapAction="FlightAvailability"/>
	            <wsdl:input>
	                <soap:body use="literal"/>
	            </wsdl:input>
	            <wsdl:output> 
	                <soap:body use="literal"/>
	            </wsdl:output>
	        </wsdl:operation>
	    </wsdl:binding>
	    <wsdl:service name="AirlineService"> 
	        <wsdl:port name="AirlineService"
binding="tns:AirlineServiceBinding">
	            <soap:address location="
http://localhost:8081/axis/services/AirlineService"/
<http://localhost:8081/axis/services/AirlineService%22/> >
	        </wsdl:port>
	    </wsdl:service>
	</wsdl:definitions>
	---------------------------------



Mime
View raw message