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

How do I create an optional string?

Expand Messages
  • gnawed
    If I have a method that takes two strings, but only the first one is required: setName(lastname, firstname) How do I convey that in the WSDL file? Do I need
    Message 1 of 3 , Sep 17, 2003
    • 0 Attachment
      If I have a method that takes two strings, but only the first one is
      required:

      setName(lastname, firstname)

      How do I convey that in the WSDL file? Do I need to create a new
      type? Or can I use minOccurs/maxOccurs in the <message><part>...
    • Byrne Reese
      Message 2 of 3 , Sep 18, 2003
      • 0 Attachment
        <xsd:complexType name="Fullname">
        <xsd:all>
        <xsd:element maxOccurs="1" minOccurs="0" name="firstname"
        type="xsd:string"/>
        <xsd:element maxOccurs="1" minOccurs="0" name="lastname"
        type="xsd:string"/>
        </xsd:all>
        </xsd:complexType>

        You were on the right track in a previous method where you defined a
        data type. That is one way anyway...

        On Wed, 2003-09-17 at 22:46, gnawed wrote:
        > If I have a method that takes two strings, but only the first one is
        > required:
        >
        > setName(lastname, firstname)
        >
        > How do I convey that in the WSDL file? Do I need to create a new
        > type? Or can I use minOccurs/maxOccurs in the <message><part>...
        >
        >
        >
        >
        >
        > Yahoo! Groups Sponsor
        > ADVERTISEMENT
        > click here
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        --
        Byrne Reese <byrne@...>
      • gnawed
        Thanks for the quick reply. Actually, I m looking for a solution that doesn t involve a wrapper element, i.e. your solution would change my original call
        Message 3 of 3 , Sep 18, 2003
        • 0 Attachment
          Thanks for the quick reply.

          Actually, I'm looking for a solution that doesn't involve a "wrapper"
          element, i.e. your solution would change my original call into
          something like:

          setName(aFullname)

          where 'aFullname' is of type Fullname.


          I want to have a call like:

          setName(lastname, firstname)

          where both params are strings, but the WSDL file will define the
          input message as having an optional 2nd param.

          Is this possible? Is it necessary? i.e. can I call this method w/o
          the firstname and not get an error?

          --- In soaplite@yahoogroups.com, Byrne Reese <byrne@m...> wrote:
          > <xsd:complexType name="Fullname">
          > <xsd:all>
          > <xsd:element maxOccurs="1" minOccurs="0" name="firstname"
          > type="xsd:string"/>
          > <xsd:element maxOccurs="1" minOccurs="0" name="lastname"
          > type="xsd:string"/>
          > </xsd:all>
          > </xsd:complexType>
          >
          > You were on the right track in a previous method where you defined a
          > data type. That is one way anyway...
          >
          > On Wed, 2003-09-17 at 22:46, gnawed wrote:
          > > If I have a method that takes two strings, but only the first one
          is
          > > required:
          > >
          > > setName(lastname, firstname)
          > >
          > > How do I convey that in the WSDL file? Do I need to create a new
          > > type? Or can I use minOccurs/maxOccurs in the <message><part>...
          > >
          > >
          > >
          > >
          > >
          > > Yahoo! Groups Sponsor
          > > ADVERTISEMENT
          > > click here
          > >
          > > To unsubscribe from this group, send an email to:
          > > soaplite-unsubscribe@yahoogroups.com
          > >
          > >
          > >
          > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
          Service.
          > --
          > Byrne Reese <byrne@m...>
        Your message has been successfully submitted and would be delivered to recipients shortly.