• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem when trying to use return type Integer

Olga Ivanova
Posts: 1
  • Mark post as helpful
  • send pies
  • 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"/>
<parameter name="allowedMethods" value="userAuthorized"/>
<parameter name="scope" value="Application"/>

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"/>

Isn't Integer supported?

Thanks in advance,
Peer Reynders
Posts: 2968
  • Mark post as helpful
  • send pies
  • 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:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic