views:

37

answers:

1

I have the following code:

    [WebMethod]
    [SoapHeader("_webServiceAuth")]
    public User GetUser(string username)
    {
        try
        {
            this._validationMethods.Validate(_webServiceAuth);
            User user = new User(username);

            return user;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

As you can see, one would expect to receive a User as a responce when I do:

myUser = this.Service.GetUser(username);

But what I get is a request for a "GetUserRequest" instance, and get returned a "GetUserResponse" instance. Any help in why my object is not being send by my webservice?

+2  A: 

You will find that the GetUserRequest object has a string property (username), and the GetUserResponse object contains your User object. These Request/Response objects are containers that exist in the SOAP messages.

I believe they are normally abstracted away but I may be mistaken.

Kirk Broadhurst
Thanks for the reply, but I don't see my User object inside the GetUserResponse. Update: Forget that last comment, found it xD
FelixMM