• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem when trying to use return type Integer

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I have following in my wsdd-file:
<service name="WSAccess" provider="java:RPC" style="rpc" use="encoded">
<parameter name="wsdlTargetNamespace" value="urn:myws.webservice"/>
<parameter name="wsdlServiceElement" value="WSAccessService"/>
<parameter name="wsdlServicePort" value="WSAccess"/>
<parameter name="className" value="myws.webservices.sec.WSAccessImpl"/>
<parameter name="wsdlPortType" value="WSAccess"/>
<operation name="userAuthorized" qname="operNS:userAuthorized" xmlns perNS="urn:myws.webservice" returnQName="userAuthorizedReturn" returnType="rtns:integer" xmlns:rtns="http://www.w3.org/2001/XMLSchema">
<parameter name="xml" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
</operation>
<parameter name="allowedMethods" value="userAuthorized"/>
<parameter name="scope" value="Application"/>
</service>

The function I use should return Integer, but in automatically generated files (I use Axis) there is int everywhere.

This is what I get in generated wsdl-file:
<wsdl:message name="userAuthorizedResponse">
<wsdl art name="userAuthorizedReturn" type="xsd:int"/>
</wsdl:message>

Isn't Integer supported?

Thanks in advance,
Olga
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you have bolded are XML schema types - not Java Types:
{http://www.w3.org/2001/XMLSchema}integer A base-10 integer number of any size (...)
{http://www.w3.org/2001/XMLSchema}int A base-10 integer between -2,147,483,648 and 2,147,483,647


The default mappings are supposed to be

XML Schema -> Java

[type="{http://www.w3.org/2001/XMLSchema}integer"] -> java.math.BigInteger
[type="{http://www.w3.org/2001/XMLSchema}int" nillable="false"] -> int
[type="{http://www.w3.org/2001/XMLSchema}int" nillable="true"] -> java.lang.Integer

The fact that the original Java used java.lang.Integer has no effect on the mapping of {http://www.w3.org/2001/XMLSchema}int.

So to get a java.lang.Integer you would need something like:
 
reply
    Bookmark Topic Watch Topic
  • New Topic