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

Ticket #377 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Schema type not passed for enums

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

Description

from soap4r-ml

This is a new issue, but sort of a continuation of
http://groups.google.com/group/soap4r/browse_thread/thread/35b7eb7f41c3603c

My WSDL file specifies a number of enumerations. wsdl2ruby is creating
stubs for these enumerations like this (I shortened the class for
brevity)

# {http://developer.cognos.com/schemas/bibus/3/}runOptionEnum
class RunOptionEnum < ::String
  AttachmentEncoding = RunOptionEnum.new("attachmentEncoding")
  Burst = RunOptionEnum.new("burst")
  C_Data = RunOptionEnum.new("data")
  ContinueConversation = RunOptionEnum.new("continueConversation")
  CredentialParameters = RunOptionEnum.new("credentialParameters")
end

In the mapping stub, SOAP4R created this:

  EncodedRegistry.register(
    :class => Cognos::RunOptionEnum,
    :schema_ns => "http://developer.cognos.com/schemas/bibus/3/",
    :schema_type => "runOptionEnum"
  )

So far so good. However, it looks like SOAP4R is specifying the
incorrect type when I make a request that needs the
Cognos::RunOptionEnum class as a parameter.  As an example, here is a
snippet of my request code:

     options = Cognos::OptionArray.new()

     run_option_output = Cognos::RunOptionBoolean.new
     run_option_output.name = Cognos::RunOptionEnum::SaveOutput
     run_option_output.value = "false"

     options << run_option_output

    # Call service to generate report
    reports = Cognos::ReportServiceT.new(@endPoint)
    file      = Cognos::SearchPathSingleObject.new(reportPath)
    runResult = reports.run(file, parameter_array, options)

See how I'm setting run_option_output.name  to
Cognos::RunOptionEnum::SaveOutput? When I execute this code, the
server returns the following SOAP error:

    RSV-AOM-0025 The property 'runOption:name' of type
'bus:runOptionEnum' cannot be set to a value of type 'xs:string'.

The actual wire dump from the request is here:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <n1:run xmlns:n1="http://developer.cognos.com/schemas/
reportService/1"
        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <objectPath xmlns:n2="http://developer.cognos.com/schemas/bibus/
3/"
          xsi:type="n2:searchPathSingleObject">/content/
package[@name=&apos;meta_data_test&apos;]/report[@name=&apos;Rich
Email Success_summary&apos;]</objectPath>
      <parameterValues xmlns:n3="http://schemas.xmlsoap.org/soap/
encoding/"
          xmlns:n4="http://developer.cognos.com/schemas/bibus/3/"
          xsi:type="n3:Array"
          n3:arrayType="n4:parameterValue[2]">
        <item>
          <name xsi:type="xsd:string">STOP</name>
          <value xsi:type="xsd:string">xsdDate</value>
        </item>
        <item>
          <name xsi:type="xsd:string">START</name>
          <value xsi:type="xsd:string">xsdDate</value>
        </item>
      </parameterValues>
      <options n5:arrayType="n6:option[4]"
          xmlns:n5="http://schemas.xmlsoap.org/soap/encoding/"
          xsi:type="n5:Array"
          xmlns:n6="http://developer.cognos.com/schemas/bibus/3/">
        <item xsi:type="n6:runOptionBoolean">
          <name xsi:type="xsd:string">saveOutput</name>
          <value xsi:type="xsd:boolean">false</value>
        </item>
      </options>
    </n1:run>
  </env:Body>
</env:Envelope>


Anything immediately obvious that I'm doing incorrectly?

Change History

07/12/07 22:34:02 changed by nahi

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

(In [1880]) * schema type not passed for simletype. instead, the base class xsd:string was passed. closes #377.