Hey,

I am trying to write a UDDI registry browser to be used on my companies web
portal. I am new to JSP, UDDI, SOAP, etc. I have checked and double checked
my code, but do not know where else to look. I am posting this on both a
SOAP and JSP mailing list, when this could be a UDDI issue and off-topic for
both lists. Please indulge me by having a look at my code. Any suggestions
will be appreciated. If someone knows of a UDDI mailing list, please tell me
where I can find it.

This is the error returned when the JSP page is called from the browser:

java.io.IOException: Server returned HTTP response code: 500 for URL:
http://uddi.ibm.com/testregistry/inquiryapi

This is my code:

<%@ page language="java" contentType="text/html" %>

<%@ page import="java.net.*"%>
<%@ page import="java.io.*"%>

<html>

        <head>

                <title>UDDI Registry Browser</title>

        </head>

        <body>

                <%

                try {

                        URL u = new URL("http://uddi.ibm.com/testregistry/inquiryapi";);
                        URLConnection uc = u.openConnection();
                        HttpURLConnection connection = (HttpURLConnection) uc;

                        connection.setDoOutput(true);
                        connection.setDoInput(true);
                        connection.setRequestMethod("POST");
                        connection.setRequestProperty("SOAPAction",
"http://uddi.ibm.com/testregistry/inquiryapi";);

                        Writer wout = new 
OutputStreamWriter(connection.getOutputStream());

                        wout.write("<?xml version='1.0'?>\r\n");
                        wout.write("<SOAP-ENV:Envelope ");
                        wout.write("xmlns:SOAP-ENV=");
                        wout.write("'http://schemas.xmlsoap.org/soap/envelope/' ");
                        wout.write("xmlns:xsi=");
                        wout.write("'http://www.w3.org/2001/XMLSchema-instance'>\r\n");
                        wout.write("<SOAP-ENV:Body>\r\n");
                        wout.write("<find_business generic='2.0' 
xmlns='urn:uddi-org:api_v2'>");
                        wout.write("<name>IBM</name>");
                        wout.write("</find_business>");
                        wout.write("</SOAP-ENV:Body>\r\n");
                        wout.write("</SOAP-ENV:Envelope>\r\n");

                        wout.flush();
                        wout.close();

                        InputStream is = connection.getInputStream();
                        InputStreamReader isr = new InputStreamReader(is);
                        BufferedReader br = new BufferedReader(isr);
                        String line = null;
                        while ( (line = br.readLine()) != null) {
                                System.out.println("line: " + line);
                        }

                }
                catch (IOException e) {
                        out.println(e);
                }

                %>

        </body>

</html>

Thanks in advance,

Brian Ivey

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to