English 中文(简体)
网上服务称职的回报,实际上似乎与服务机构有关。
原标题:Web service call returns with error, doesn t actually seem to be talking to the service

我有一个C# ASP。 互联网网络这一计算机的网络服务(成功)。 我可以通过国际测验局测试LogonUser方法,并把它从测试组应用中提出来。

我有第二个项目,一个使用“ j”的超文本网页。 这总是失败的,因此,我不认为它实际上与服务机构沟通,因此我认为在贾瓦文中存在一yn误。

我是否正确地把事情组合起来?

C# Web methods:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class TimeRecordingService : System.Web.Services.WebService {

    [WebMethod]
    public string LogonUser(string _usercode, string _password) {
        ...             
    }
}

传真:

<body>
<form id="logon" action="">
<h1>
    Time Recording Logon</h1>
<p>
    <label>Usercode</label>
    <input id="usercode" type="text" />
</p>
<p>
    <label>Password</label>
    <input id="password" type="password" />
</p>
<p>
    <a type="submit" class="submit" id="LogonUser">Logon</a>
</p>
</form>
<!--Browsers block while requesting, loading, and executing JavaScript, defer this until as late as possible.-->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("a#LogonUser").click(function (e) {
            e.preventDefault();
            $.ajax({
                type:  POST ,
                url:  http://143.96.130.156/TimeRecording/TimeRecordingService.asmx/LogonUser ,
                data:  {"_userCode": "  + $("input#usercode").val() + ",  _password : " + $("input#password").val() +  "} ,
                contentType:  application/json; charset=utf-8 ,
                dataType:  json ,
                success: OnSuccess,
                error: OnError
            });
            function OnSuccess(data, status) {
                alert(status);
            }
            function OnError(request, status, error) {
                alert(status);
            }
        });
    });    
</script>

当我点击洛贡纽顿时,这总是一差错。

你们能否看到或思考为什么?

Thank you, Aaron.

最佳回答
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签