R
Ram Krishna Tripathi
Hello Friends,
I have the wsdl file of the webservice.
Now I am trying to access the api of webservice in asp program.
Then it gives Error that >>>>>>> resource you are trying to access not
allowed.
other extension like .asmx , .asp are easily accessible.
I think that
Q1) ONE REASON may be for error
xmlHTTP.Open ( "Post", "http://localhost/ASP.NET/enterprise.wsdl", false);
that wsdl extension is not registered on IIS.
So please tell me how to register the wsdl extension on IIS.
Q2) or There is any utility to convert the .wsdl file to .asmx format.
because other .asmx webservices are easily accessible.
Code is given below.
Thanks and Regards
Ram Krishna Tripathi
(e-mail address removed)
===========
Code in ASP is:--
<html>
<body>
<script language="jscript">
function btn_click (a, b)
{
var xmlObj = new ActiveXObject("Msxml2.DOMDocument") ;
var sXml = "<?xml version=\"1.0\" ?>" ;
sXml += "<soap:Envelope "
sXml +=
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " ;
sXml +=
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " ;
sXml +=
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" ;
sXml += "<soap:Body>" ;
sXml += "<login xmlns=\"http://salesforce.com/\">" ;
sXml = sXml + "<username>" + a.value + "</username>"
;
sXml = sXml + "<password>" + b.value + "</password>"
;
sXml += "</login></soap:Body></soap:Envelope>"
xmlObj.loadXML(sXml) ;
XmlRequest.innerText = xmlObj.xml ;
var xmlHTTP = new ActiveXObject("Msxml2.XMLHTTP") ;
xmlHTTP.Open ( "Post",
"http://localhost/ASP.NET/enterprise.wsdl", false);
xmlHTTP.setRequestHeader("SOAPAction","http://salesforce.com/login")
;
xmlHTTP.setRequestHeader("Content-Type", "text/xml;
charset=utf-8" ) ;
xmlHTTP.Send(xmlObj.xml) ;
MyResult.innerText = xmlHTTP.responseText ;
var xmlResponse = xmlHTTP.responseXML ;
answer.innerText =
xmlResponse.selectSingleNode("soap:Envelope/soap:Body/loginResponse/loginResult").text
;
}
</script>
<form>
<p>Please input a:<input id="a" name="a"></input></p>
<p>Please input b:<input id="b" name="b"></input></p>
<p>
<input type="button" id="btn" value="Enter"
onclick="jscript:btn_click(a, b)"></input>
</p>
<p>Answer is <span id="answer"></span></p>
<hr></hr>
<p>Request:</p>
<span id="XmlRequest"></span>
<p>Response:</p>
<span id="MyResult"></span>
</form>
</body>
</html>
I have the wsdl file of the webservice.
Now I am trying to access the api of webservice in asp program.
Then it gives Error that >>>>>>> resource you are trying to access not
allowed.
other extension like .asmx , .asp are easily accessible.
I think that
Q1) ONE REASON may be for error
xmlHTTP.Open ( "Post", "http://localhost/ASP.NET/enterprise.wsdl", false);
that wsdl extension is not registered on IIS.
So please tell me how to register the wsdl extension on IIS.
Q2) or There is any utility to convert the .wsdl file to .asmx format.
because other .asmx webservices are easily accessible.
Code is given below.
Thanks and Regards
Ram Krishna Tripathi
(e-mail address removed)
===========
Code in ASP is:--
<html>
<body>
<script language="jscript">
function btn_click (a, b)
{
var xmlObj = new ActiveXObject("Msxml2.DOMDocument") ;
var sXml = "<?xml version=\"1.0\" ?>" ;
sXml += "<soap:Envelope "
sXml +=
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " ;
sXml +=
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " ;
sXml +=
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" ;
sXml += "<soap:Body>" ;
sXml += "<login xmlns=\"http://salesforce.com/\">" ;
sXml = sXml + "<username>" + a.value + "</username>"
;
sXml = sXml + "<password>" + b.value + "</password>"
;
sXml += "</login></soap:Body></soap:Envelope>"
xmlObj.loadXML(sXml) ;
XmlRequest.innerText = xmlObj.xml ;
var xmlHTTP = new ActiveXObject("Msxml2.XMLHTTP") ;
xmlHTTP.Open ( "Post",
"http://localhost/ASP.NET/enterprise.wsdl", false);
xmlHTTP.setRequestHeader("SOAPAction","http://salesforce.com/login")
;
xmlHTTP.setRequestHeader("Content-Type", "text/xml;
charset=utf-8" ) ;
xmlHTTP.Send(xmlObj.xml) ;
MyResult.innerText = xmlHTTP.responseText ;
var xmlResponse = xmlHTTP.responseXML ;
answer.innerText =
xmlResponse.selectSingleNode("soap:Envelope/soap:Body/loginResponse/loginResult").text
;
}
</script>
<form>
<p>Please input a:<input id="a" name="a"></input></p>
<p>Please input b:<input id="b" name="b"></input></p>
<p>
<input type="button" id="btn" value="Enter"
onclick="jscript:btn_click(a, b)"></input>
</p>
<p>Answer is <span id="answer"></span></p>
<hr></hr>
<p>Request:</p>
<span id="XmlRequest"></span>
<p>Response:</p>
<span id="MyResult"></span>
</form>
</body>
</html>