wsdl problem

Discussion in 'Ruby' started by haakon tullerusk, Feb 24, 2006.

  1. Hi!

    I used wsdl2ruby to generate classes and methods.
    But I have a broblem with one of the methods and its arguments

    method in driver.rb:

    class EndUserIdentifier
    @@schema_type = "EndUserIdentifier"
    @@schema_ns = "http://www.csapi.org/schema/parlayx/common/v1_0"
    @@schema_element = [["value", ["SOAP::SOAPAnyURI", XSD::QName.new(nil,
    "value")]]]

    attr_accessor :value

    def initialize(value = nil)
    @value = value
    end
    end
    _______________________________________________________________

    method in defaltDriver.rb
    Methods = [
    [ XSD::QName.new("http://www.csapi.org/wsdl/parlayx/sms/v1.0",
    "sendSms"),
    "",
    "sendSms",
    [ ["in", "destinationAddressSet", ["EndUserIdentifier[]",
    "http://www.csapi.org/schema/parlayx/common/v1_0",
    "EndUserIdentifier"]],
    ["in", "senderName", ["::SOAP::SOAPString"]],
    ["in", "charging", ["::SOAP::SOAPString"]],
    ["in", "message", ["::SOAP::SOAPString"]],
    ["retval", "result", ["::SOAP::SOAPString"]] ],
    { :request_style => :rpc, :request_use => :encoded,
    :response_style => :rpc, :response_use => :encoded }
    ],
    ____________________________________________________

    this is my client.rb file

    smswsdl = 'http://x.x.x.x/parlayx/services/SendSmsPort'
    obj2 = SendSmsPort.new(smswsdl)

    #sendSms (EndUserIdentifier[] destinationAddressSet, String senderName,
    String charging, String message, out String requestIdentifier)

    smsId =(???, 'some_nr', 'some_string', 'some_message')
    )
    I want to run the sendSms method but I get error from the server

    #<SOAP::Mapping::Object:0x2bf6868>: java.lang.IllegalArgumentException:
    java.lan
    g.ClassCastException@d8a125 (SOAP::FaultError)

    How to I create a new EndUserIdentifier object?
    Any help will be greatly appreciated.
    --haakon

    --
    Posted via http://www.ruby-forum.com/.
    haakon tullerusk, Feb 24, 2006
    #1
    1. Advertising

  2. haakon tullerusk

    Geoff Lane Guest

    eui = EndUserIdentifier.new(some_value) - not sure what value is
    intended, but your service definition should tell you that?


    I found that there are a lot of improvements in the latest Subversion
    code over the last release. This is especially true with Document
    Literal service support. So, you might want to try that.

    The other thing I found using SOAP4R is that the wsdl2ruby didn't always
    behave well. I used the xsd2ruby to generate classes, but then used
    those classes in some manually constructed code.

    soap =
    SOAP::WSDLDriverFactory.new('http://example.com/services/ContactsService?WSDL').create_rpc_driver
    soap.generate_explicit_type = true
    soap.wiredump_dev = STDOUT if $DEBUG
    result = soap.GetContacts(ContactsRequest.new())
    result.contacts.each { |c| print_contact(c) }


    The soap.wiredump_dev = STDOUT will print out all of the SOAP messages
    to standard output which is really nice for debugging.

    haakon tullerusk wrote:
    > Hi!
    >
    > I used wsdl2ruby to generate classes and methods.
    > But I have a broblem with one of the methods and its arguments
    >
    > method in driver.rb:
    >
    > class EndUserIdentifier
    > @@schema_type = "EndUserIdentifier"
    > @@schema_ns = "http://www.csapi.org/schema/parlayx/common/v1_0"
    > @@schema_element = [["value", ["SOAP::SOAPAnyURI", XSD::QName.new(nil,
    > "value")]]]
    >
    > attr_accessor :value
    >
    > def initialize(value = nil)
    > @value = value
    > end
    > end
    > _______________________________________________________________
    >
    > method in defaltDriver.rb
    > Methods = [
    > [ XSD::QName.new("http://www.csapi.org/wsdl/parlayx/sms/v1.0",
    > "sendSms"),
    > "",
    > "sendSms",
    > [ ["in", "destinationAddressSet", ["EndUserIdentifier[]",
    > "http://www.csapi.org/schema/parlayx/common/v1_0",
    > "EndUserIdentifier"]],
    > ["in", "senderName", ["::SOAP::SOAPString"]],
    > ["in", "charging", ["::SOAP::SOAPString"]],
    > ["in", "message", ["::SOAP::SOAPString"]],
    > ["retval", "result", ["::SOAP::SOAPString"]] ],
    > { :request_style => :rpc, :request_use => :encoded,
    > :response_style => :rpc, :response_use => :encoded }
    > ],
    > ____________________________________________________
    >
    > this is my client.rb file
    >
    > smswsdl = 'http://x.x.x.x/parlayx/services/SendSmsPort'
    > obj2 = SendSmsPort.new(smswsdl)
    >
    > #sendSms (EndUserIdentifier[] destinationAddressSet, String senderName,
    > String charging, String message, out String requestIdentifier)
    >
    > smsId =(???, 'some_nr', 'some_string', 'some_message')
    > )
    > I want to run the sendSms method but I get error from the server
    >
    > #<SOAP::Mapping::Object:0x2bf6868>: java.lang.IllegalArgumentException:
    > java.lan
    > g.ClassCastException@d8a125 (SOAP::FaultError)
    >
    > How to I create a new EndUserIdentifier object?
    > Any help will be greatly appreciated.
    > --haakon
    >



    --
    Geoff Lane <>
    Geoff Lane, Feb 24, 2006
    #2
    1. Advertising

  3. Hi!

    The line
    smsId =(???, 'some_nr', 'some_string', 'some_message')

    was supposed to look like:
    smsId = sendSms(???, 'some_nr', 'some_string', 'some_message')

    The first argument is a EndUserIdentifierObject?

    eu = EndUserIdentifier('what_value?')

    Geoff Lane wrote:
    > eui = EndUserIdentifier.new(some_value) - not sure what value is
    > intended, but your service definition should tell you that?


    From the wsdl file? how?
    >
    >
    > I found that there are a lot of improvements in the latest Subversion
    > code over the last release. This is especially true with Document
    > Literal service support. So, you might want to try that.
    >
    > The other thing I found using SOAP4R is that the wsdl2ruby didn't always
    > behave well. I used the xsd2ruby to generate classes, but then used
    > those classes in some manually constructed code.
    >
    > soap =
    > SOAP::WSDLDriverFactory.new('http://example.com/services/ContactsService?WSDL').create_rpc_driver
    > soap.generate_explicit_type = true
    > soap.wiredump_dev = STDOUT if $DEBUG
    > result = soap.GetContacts(ContactsRequest.new())
    > result.contacts.each { |c| print_contact(c) }
    >
    >
    > The soap.wiredump_dev = STDOUT will print out all of the SOAP messages
    > to standard output which is really nice for debugging.


    If I use soap.wiredump I get the following error from the axis server:

    #<SOAP::Mapping::Object:0x2bf5f68>: java.lang.IllegalArgumentException:
    java.lang.ClassCastException@cc17f1 (SOAP::FaultError)


    --haakon



    --
    Posted via http://www.ruby-forum.com/.
    haakon tullerusk, Mar 1, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dark
    Replies:
    1
    Views:
    4,603
    milfar
    Nov 14, 2008
  2. Chris Bedford
    Replies:
    0
    Views:
    559
    Chris Bedford
    Aug 21, 2003
  3. Stephen Edgecombe

    WSDL.EXE: WSDL Import Directive

    Stephen Edgecombe, Aug 13, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    222
    Stephen Edgecombe
    Aug 13, 2003
  4. RH
    Replies:
    1
    Views:
    248
    Dino Chiesa [Microsoft]
    May 27, 2004
  5. mrnu

    wsdl.exe fails with WebMethods generated wsdl file

    mrnu, Jun 7, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    195
Loading...

Share This Page