axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pugalia, Jai P (JP)" <jpuga...@avaya.com>
Subject RE: Strong types in Axis2 wsdl
Date Fri, 19 Sep 2008 14:02:23 GMT
Hi Keith,
 
If I do not include the originally generated WSDL (java2wsdl), the
response from server is 
 
<?xml version="1.0" encoding="http://www.w3.org/2003/05/soap-envelope"
standalone="no"?>
<soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
 <soapenv:Body>
  <ns:getLicenseInfoResponse
xmlns:ns="http://vpmanagement.ws.xml.avaya.com">
   <ns:return xmlns:ax21="http://ws.vp.avaya.com/xsd
<http://ws.vp.avaya.com/xsd> " type="com.avaya.vp.ws.FieldArray">
    <ax21:field type="com.avaya.vp.ws.Field">
     <ax21:dataType>Integer</ax21:dataType>
     <ax21:name>MaximumLicenses</ax21:name>
     <ax21:value>50</ax21:value>
    </ax21:field>
   </ns:return>
  </ns:getLicenseInfoResponse>
 </soapenv:Body>
</soapenv:Envelope>
 
However if I do include the originally generated WSDL in the aar file ,
the response is 
 
<?xml version="1.0" encoding="http://www.w3.org/2003/05/soap-envelope"
standalone="no"?>
<soapenv:Envelope
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
 <soapenv:Body>
  <ns:getLicenseInfoResponse
xmlns:ns="http://vpmanagement.ws.xml.avaya.com">
   <ns:return type="com.avaya.vp.ws.FieldArray">
    <ns:field type="com.avaya.vp.ws.Field">
     <ns:dataType>Integer</ns:dataType>
     <ns:name>MaximumLicenses</ns:name>
     <ns:value>50</ns:value>
   </ns:field>
   </ns:return>
  </ns:getLicenseInfoResponse>
 </soapenv:Body>
</soapenv:Envelope>
 
The client was generated using the originally generated WSDL and the
generated code throws an exception when the WSDL is included in the aar
file.
Exception occured: org.apache.axis2.databinding.ADBException: Unexpected
subelement field

Thanks,
JP
 
 
________________________________

From: keith chapman [mailto:keithgchapman@gmail.com] 
Sent: Tuesday, September 02, 2008 9:24 AM
To: axis-user@ws.apache.org
Subject: Re: Strong types in Axis2 wsdl


Hi Jai,

Can you try using TCPMonitor and capture the messages in the two
scenarios. That would help figure out wats going on. You may use this
link on how TCPMonitor could be set up on Idea or Eclipse.
<http://www.keith-chapman.org/2008/07/using-tcp-monitor-to-debug-web-ser
vice.html>  [1]

Thanks,
Keith.

[1]
http://www.keith-chapman.org/2008/07/using-tcp-monitor-to-debug-web-serv
ice.html

On Tue, Sep 2, 2008 at 9:35 PM, Pugalia, Jai P (JP) <jpugalia@avaya.com>
wrote:


	Hi Keith,
	 
	I tried your suggestion of updating the wsdl and including it in
the aar. (Also set the "useOriginalWSDL" parameter to true). However
when I make a web service call which returns the Field object, I get
this exception:
	 
	reason:org.apache.axis2.databinding.ADBException: Unexpected
subelement

	If I do not include the updated wsdl, then everything works
properly. 

	Any suggestions on what could be wrong? 

	Thanks,

	Jai


________________________________

	
	From: keith chapman [mailto:keithgchapman@gmail.com] 
	
	Sent: Monday, September 01, 2008 9:25 PM 

	To: axis-user@ws.apache.org
	Subject: Re: Strong types in Axis2 wsdl 

	Hi,
	
	You cannot get this into a auto generated WSDL.  The workaround
for you will be to save the auto generated WSDL, edit it to your needs
and pack it into the aar file and deploy the service in Axis2. You will
need to use restictions on your dataType in order to achieve this. Here
is an example of a WSDL that has restrictions
<http://mooshup.com/services/system/digit2image?wsdl2>   [1]
	
	Thanks,
	Keith.
	
	[1] http://mooshup.com/services/system/digit2image?wsdl2
	
	
	
	On Tue, Sep 2, 2008 at 9:42 AM, Pugalia, Jai P (JP)
<jpugalia@avaya.com> wrote:
	

		Hi Keith,
		
		I have written the Java class and then generating the
WSDL from that.
		
		The WSDL generates this:
		
		           <xs:complexType name="Field">
		               <xs:sequence>
		
		                         <xs:element minOccurs="0"
name="objectType"
		nillable="true" type="xs:string"/>
		
		                       <xs:element minOccurs="0"
name="dataType"
		
		nillable="true" type="xs:string"/>
		
		                   <xs:element minOccurs="0" name="name"
		
		nillable="true" type="xs:string"/>
		
		                   <xs:element minOccurs="0"
name="value"
		
		nillable="true" type="xs:string"/>
		
		               </xs:sequence>
		           </xs:complexType>
		
		I want to restrict the values of objectType to actual
string values like
		"Array", "Structure" & "Table".
		
		Thanks,
		Jai
		

		-----Original Message-----
		From: keith chapman [mailto:keithgchapman@gmail.com]
		Sent: Monday, September 01, 2008 9:41 AM
		To: axis-user@ws.apache.org
		
		Subject: Re: Strong types in Axis2 wsdl
		
		Hi Jai,
		
		Could you elaborate on what you mean by "Array" and
"Structure"? Do you
		mean the string values "Array" and "Structure"? or the
actual structure
		of an Array and Structure?
		
		Thanks,
		Keith.
		
		On Thu, Aug 28, 2008 at 6:31 PM, Pugalia, Jai P (JP)
		<jpugalia@avaya.com> wrote:
		> Hi,
		>
		> I have an Axis2 wsdl which exposes an ObjectType as
		>
		> <xs:element minOccurs="0" name="objectType"
nillable="true"
		> type="xs:string"/>
		>
		> I want to restrict the valid values to say "Array" and
"Structure". If
		
		> I change the element to be an enumeration, it does not
work as looks
		> like
		> Axis2 does not support enumerations yet. Is there any
other way I can
		> make this strongly typed in the wsdl.
		>
		> Thanks,
		> Jai
		
		
		
		--
		Keith Chapman
		Senior Software Engineer
		WSO2 Inc.
		Oxygenating the Web Service Platform.
		http://wso2.org/
		
		blog: http://www.keith-chapman.org
		
		
	
---------------------------------------------------------------------
		To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
		For additional commands, e-mail:
axis-user-help@ws.apache.org
		
		
	
---------------------------------------------------------------------
		To unsubscribe, e-mail:
axis-user-unsubscribe@ws.apache.org
		For additional commands, e-mail:
axis-user-help@ws.apache.org
		
		




	-- 
	Keith Chapman
	Senior Software Engineer
	WSO2 Inc.
	Oxygenating the Web Service Platform.
	http://wso2.org/
	
	blog: http://www.keith-chapman.org
	




-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org


Mime
View raw message