cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Collen ...@hist.umn.edu>
Subject Re: WebServiceProxy Hell
Date Mon, 25 Nov 2002 20:52:30 GMT
Alright, Here's what I got so far:

I've written a testing servlet that takes doPost, and prints out some 
valid XML.  I'm able to submit to it with a normal HTML form and get XML 
back.  I've got some debug statements in my servlet that prints to 
STDERR when a request is made so I can tell when the servlet is being 
called.  I see the debug messages when I post to the servlet using the 
plain HTML form.

Now, when I try to use the WSPG to interact with the servlet (or any 
other servlet for that matter), I'm getting the "No XML" error back. 
 When I hit Cocoon and invoke the pipeline, I notice that my debug 
servlet isn't even being called!

Here's all my stuff I have so far.  First the debug servlet:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class PostServlet extends HttpServlet {
   
    public void doPost(HttpServletRequest req, HttpServletResponse res)
        throws IOException, ServletException {

        System.err.println("[PostServlet] Entering doPost()");
        PrintWriter out = res.getWriter();
        String mode = req.getParameter("Mode");

        System.err.println("[PostServlet] Setting Content-type");
       
        res.setContentType("text/xml");

        System.err.println("[PostServlet] Sending XML...");
       
        out.println("<?xml version=\"1.0\"?>");
        out.println("<root>");
        out.println("\t<foo mode=\"" + mode + "\">");
       
        if (mode.equals("keyword")) {
            out.println("\t<keywords>" + req.getParameter("keywords") + 
"</keywords>");
        }

        out.println("\t</foo>");
        out.println("</root>");
       
        System.err.println("[PostServlet] Done sending XML. Exiting.");
    }
}

Here's the HTML form which submits to it:

<html>
<body>

<form method="post" action="http://localhost/postServlet">
    <textarea name="keywords" type="text" wrap="soft" cols="60" 
rows="4"></textarea>
    <input type="hidden" name="Mode" value="keyword"/>
    <input type="submit"></input>
</form>

</body>
</html>


Here's my pipeline:

<map:pipeline>

    <map:match pattern="search">
        <map:redirect-to uri="search/form.html"/>
    </map:match>

    <map:match pattern="search/form.html">
        <map:generate type="file" src="documents/searchForm.xml"/>
        <map:transform src="stylesheets/xmlform2html.xsl"/>
        <map:serialize type="html"/>
    </map:match>

    <map:match pattern="search/doSearch">
        <map:generate type="wsproxy" src="http://localhost/postServlet">
            <map:parameter name="wsproxy-method" value="POST"/>
        </map:generate>
        <map:serialize type="xml"/>
    </map:match>

</map:pipeline>


stylesheets/xmlform2html.xsl is the one which is included with the samples.

Here's my documents/searchForm.xml:

<?xml version="1.0"?>

<document xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002">
    <xf:form id="keyword-search" 
action="http://localhost/cocoon/nhgis/search/doSearch" method="POST">
        <xf:caption>Keyword Search</xf:caption>
            <xf:textbox ref="keywords" name="keywords">
                <xf:caption>Keywords</xf:caption>
            </xf:textbox>      

            <xf:submit id="submit" class="button">
                <xf:caption>Submit</xf:caption>
            </xf:submit>
    </xf:form>
</document>

And finally, here's the entire stack trace of the error that Cocoon 
provides after I post to the form that "search/form.html" gives me:


ERROR   (2002-11-25) 14:43.39:499   [access  ] (/cocoon/nhgis/search/doSearch) HttpProcessor[80][4]/CocoonServlet:
Problem with Cocoon servlet
org.apache.cocoon.ProcessingException: Error invoking remote service: org.apache.cocoon.ProcessingException:
Invalid response - no xml: org.apache.cocoon.ProcessingException: Invalid response - no xml
	at org.apache.cocoon.generation.WebServiceProxyGenerator.fetch(WebServiceProxyGenerator.java:278)
	at org.apache.cocoon.generation.WebServiceProxyGenerator.generate(WebServiceProxyGenerator.java:172)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:515)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:204)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:486)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:149)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:150)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:131)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:150)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:595)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1025)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Unknown Source)
org.apache.cocoon.ProcessingException: Invalid response - no xml
	at org.apache.cocoon.generation.WebServiceProxyGenerator.fetch(WebServiceProxyGenerator.java:269)
	at org.apache.cocoon.generation.WebServiceProxyGenerator.generate(WebServiceProxyGenerator.java:172)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:515)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:204)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:486)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:149)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:150)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:131)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:150)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:595)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1025)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Unknown Source)
org.apache.cocoon.ProcessingException: Invalid response - no xml
	at org.apache.cocoon.generation.WebServiceProxyGenerator.fetch(WebServiceProxyGenerator.java:269)
	at org.apache.cocoon.generation.WebServiceProxyGenerator.generate(WebServiceProxyGenerator.java:172)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:515)
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:204)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:486)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:149)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:150)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:131)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:83)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:162)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:153)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:107)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:150)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:326)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:308)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:595)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1025)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Unknown Source)


Hopefully this is verbose enough to figure out what's going on.  From 
what I can see, the WSPG isn't even contacting my servlet.  If anyone 
needs more info to figure out what's happening, let me know and I'll do 
whatever I can... it'd be nice to have the WSPG actually working :)


Millions upon millions of thanks,

Tony




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message