Home > Archive > Microsoft Webservices > May 2006 > (Wsdl file ) Resource not allowed.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
(Wsdl file ) Resource not allowed.
|
|
| Ram Krishna Tripathi 2006-05-16, 8:07 am |
| 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 snot
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
ramkrishnatripathi@gmail.com
===========
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>
| |
| Sebastian Klehm 2006-05-19, 4:13 am |
| Hello,
WSDL is only the description file for a web service (Web Service
Description Language). You can use this file to build a proxy class for
your web service (i.e. use the .NET Tool wsdl.exe that is included in the
..NET SDK).
Your wsdl file refers to a web service. The web service is accessible,
e.g. throu an .asmx file.
There are also tools that build an asmx file with the help of a wsdl file.
But, of course, the build is not everytime successful, because it cannot
build code inside methods of the web service.
best regards,
Sebastian Klehm
Am 16.05.2006, 15:46 Uhr, schrieb Ram Krishna Tripathi
<ramkrishnatripathi@abosoftware.com>:
> 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
> snot
> 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
>
> ramkrishnatripathi@gmail.com
>
>
> ===========
>
> 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>
>
>
>
--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/
|
|
|
|
|