Announcement Announcement Module
Collapse
No announcement yet.
UDDI inquiry with javascript Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • UDDI inquiry with javascript

    hello all,

    when i use this code to inquire for businesses,the browser throws an exception in both firefox and IE

    here is the code, it has been minimized to show the XMLHttpRequest open and send function calls where the exception is raised

    The firefox exception message is as followed:
    Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]
    And the IE exception message is as followed:
    Access is denied
    Code:
    <html>
    	<head>
    		<script type="text/javascript" language="javascript">
    			var xml = "<?xml version='1.0' encoding='UTF-8' ?>"+
    					"<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org:80/soap/envelope/' >"+
    			                "<SOAP-ENV:Body>" +
    								"<find_business  xmlns='urn:uddi-org:api_v2' generic='2.0' maxRows='12'>"+
    									"<name>"+
    										"Microsoft" +
    									"</name>"+
    								"</find_business>"+
    							"</SOAP-ENV:Body>" +
    			          "</SOAP-ENV:Envelope>";
    			var request =null;
    			
    			window.onload= function(){
    			
    				document.getElementById('getServices').onclick= function()
    				{
    					if(window.XMLHttpRequest)
    					{
    						try
    						{
    							request = new XMLHttpRequest();
    							//request =new ActiveXObject("Microsoft.XMLHTTP");
    
    							request.open('Post','http://uddi.microsoft.com/inquire',false);
    							request.setRequestHeader('Content-Type','text/xml; charset=utf-8');
    							request.setRequestHeader("Cache-Control","no-cache");
    							request.setRequestHeader("Accept","text/xml");
    							request.setRequestHeader('SOAPAction','');
    							
    							//request.setRequestHeader("Content-length", xml.length);
    							//request.setRequestHeader("Connection", "close");
    							request.send(xml);
    							request.onreadystatechange= onReady;
    							
    						}
    						catch(e)
    						{
    							alert('Exception thrown while opening connection');
    							alert('Error Message is:'+e.message);
    						}
    					}
    					else
    					{
    						alert('XMLHttpRequest doesn\'t exists');
    					}
    				}
    				
    			};
    			var onReady = function()
    			{
    				if(request.readyState==4)
    				{
    					alert(request.responseXML);
    				}
    			}
    		</script>
    		<style type="text/css">
    			table
    			{
    				width: 100%;
    			}
    			table thead tr th#listOfServicesTitle 
    			{
    				border: 1px solid black;
    				color: red;
    			}
    			tbody tr td
    			{
    				text-align: center;
    			}
    		</style>
    	</head>
    	<body>
    		<table>
    			<thead>
    				<tr>
    					<th>SOAP UDDI Inquiry</th>
    				</tr>
    				<tr>
    					<th id="listOfServicesTitle">List of services</th>
    				</tr>
    			</thead>
    			<tbody>
    				<tr>
    					<td>
    						<button id="getServices">Get Services List</button>
    					</td>
    				</tr>
    			</tbody>
    		</table>
    	</body>
    </html>
    i need to use ajax to find businesses but i dont know whats wrong
    this html is placed in the axis webapplication running on tomcat 6.0.2

    i need your help uregntly

    Thanks
Working...
X