I've narrowed it down at least. This line:

InputStream is = connection.getInputStream();

creates an IOException.

Why? What am I missing here?

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Brian Ivey
Sent: Thursday, August 08, 2002 11:42 PM
To: [EMAIL PROTECTED]
Subject: Re: Building a UDDI Registry Browser JSP and SOAP


Hey Martin,

I've switched the code from a POST to a GET and I received the same HTTP 500
return code from both the Microsoft and SAP test registries. The IBM test
registry now returns a 405. This is odd because I have not changed one line
of code, but now receive a different msg from the one server I was testing
against all day.

The 500 error makes me think that my SOAP or UDDI request are incorrect.
After all it is an Internal Server error. That does mean something is going
on at servers end... right?

I'm scratching my head on this one. Maybe I'll sleep on it.

Thanks for your help.

Brian

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Brian Ivey
Sent: Thursday, August 08, 2002 6:41 PM
To: [EMAIL PROTECTED]
Subject: Building a UDDI Registry Browser JSP and SOAP


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

===========================================================================
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

===========================================================================
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