custom datatypes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gibb

    custom datatypes

    Hi All.. i need help in this issue...
    Public Attributes & Properties for shared classes amoung webservice are
    accessible, but how can we call the methods.
    i have a webMethod that returns a custom datatype to the client, where i
    need to call a method of that returned class. here is an example :

    //Web Service Namespace
    public class Meeting
    {
    public string subject;
    private ArrayList attachments;

    public void AddAttachment( string fileName, byte[] data )
    {
    // Code to do manipulate the attachmentsand add it to my ArrayList
    }
    }

    // My Web Method
    [WebMethod()]
    public Meeting getMeeting( int meetID )
    {
    // code goes here to get the required meeting
    Meeting meeting = new Meeting();
    return meeting;
    }

    [WebMethod()]
    public void UpdateMeeting( Meeting meeting )
    {
    // Do any Operation Here
    }

    -----------------------------------------------------------------
    // Now Here it Goes My Client Code

    public void UpdateMeeting( int meetID )
    {
    //Call my Web Service
    MeetingWS proxy = new MeetingWS();
    //Here i Need to Define the Meeting Object
    MeetingWS.Meeti ng m = new MeetingWS.Meeti ng();
    m = proxy.getMeetin g( meetID );
    // here goes the problem
    m.AddAttachment ( "anything", myArrOfBytes ); // Can't Call this Methods
    where
    m.fileName = "MyFileName " // This is accessible
    // if this problem is solved then i want to update that meeting by calling
    the web method
    proxy.UpdateMee ting( m );

    }
    -----------------------------------------------------------

    Many Thanks.

    Gibb
  • BillyLiu007

    #2
    RE: custom datatypes

    u can by pass it easily to change the webmethod

    expose a webmethod called
    [webmethod()]
    public void addAttachment(i nt meetID, Object Anything)
    {
    //logic to add attachment to a specific meeting
    }




    --
    Can You?You Can.


    "Gibb" wrote:
    [color=blue]
    > Hi All.. i need help in this issue...
    > Public Attributes & Properties for shared classes amoung webservice are
    > accessible, but how can we call the methods.
    > i have a webMethod that returns a custom datatype to the client, where i
    > need to call a method of that returned class. here is an example :
    >
    > //Web Service Namespace
    > public class Meeting
    > {
    > public string subject;
    > private ArrayList attachments;
    >
    > public void AddAttachment( string fileName, byte[] data )
    > {
    > // Code to do manipulate the attachmentsand add it to my ArrayList
    > }
    > }
    >
    > // My Web Method
    > [WebMethod()]
    > public Meeting getMeeting( int meetID )
    > {
    > // code goes here to get the required meeting
    > Meeting meeting = new Meeting();
    > return meeting;
    > }
    >
    > [WebMethod()]
    > public void UpdateMeeting( Meeting meeting )
    > {
    > // Do any Operation Here
    > }
    >
    > -----------------------------------------------------------------
    > // Now Here it Goes My Client Code
    >
    > public void UpdateMeeting( int meetID )
    > {
    > //Call my Web Service
    > MeetingWS proxy = new MeetingWS();
    > //Here i Need to Define the Meeting Object
    > MeetingWS.Meeti ng m = new MeetingWS.Meeti ng();
    > m = proxy.getMeetin g( meetID );
    > // here goes the problem
    > m.AddAttachment ( "anything", myArrOfBytes ); // Can't Call this Methods
    > where
    > m.fileName = "MyFileName " // This is accessible
    > // if this problem is solved then i want to update that meeting by calling
    > the web method
    > proxy.UpdateMee ting( m );
    >
    > }
    > -----------------------------------------------------------
    >
    > Many Thanks.
    >
    > Gibb[/color]

    Comment

    • BillyLiu007

      #3
      RE: custom datatypes

      u can by pass it easily to change the webmethod

      expose a webmethod called
      [webmethod()]
      public void addAttachment(i nt meetID, Object Anything)
      {
      //logic to add attachment to a specific meeting
      }




      --
      Can You?You Can.


      "Gibb" wrote:
      [color=blue]
      > Hi All.. i need help in this issue...
      > Public Attributes & Properties for shared classes amoung webservice are
      > accessible, but how can we call the methods.
      > i have a webMethod that returns a custom datatype to the client, where i
      > need to call a method of that returned class. here is an example :
      >
      > //Web Service Namespace
      > public class Meeting
      > {
      > public string subject;
      > private ArrayList attachments;
      >
      > public void AddAttachment( string fileName, byte[] data )
      > {
      > // Code to do manipulate the attachmentsand add it to my ArrayList
      > }
      > }
      >
      > // My Web Method
      > [WebMethod()]
      > public Meeting getMeeting( int meetID )
      > {
      > // code goes here to get the required meeting
      > Meeting meeting = new Meeting();
      > return meeting;
      > }
      >
      > [WebMethod()]
      > public void UpdateMeeting( Meeting meeting )
      > {
      > // Do any Operation Here
      > }
      >
      > -----------------------------------------------------------------
      > // Now Here it Goes My Client Code
      >
      > public void UpdateMeeting( int meetID )
      > {
      > //Call my Web Service
      > MeetingWS proxy = new MeetingWS();
      > //Here i Need to Define the Meeting Object
      > MeetingWS.Meeti ng m = new MeetingWS.Meeti ng();
      > m = proxy.getMeetin g( meetID );
      > // here goes the problem
      > m.AddAttachment ( "anything", myArrOfBytes ); // Can't Call this Methods
      > where
      > m.fileName = "MyFileName " // This is accessible
      > // if this problem is solved then i want to update that meeting by calling
      > the web method
      > proxy.UpdateMee ting( m );
      >
      > }
      > -----------------------------------------------------------
      >
      > Many Thanks.
      >
      > Gibb[/color]

      Comment

      • Gibb

        #4
        RE: custom datatypes

        Thank you for this solution, but i already thought of it but didn't fullfill
        my needs. what i need is to keep manipulating with an object with many
        methods to call and get this object back to the web service to update my
        database. i want to minimize proxy calls.
        Regards.

        "BillyLiu00 7" wrote:
        [color=blue]
        > u can by pass it easily to change the webmethod
        >
        > expose a webmethod called
        > [webmethod()]
        > public void addAttachment(i nt meetID, Object Anything)
        > {
        > //logic to add attachment to a specific meeting
        > }
        >
        >
        >
        >
        > --
        > Can You?You Can.
        >
        >
        > "Gibb" wrote:
        >[color=green]
        > > Hi All.. i need help in this issue...
        > > Public Attributes & Properties for shared classes amoung webservice are
        > > accessible, but how can we call the methods.
        > > i have a webMethod that returns a custom datatype to the client, where i
        > > need to call a method of that returned class. here is an example :
        > >
        > > //Web Service Namespace
        > > public class Meeting
        > > {
        > > public string subject;
        > > private ArrayList attachments;
        > >
        > > public void AddAttachment( string fileName, byte[] data )
        > > {
        > > // Code to do manipulate the attachmentsand add it to my ArrayList
        > > }
        > > }
        > >
        > > // My Web Method
        > > [WebMethod()]
        > > public Meeting getMeeting( int meetID )
        > > {
        > > // code goes here to get the required meeting
        > > Meeting meeting = new Meeting();
        > > return meeting;
        > > }
        > >
        > > [WebMethod()]
        > > public void UpdateMeeting( Meeting meeting )
        > > {
        > > // Do any Operation Here
        > > }
        > >
        > > -----------------------------------------------------------------
        > > // Now Here it Goes My Client Code
        > >
        > > public void UpdateMeeting( int meetID )
        > > {
        > > //Call my Web Service
        > > MeetingWS proxy = new MeetingWS();
        > > //Here i Need to Define the Meeting Object
        > > MeetingWS.Meeti ng m = new MeetingWS.Meeti ng();
        > > m = proxy.getMeetin g( meetID );
        > > // here goes the problem
        > > m.AddAttachment ( "anything", myArrOfBytes ); // Can't Call this Methods
        > > where
        > > m.fileName = "MyFileName " // This is accessible
        > > // if this problem is solved then i want to update that meeting by calling
        > > the web method
        > > proxy.UpdateMee ting( m );
        > >
        > > }
        > > -----------------------------------------------------------
        > >
        > > Many Thanks.
        > >
        > > Gibb[/color][/color]

        Comment

        • Gibb

          #5
          RE: custom datatypes

          Thank you for this solution, but i already thought of it but didn't fullfill
          my needs. what i need is to keep manipulating with an object with many
          methods to call and get this object back to the web service to update my
          database. i want to minimize proxy calls.
          Regards.

          "BillyLiu00 7" wrote:
          [color=blue]
          > u can by pass it easily to change the webmethod
          >
          > expose a webmethod called
          > [webmethod()]
          > public void addAttachment(i nt meetID, Object Anything)
          > {
          > //logic to add attachment to a specific meeting
          > }
          >
          >
          >
          >
          > --
          > Can You?You Can.
          >
          >
          > "Gibb" wrote:
          >[color=green]
          > > Hi All.. i need help in this issue...
          > > Public Attributes & Properties for shared classes amoung webservice are
          > > accessible, but how can we call the methods.
          > > i have a webMethod that returns a custom datatype to the client, where i
          > > need to call a method of that returned class. here is an example :
          > >
          > > //Web Service Namespace
          > > public class Meeting
          > > {
          > > public string subject;
          > > private ArrayList attachments;
          > >
          > > public void AddAttachment( string fileName, byte[] data )
          > > {
          > > // Code to do manipulate the attachmentsand add it to my ArrayList
          > > }
          > > }
          > >
          > > // My Web Method
          > > [WebMethod()]
          > > public Meeting getMeeting( int meetID )
          > > {
          > > // code goes here to get the required meeting
          > > Meeting meeting = new Meeting();
          > > return meeting;
          > > }
          > >
          > > [WebMethod()]
          > > public void UpdateMeeting( Meeting meeting )
          > > {
          > > // Do any Operation Here
          > > }
          > >
          > > -----------------------------------------------------------------
          > > // Now Here it Goes My Client Code
          > >
          > > public void UpdateMeeting( int meetID )
          > > {
          > > //Call my Web Service
          > > MeetingWS proxy = new MeetingWS();
          > > //Here i Need to Define the Meeting Object
          > > MeetingWS.Meeti ng m = new MeetingWS.Meeti ng();
          > > m = proxy.getMeetin g( meetID );
          > > // here goes the problem
          > > m.AddAttachment ( "anything", myArrOfBytes ); // Can't Call this Methods
          > > where
          > > m.fileName = "MyFileName " // This is accessible
          > > // if this problem is solved then i want to update that meeting by calling
          > > the web method
          > > proxy.UpdateMee ting( m );
          > >
          > > }
          > > -----------------------------------------------------------
          > >
          > > Many Thanks.
          > >
          > > Gibb[/color][/color]

          Comment

          Working...