Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #187 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Axis enumerations and soap4r

Reported by: nahi Assigned to: nahi
Priority: high Milestone: 1.5.6
Component: wsdl4r Version: 1.5
Keywords: Cc:

Description

from soap4r ML.

Hi, I'm developing a webservice client that should connect to an axis
webservice. Almost everything works fine, except for a specific service
which takes an enumeration as one of its parameters.

Here it is the wsdl part that defines the enum:
<simpleType name="QueryFilter">
  <restriction base="xsd:string">
    <enumeration value="FILTER_ALL"/>
    <enumeration value="FILTER_VERIFIED"/>
    <enumeration value="FILTER_NOT_VERIFIED"/>
    <enumeration value="FILTER_SUGGESTED"/>
  </restriction>
</simpleType>

I run wsdl2ruby script and everything worked fine. The QueryFilter type
is transformed into a module:

module QueryFilter
  FILTER_ALL = "FILTER_ALL"
  FILTER_NOT_VERIFIED = "FILTER_NOT_VERIFIED"

  FiLTER_SUGGESTED = "FILTER_SUGGESTED"

  FILTER_VERIFIED = "FILTER_VERIFIED"
end

When I try to connect to the service it complains about type
definitions and gives this message

org.xml.sax.SAXException: Bad types (class java.lang.String -> class
QueryFilter)

I run the script in debug mode and noticed that the QueryFilter
parameter is sent with type xsd:string:

...
<filter xsi:type="xsd:string">FILTER_ALL</filter>
...

I have a java client too and running it with axis soap monitor I can
see it uses this form for the same parameter:

...
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:QueryFilter" xmlns:ns3="urn:Quiew"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">FILTER_ALL</multiRef>
...

, where the multiRef id is referenced by a filter element.

Any hints on how I could solve the problem?

Thanks!

Change History

12/04/05 11:35:29 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

(In [1679]) changed classdef generation handling of WSDL simpleType enumeration: it was converted to String constants in a module. now it generates constants of a class as follows.

module Foo

ITEM_1 = "item1"

end

=>

class Foo < ::String

ITEM_1 = Foo.new("item1"

end

Amazon EC sample did not work. element definition in an Array definition wrongly defined as a type. fixed. closes #187, #188.