Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Архив Flasher.ru > Flash > Action script 2.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему  
Старый 26.06.2004, 23:00
media вне форума Посмотреть профиль Отправить личное сообщение для media Найти все сообщения от media
  № 1  
media

Регистрация: May 2000
Сообщений: 35
По умолчанию web services и DateTime формат

Привет всем,
если кто работал с веб сервисами...
Столкнулся с такой проблемой.
Есть простой сервис (asmx файл), который получает переменную в формате DateTime и возвращает ее же в таком же формате DateTime.
Так вот флеш этого почему то сделать не может...
Все перепробовал...
Сорс сервиса test.asmx

Код:
<%@ WebService Language="c#" debug="true" class="Test" %>
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.Services;

  public class Test: System.Web.Services.WebService
  {
  [WebMethod(Description="Date string")]
    public DateTime getDateVar(DateTime sentNum) {
          
          return sentNum;     
      }   
}

сама флешка:

Код:
import mx.services.*;

//create the listener object
var clickListen:Object = new Object();
//add the event to the listener
clickListen.click = function() {
	//create an object to listen for when the WebServiceConnector receives data
	var rateServices = new WebService("http://localhost/test.asmx?WSDL", rateServiceLog);
	// Call the doCompanyInfo method and assign it to the pending call object to handle results. 
	RateResultObj = rateServices.getDateVar("2004-04-15 12:00:00");
	rateServices.onLoad = trace("loading");
	rateServices.onLoad = trace(date_str);
	// the onResult function is called if the service is successful 
	RateResultObj.onResult = function(result) {
		// example result values.  The result is a decoded actionscript object 
		// version of the xml returned by the operation. 
		// In this case the result is a object with company, lastPrice etc being properties. 
		trace("Date: "+result);
	};
	RateResultObj.onFault = function(fault) {
		// If there is any error such as the service not working, the onFault handler will be invoked. 
		trace(fault.faultCode+","+fault.faultstring);
	};
};
//finally add the event listener to the button
square_pb.addEventListener("click", clickListen);
// Creates a Log object which records all events when calling a web service. 
rateServiceLog = new Log(Log.VERBOSE);
rateServiceLog.onLog = function(txt) {
	trace(txt);
};
все в одном фрейме и кнопка с именем square_pb

У кого получится вывести DateTime очень буду благодарен!

Спасибо заранее !

Создать новую тему   Часовой пояс GMT +4, время: 04:26.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 04:26.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.