一 基本类型
int , flaoat , string , bool , DateTime
先给代码
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
/// <summary>
/// SimpleWebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class SimpleWebService : System.Web.Services.WebService
{
public SimpleWebService()
{
}
[WebMethod]
public void JustForTest(int a, float b, string c, bool d, DateTime e)
{
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function callService(num1, num2, num3, num4, num5)
{
var num1 = 123;
var num2 = 123.456;
var num3 = "你好";
var num4 = true;
var num5 = new Date();
SimpleWebService.JustForTest(num1, num2, num3, num4, num5);
}
</script>
</head>
<body>
<form >