Loading ...
Sorry, an error occurred while loading the content.

Editing stubmaker output

Expand Messages
  • dan.horne
    Hi I ve generated the WSDL stub for SugarCRM using stubmaker.pl. In most cases the data types are simple, but there are a few complex types that I d like to
    Message 1 of 2 , Sep 26, 2006
    • 0 Attachment
      Hi

      I've generated the WSDL stub for SugarCRM using stubmaker.pl. In most
      cases the data types are simple, but there are a few complex types
      that I'd like to edit by hand, but I'm not sure of the syntax. For
      example, here is the "login" method

      login => {
      endpoint => 'http://server/soap.php',
      soapaction => 'http://server/soap.php/login',
      namespace => 'http://www.sugarcrm.com/sugarcrm',
      parameters => [
      SOAP::Data->new(name => 'user_auth', type => 'tns:user_auth',
      attr => {}),
      SOAP::Data->new(name => 'application_name', type =>
      'xsd:string', attr => {}),
      ], # end parameters
      }, # end login

      the user_auth complex type is defined as:

      <xsd:complexType name="user_auth">
      <xsd:all>
      <xsd:element name="user_name" type="xsd:string"/>
      <xsd:element name="password" type="xsd:string"/>
      <xsd:element name="version" type="xsd:string"/>
      </xsd:all>
      </xsd:complexType>

      My mangled attempt is:

      login => {
      endpoint => 'http://server/soap.php',
      soapaction => 'http://server/soap.php/login',
      namespace => 'http://www.sugarcrm.com/sugarcrm',
      parameters => [
      SOAP::Data->new(name => 'user_auth', type => \SOAP::Data->value(
      SOAP::Data->new(name => 'user_name', type => 'xsd:string', attr => {}),
      SOAP::Data->new(name => 'password', type => 'xsd:string', attr => {}),
      SOAP::Data->new(name => 'version', type => 'xsd:string', attr => {})
      ), attr => {}),
      SOAP::Data->new(name => 'application_name', type =>
      'xsd:string', attr => {}),
      ], # end parameters
      }, # end login

      but alas, it's all wrong. Any ideas are appreciated...

      Thanks

      Dan
    • Sherzod Ruzmetov
      How about: my $d = SOAP::Data- name(user_auth = SOAP::Data- value( SOAP::Data- name( user_name )- type( string ),
      Message 2 of 2 , Sep 26, 2006
      • 0 Attachment
        Message
        How about:
         
        my $d = SOAP::Data->name(user_auth =>
            \SOAP::Data->value(
                SOAP::Data->name('user_name')->type('string'),
                SOAP::Data->name('password')->type('string'),
                SOAP::Data->name('version')->type('string')
        ));
         
        Haven't tested it, but looks correct :). I wish there was a way of having SOAP::Lite
        output a data structure as XML
         
        Sherzod
         
         
         
        -----Original Message-----
        From: soaplite@yahoogroups.com [mailto:soaplite@yahoogroups.com] On Behalf Of dan.horne
        Sent: Tuesday, September 26, 2006 9:48 PM
        To: soaplite@yahoogroups.com
        Subject: [soaplite] Editing stubmaker output

        Hi

        I've generated the WSDL stub for SugarCRM using stubmaker.pl. In most
        cases the data types are simple, but there are a few complex types
        that I'd like to edit by hand, but I'm not sure of the syntax. For
        example, here is the "login" method

        login => {
        endpoint => 'http://server/ soap.php',
        soapaction => 'http://server/ soap.php/ login',
        namespace => 'http://www.sugarcrm .com/sugarcrm',
        parameters => [
        SOAP::Data-> new(name => 'user_auth', type => 'tns:user_auth' ,
        attr => {}),
        SOAP::Data-> new(name => 'application_ name', type =>
        'xsd:string' , attr => {}),
        ], # end parameters
        }, # end login

        the user_auth complex type is defined as:

        <xsd:complexType name="user_auth" >
        <xsd:all>
        <xsd:element name="user_name" type="xsd:string" />
        <xsd:element name="password" type="xsd:string" />
        <xsd:element name="version" type="xsd:string" />
        </xsd:all>
        </xsd:complexType>

        My mangled attempt is:

        login => {
        endpoint => 'http://server/ soap.php',
        soapaction => 'http://server/ soap.php/ login',
        namespace => 'http://www.sugarcrm .com/sugarcrm',
        parameters => [
        SOAP::Data-> new(name => 'user_auth', type => \SOAP::Data- >value(
        SOAP::Data-> new(name => 'user_name', type => 'xsd:string' , attr => {}),
        SOAP::Data-> new(name => 'password', type => 'xsd:string' , attr => {}),
        SOAP::Data-> new(name => 'version', type => 'xsd:string' , attr => {})
        ), attr => {}),
        SOAP::Data-> new(name => 'application_ name', type =>
        'xsd:string' , attr => {}),
        ], # end parameters
        }, # end login

        but alas, it's all wrong. Any ideas are appreciated. ..

        Thanks

        Dan

      Your message has been successfully submitted and would be delivered to recipients shortly.