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

Help with ComplexType

Expand Messages
  • bennychee
    I have the following ComplexType definitions for IP address, how do i define the data type? I have the following defined but not getting the result i wanted.
    Message 1 of 2 , Mar 10 4:59 AM
    • 0 Attachment
      I have the following ComplexType definitions for IP address, how do i define the data
      type? I have the following defined but not getting the result i wanted.

      $ip = "1.1.1.1";
      my $networkAddress = SOAP::Data->type(NetworkAddress =>
      \SOAP::Data->value(
      \SOAP::Data->value(String => $ip),
      \SOAP::Data->value(NetworkAddressType =>
      \SOAP::Data->value(String => "IPV4")
      )
      )
      );
      my $tc = SOAP::Data->type(TrafficClassifier => $networkAddress);
      $result = $s->startSession($username, $tc);

      <xsd:complexType name="TrafficClassifier">
      <xsd:sequence>
      <xsd:element name="networkAddress" nillable="false" type="impl:NetworkAddress">
      </xsd:element>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:complexType name="NetworkAddress">
      <xsd:sequence>
      <xsd:element name="value" nillable="false" type="xsd:string">
      </xsd:element>
      <xsd:element name="type" nillable="false" type="impl:NetworkAddressType">
      </xsd:element>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:simpleType name="NetworkAddressType">
      <xsd:restriction base="xsd:string">
      <xsd:enumeration value="IPV4">
      </xsd:enumeration>
      <xsd:enumeration value="IPV6">
      </xsd:enumeration>
      </xsd:restriction>
      </xsd:simpleType>
    • bennychee
      hi all, Manage to get it translated. cheers. my $tclass = SOAP::Data- name( trafficClassifier = SOAP::Data- value( SOAP::Data- name( networkAddress =
      Message 2 of 2 , Mar 11 8:45 AM
      • 0 Attachment
        hi all,

        Manage to get it translated. cheers.

        my $tclass = SOAP::Data->name("trafficClassifier" =>
        \SOAP::Data->value(
        SOAP::Data->name("networkAddress" =>
        \SOAP::Data->value(
        SOAP::Data->name("value" => $ip),
        SOAP::Data->name("type" => "IPV4")->type("impl:NetworkAddressType")
        )
        )
        )
        );

        --- In soaplite@yahoogroups.com, "bennychee" <bennychee@...> wrote:
        >
        > I have the following ComplexType definitions for IP address, how do i define the data
        > type? I have the following defined but not getting the result i wanted.
        >
        > $ip = "1.1.1.1";
        > my $networkAddress = SOAP::Data->type(NetworkAddress =>
        > \SOAP::Data->value(
        > \SOAP::Data->value(String => $ip),
        > \SOAP::Data->value(NetworkAddressType =>
        > \SOAP::Data->value(String => "IPV4")
        > )
        > )
        > );
        > my $tc = SOAP::Data->type(TrafficClassifier => $networkAddress);
        > $result = $s->startSession($username, $tc);
        >
        > <xsd:complexType name="TrafficClassifier">
        > <xsd:sequence>
        > <xsd:element name="networkAddress" nillable="false" type="impl:NetworkAddress">
        > </xsd:element>
        > </xsd:sequence>
        > </xsd:complexType>
        >
        > <xsd:complexType name="NetworkAddress">
        > <xsd:sequence>
        > <xsd:element name="value" nillable="false" type="xsd:string">
        > </xsd:element>
        > <xsd:element name="type" nillable="false" type="impl:NetworkAddressType">
        > </xsd:element>
        > </xsd:sequence>
        > </xsd:complexType>
        >
        > <xsd:simpleType name="NetworkAddressType">
        > <xsd:restriction base="xsd:string">
        > <xsd:enumeration value="IPV4">
        > </xsd:enumeration>
        > <xsd:enumeration value="IPV6">
        > </xsd:enumeration>
        > </xsd:restriction>
        > </xsd:simpleType>
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.