Serialization

Discussion in 'ASP .Net Web Services' started by Brock Allen, Apr 13, 2005.

  1. Brock Allen

    Brock Allen Guest

    Your web service needs a XML namespace since it's defining a XML Schema.
    Control this namespace this way:

    [WebService(Namespace="http://www.develop.com/webservices/")]
    public class Calc
    {
    [WebMethod]
    public int Add(int n1, int n2)
    {
    int sum = n1 + n2;
    return(sum);
    }
    }

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Does anybody know how to control the serialization of the response a
    > webmethod? In short how can modify the response stream to remove the
    > <string xmlns="http://tempuri.org/"> and the </string> tags?
    >
     
    Brock Allen, Apr 13, 2005
    #1
    1. Advertising

  2. Brock Allen

    jsh02_nova Guest

    Does anybody know how to control the serialization of the response a
    webmethod? In short how can modify the response stream to remove the <string
    xmlns="http://tempuri.org/"> and the </string> tags?

    --
    thx
     
    jsh02_nova, Apr 14, 2005
    #2
    1. Advertising

  3. Brock Allen

    jsh02_nova Guest

    Thanks for the replay Brock.
    Actually what I used was Me.Context.Response.Write("<?xml version=""1.0""?>"
    + SomeData) and I got the xml I needed.

    --

    thx
    -jsh
     
    jsh02_nova, Apr 14, 2005
    #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. Maximus

    Serialization Error

    Maximus, Jan 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,038
    Gaurav Khanna [C# MVP]
    Jan 28, 2004
  2. Replies:
    8
    Views:
    2,310
    deadsea
    Jan 2, 2005
  3. Replies:
    3
    Views:
    1,084
  4. Dimitri Ognibene
    Replies:
    4
    Views:
    820
    Dimitri Ognibene
    Sep 2, 2006
  5. Ramunas Urbonas
    Replies:
    1
    Views:
    427
    Dino Chiesa [Microsoft]
    Jul 27, 2004
Loading...

Share This Page