Jquery 调用 webservice报错,哪位高手帮下忙, 多谢了
Jquery 调用 webservice报错,谁帮下忙, 谢谢了。
<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="WebForm1.aspx.cs" Inherits="ApprovalPortal.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#btnLogin").click(function (event) {
var wsUrl = "http://meit-mei01/ApprovalPortal/ApprovalPortalWebService.asmx?op=GetPublicUserInfo";
var soapRequest =
'<?xml version="1.0" encoding="utf-8"?> \
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> \
<soap12:Body> \
<GetPublicUserInfo xmlns="http://tempuri.org/"> \
<userName>' + $("#txtUserName").val() + '</userName>\
<passWord>' + $("#txtPassword").val() + '</passWord>\
</GetPublicUserInfo> \
</soap12:Body> \
</soap12:Envelope>';
$.ajax({
type: "GET",
url: wsUrl,
contentType: "text/xml",
dataType: "xml",
data: soapRequest,
success: processSuccess,
error: processError
});
});
});
function processSuccess(data, status, req) {
if (status == "success")
$("#response").text($(req.responseXML).find("HelloResult").text());
}
function processError(data, status, req) {
alert(req.responseText + " " + status);
<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="WebForm1.aspx.cs" Inherits="ApprovalPortal.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#btnLogin").click(function (event) {
var wsUrl = "http://meit-mei01/ApprovalPortal/ApprovalPortalWebService.asmx?op=GetPublicUserInfo";
var soapRequest =
'<?xml version="1.0" encoding="utf-8"?> \
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> \
<soap12:Body> \
<GetPublicUserInfo xmlns="http://tempuri.org/"> \
<userName>' + $("#txtUserName").val() + '</userName>\
<passWord>' + $("#txtPassword").val() + '</passWord>\
</GetPublicUserInfo> \
</soap12:Body> \
</soap12:Envelope>';
$.ajax({
type: "GET",
url: wsUrl,
contentType: "text/xml",
dataType: "xml",
data: soapRequest,
success: processSuccess,
error: processError
});
});
});
function processSuccess(data, status, req) {
if (status == "success")
$("#response").text($(req.responseXML).find("HelloResult").text());
}
function processError(data, status, req) {
alert(req.responseText + " " + status);