我试图在另一个领域获得网络服务,但却没有回报。 我后来指出,这是一个交叉领域的问题。
我在网上搜索,有这么多的文章,但像我这样新来的人无法读到。
谁能帮助我如何利用网络服务?
下面是我的法典。
//variables for Add Contacts
var addAccountServiceUrl = http://crm.eyepax.net/organization.asmx?op=WriteOrg ; // Preferably write this out from server side
var OrganizationID=123;
var ParentID=123 ;
var AccountManagerID="123";
var OrganizationName="Testapple";
var IncorporationNo="23";
var PostAddress="asdfklj asldfj";
var CountryID="LK";
var VisitAddress="asldkf asldkf asldfas dfasdf";
var VisitCountryID="LK";
var VisitSwithboard="242344";
var VisitFax="234234";
var Www="http://www.eyepax.com";
var Active=true;
var RegBy=345345345345;
var ConfigurationCode="28BC9CC3@BFEBFBFF0001067A";
var Flag=1;
var LicenceOrganazationID=1;
var sErr;
function addContact()
{
//this is to be commented soon!
alert("function called");
//update the webservice soapmesg
var soapMessage =
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<WriteOrg xmlns="http://eyepax.crm.com/Organization">
<OrganizationID> +OrganizationID+ </OrganizationID>
<ParentID> +ParentID+ </ParentID>
<AccountManagerID> +AccountManagerID+ </AccountManagerID>
<OrganizationName> +OrganizationName+ </OrganizationName>
<IncorporationNo> +IncorporationNo+ </IncorporationNo>
<PostAddress> +PostAddress+ </PostAddress>
<CountryID> +CountryID+ </CountryID>
<VisitAddress> +VisitAddress+ </VisitAddress>
<VisitCountryID> +VisitCountryID+ </VisitCountryID>
<VisitSwithboard> +VisitSwithboard+ </VisitSwithboard>
<VisitFax> +VisitFax+ </VisitFax>
<Www> +Www+ </Www>
<Active> +Active+ </Active>
<RegBy> +RegBy+ </RegBy>
<ConfigurationCode> +ConfigurationCode+ </ConfigurationCode>
<Flag> +Flag+ </Flag>
<LicenceOrganazationID> +LicenceOrganazationID+ </LicenceOrganazationID>
</WriteOrg>
</soap:Body>
</soap:Envelope> ;
$.ajax({
url: addAccountServiceUrl,
type: "POST",
dataType: "xml",
data: soapMessage,
success: endAddContact,
error: function(jqXHR, textStatus, errorThrown) {alert("failure"); console.log(textStatus);console.log(errorThrown);},
contentType: "text/xml; charset="utf-8""
});
return false;
}
function endAddContact(xmlHttpRequest, status)
{
console.log(xmlHttpRequest);
console.log(status);
alert("webservice called!");
$(xmlHttpRequest.responseXML)
.find( WriteOrgResponse )
.each(function()
{
var orgres = $(this).find( WriteOrgResult ).text();
var error = $(this).find( vstrError ).text();
alert(orgres + - + error);
});
var a = $(xmlHttpRequest.responseXML).find( WriteOrgResult );
var b = $(xmlHttpRequest.responseXML).find( vstrError );
console.log("a"+a.text());
console.log("b"+b.text());
}