You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Sridhar Satuloori <sr...@india.sun.com> on 2000/11/14 09:23:07 UTC

Help!!! running Sample applications

Hi!!
I am trying to run SOAP2.0 in iWS4.1.  i created virtual directory soap20
and  i also deployed the rpcrouter servlet... when i try to run the sample
application(which was deployed)  i am getting the following error. i have
soap.jar in classpath also Xerces-1_0_3/xerces.jar is also in the class
path....

TIA
Sridhar


java samples.stockquote.GetQuote
http://myserver.com:2020/soap/servlet/rpcrouter IBM



org.xml.sax.SAXParseException: The markup in the document preceding the root
element must be well-formed.
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at org.xml.sax.SAXException.<init>(SAXException.java:45)
        at org.xml.sax.SAXParseException.<init>(SAXParseException.java:53)
        at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1318)
        at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocume
ntScanner.java:616)
        at
org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XM
LDocumentScanner.java:798)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
Code)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1208)
        at
org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison.java:8
5)
        at org.apache.soap.rpc.Call.invoke(Call.java:157)
        at samples.stockquote.GetQuote.main(GetQuote.java:103)
Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Protocol;
msg=java.lang.NoSuchMethodError: org.w3c.dom.Node: method
getNamespaceURI()Ljava/lang/String; not found
        at org.apache.soap.util.xml.QName.matches(QName.java, Compiled Code)
        at org.apache.soap.Envelope.unmarshall(Envelope.java, Compiled Code)
        at
org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
        at
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.jav
a, Compiled Code)
]
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at org.apache.soap.SOAPException.<init>(SOAPException.java:71)
        at org.apache.soap.rpc.Call.invoke(Call.java:167)
        at samples.stockquote.GetQuote.main(GetQuote.java:103)





Thanks and Regards,
Sridhar Satuloori,
        "Many of life's failures are people who did not realize how close
they were to success when they gave up"


-----Original Message-----
From: Sanjiva Weerawarana <sa...@watson.ibm.com>
To: soap-dev@xml.apache.org <so...@xml.apache.org>
Date: Tuesday, November 14, 2000 1:05 PM
Subject: Re: HTTP proxy patch




>Thanks for sending this - I committed it with a minor change: method
>name changed to setProxy instead of SetProxy. Hope that's ok!
>
>When we do get around to updating the docs this needs to be described
>as this is a very useful piece of functionality for many people.
>
>Sanjiva.
>
>----- Original Message -----
>From: "Akinori ITO" <ak...@paso.fujitsu.co.jp>
>To: <so...@xml.apache.org>
>Sent: Monday, November 13, 2000 11:37 PM
>Subject: HTTP proxy patch
>
>
>> Hi all.
>>
>> I made a HTTP proxy patch which can connect to the SOAP server
>> via the HTTP proxy.
>>
>> Most HTTP browsers support the HTTP access via the proxy server.
>> Apache SOAP 2.0 did not support the HTTP proxy server
>> though using the HTTP communication.
>>
>> Please call the following before invoking the Call object.
>>
>> Example:
>>
>>  HTTPUtils.SetProxy("proxy", 10080); // set static variables
>>
>> Thanks
>> --
>> ITO Akinori
>> akito@paso.fujitsu.co.jp
>>
>> xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java 1.7
>> *** /tmp/T05WaOoH       Tue Nov 14 11:15:16 2000
>> --- HTTPUtils.java      Tue Nov 14 11:14:34 2000
>> ***************
>> *** 74,79 ****
>> --- 74,81 ----
>>     private static final String HEADER_CONTENT_TYPE = "Content-Type";
>>     private static final String HEADER_CONTENT_LENGTH = "Content-Length";
>>     private static final int    HTTP_DEFAULT_PORT = 80;
>> +   private static String HTTP_PROXY_HOST = null;
>> +   private static int    HTTP_PROXY_PORT = 80;
>>
>>     /**
>>      * An instance of this class is returned by post.
>> ***************
>> *** 119,125 ****
>>         if (port < 0)  // No port given..use HTTP default which is pry 80
>:-)
>>           port = HTTP_DEFAULT_PORT;
>>
>> !       Socket s = new Socket (url.getHost (), port);
>>         s.setSoTimeout(timeout);
>>         out = new PrintWriter (s.getOutputStream ());
>>         in = new BufferedReader (new InputStreamReader (s.getInputStream
>()));
>> --- 121,132 ----
>>         if (port < 0)  // No port given..use HTTP default which is pry 80
>:-)
>>           port = HTTP_DEFAULT_PORT;
>>
>> !       Socket s;
>> !       if (HTTP_PROXY_HOST == null) {
>> !         s = new Socket (url.getHost (), port);
>> !       } else {
>> !         s = new Socket (HTTP_PROXY_HOST, HTTP_PROXY_PORT);
>> !       }
>>         s.setSoTimeout(timeout);
>>         out = new PrintWriter (s.getOutputStream ());
>>         in = new BufferedReader (new InputStreamReader (s.getInputStream
>()));
>> ***************
>> *** 129,136 ****
>>       }
>>
>>       /* send it out */
>> !     out.print (HTTP_POST + " " + url.getFile() + " HTTP/" +
HTTP_VERSION +
>> !                "\r\n");
>>       out.print (HEADER_HOST + ": " + url.getHost () + ':' + port +
"\r\n");
>>       out.print (HEADER_CONTENT_TYPE + ": " + contentType + "\r\n");
>>       out.print (HEADER_CONTENT_LENGTH + ": " + content.length () +
"\r\n");
>> --- 136,148 ----
>>       }
>>
>>       /* send it out */
>> !     if (HTTP_PROXY_HOST == null) {
>> !       out.print (HTTP_POST + " " + url.getFile() + " HTTP/" +
HTTP_VERSION
>+
>> !                  "\r\n");
>> !     } else {
>> !       out.print (HTTP_POST + " " + url.toString() + " HTTP/" +
>HTTP_VERSION +
>> !                  "\r\n");
>> !     }
>>       out.print (HEADER_HOST + ": " + url.getHost () + ':' + port +
"\r\n");
>>       out.print (HEADER_CONTENT_TYPE + ": " + contentType + "\r\n");
>>       out.print (HEADER_CONTENT_LENGTH + ": " + content.length () +
"\r\n");
>> ***************
>> *** 195,198 ****
>> --- 207,221 ----
>>       return new Response (statusCode, statusString, respHeaders,
>>                            respContentLength, respContentType, in);
>>     }
>> +
>> +   /**
>> +    * Set HTTP proxy.
>> +    *
>> +    * @param host the HTTP proxy host or null if no proxy.
>> +    * @param port the HTTP proxy port
>> +    */
>> +   public static void SetProxy(String host, int port) {
>> +     HTTP_PROXY_HOST = host;
>> +     HTTP_PROXY_PORT = port;
>> +   }
>>   }
>
>