Rambler's Top100
Главная
Новости
Статьи
Форумы
Книги
Коды
Сообщество
Блоги
О нас
 

Логин

Email:
  Пароль:

Войти
Зарегистрироваться
Забыл пароль

Поиск

 Искать :
 
Вперед

Сообщение

Slam


Завсегдатай

Зарегистрирован:
22 May 2005
Сообщения: 83
Примеры кода: 0
 

RE[2]: Что с deserialization сделать?

28 April 2008 12:55  



Нужно посмотреть прокси, сгенерированные студией, а именно какие атрибуты нацелены на возвращаемое функцией значение и на тип этого значения. Сериализатор может возвращать null, если, например, возвращаемое значение находится в другом пространстве имён. Если функция возвращает объекты разных типов, все они должны быть добавлены с помошью XmlInclude.


На мой взгляд все генерится корректно. Но ввиду того, что у меня очень мало опыта с анализом такой информации, допускаю, что я могу ошибаться.

Вот часть прокси класса, который сгенерился. Я на данный момент пытаюсь завести хотя бы login() метод, который возвращает объект класса LoginResponse. Возвращаемый СОАП будет чуть ниже.

/// <remarks/>
[System.Xml.Serialization.XmlIncludeAttribute(typeof(LogoutResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(StatusResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(LoginResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(OptimizationResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(StressTestResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(NewslettersResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(PortfolioEfficiencyResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(CheckBankProductsResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(SearchStocksResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(StocksResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(BankPropertiesResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(PricesResponse))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(PriceResponse))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://valueobjects.APPserver.company.com")]
public abstract partial class Response {
    
    private ErrorCode errorField;
    
    private long updateIdField;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
    public ErrorCode error {
        get {
            return this.errorField;
        }
        set {
            this.errorField = value;
        }
    }
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public long updateId {
        get {
            return this.updateIdField;
        }
        set {
            this.updateIdField = value;
        }
    }
}



/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://valueobjects.APPserver.company.com")]
public partial class AuthenticationTicket
{

    private string sessionIdField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true)]
    public string sessionId
    {
        get
        {
            return this.sessionIdField;
        }
        set
        {
            this.sessionIdField = value;
        }
    }
}



/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://login.valueobjects.APPserver.company.com")]
public partial class User
{

    private string firstNameField;

    private System.Nullable<System.DateTime> lastLoginField;

    private string lastNameField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true)]
    public string firstName
    {
        get
        {
            return this.firstNameField;
        }
        set
        {
            this.firstNameField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true)]
    public System.Nullable<System.DateTime> lastLogin
    {
        get
        {
            return this.lastLoginField;
        }
        set
        {
            this.lastLoginField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true)]
    public string lastName
    {
        get
        {
            return this.lastNameField;
        }
        set
        {
            this.lastNameField = value;
        }
    }
}



/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://login.valueobjects.APPserver.company.com")]
public partial class LoginResponse : Response
{
    private AuthenticationTicket ticketField;

    private User userField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true)]
    public AuthenticationTicket ticket
    {
        get
        {
            return this.ticketField;
        }
        set
        {
            this.ticketField = value;
        }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true)]
    public User user
    {
        get
        {
            return this.userField;
        }
        set
        {
            this.userField = value;
        }
    }
}



/// <remarks/>
    [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://services.APPserver.company.com", ResponseNamespace="http://services.APPserver.company.com", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
    [return: System.Xml.Serialization.XmlElementAttribute("loginReturn")]
    public LoginResponse login(LoginRequest request) {
        object[] results = this.Invoke("login", new object[] {
                    request});
        return ((LoginResponse)(results[0]));
    }
    
    /// <remarks/>
    public System.IAsyncResult Beginlogin(LoginRequest request, System.AsyncCallback callback, object asyncState) {
        return this.BeginInvoke("login", new object[] {
                    request}, callback, asyncState);
    }
    
    /// <remarks/>
    public LoginResponse Endlogin(System.IAsyncResult asyncResult) {
        object[] results = this.EndInvoke(asyncResult);
        return ((LoginResponse)(results[0]));
    }
    
    /// <remarks/>
    public void loginAsync(LoginRequest request) {
        this.loginAsync(request, null);
    }
    
    /// <remarks/>
    public void loginAsync(LoginRequest request, object userState) {
        if ((this.loginOperationCompleted == null)) {
            this.loginOperationCompleted = new System.Threading.SendOrPostCallback(this.OnloginOperationCompleted);
        }
        this.InvokeAsync("login", new object[] {
                    request}, this.loginOperationCompleted, userState);
    }
    
    private void OnloginOperationCompleted(object arg) {
        if ((this.loginCompleted != null)) {
            System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
            this.loginCompleted(this, new loginCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
        }
    }
Вот возвращаемый SOAP
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
	<loginResponse xmlns="http://services.APPserver.company.com">
		<loginReturn><error xsi:nil="true"/>
			<ticket>
				<sessionId>96d6a5cb78651316:-26db6402:118f4d20dd5:-7c54</sessionId>
			</ticket>
			<updateId>766</updateId>
			<user>
				<firstName>John</firstName>
				<lastLogin>2008-04-13T19:50:07.628Z</lastLogin>
				<lastName>Smith</lastName>
			</user>
		</loginReturn>
	</loginResponse>
</soapenv:Body>
</soapenv:Envelope>

Последний раз редактировалось 28 April 2008 12:55
Наверх
  



Web Services

 Что с deserialization сделать?Slam  24 April 2008 19:24
 RE: Что с deserialization сделать?Начинающий программист  26 April 2008 20:38
 RE[2]: Что с deserialization сделать?Slam  28 April 2008 12:55
 RE[3]: Что с deserialization сделать?Начинающий программист  29 April 2008 11:02
 RE[4]: Что с deserialization сделать?Slam  29 April 2008 15:01
 RE[5]: Что с deserialization сделать?Начинающий программист  29 April 2008 16:54
 RE[6]: Что с deserialization сделать?Slam  29 April 2008 17:02
 RE[7]: Что с deserialization сделать?Начинающий программист  29 April 2008 17:58
 RE[8]: Что с deserialization сделать?Slam  09 May 2008 14:20
 RE[9]: Что с deserialization сделать?Начинающий программист  09 May 2008 14:55
 RE[10]: Что с deserialization сделать?Slam  09 May 2008 15:01
 RE[11]: Что с deserialization сделать?Начинающий программист  09 May 2008 21:12
 RE[8]: Что с deserialization сделать?Slam  29 April 2008 18:53
 
Наш Киев

Apartments for Rent

Rambler's Top100
Рейтинг@Mail.ru
Идея: Dimon aka Manowar Программирование: Dimon aka Manowar Дизайн: Dan Lebedev
Хостинг от компании Parking.ru
Карта сайта