Tony, Since the WSPG is a light wrapper around HttpClient, it may not be that easy to answer. The component is relatively new, so your help debugging the problem may be valueable to everyone.
there are a set of working examples in the source code. See a demo here: http://www.cocoonhive.org/portal/home Ivelin ----- Original Message ----- From: "Tony Collen" <[EMAIL PROTECTED]> To: "cocoon-users" <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 5:36 PM Subject: WebServiceProxy Hell > Agh! > > I'm trying to wrap my head arounc WebServiceProxyGenerator (and > eventually XMLForms), and I'm having all sorts of problems. I'm trying > to post to a servlet which I *know* returns valid xml, along with the > <?xml version="1.0"?> header. I couldn't get it working for the life > of me, so I prototyped a simple PHP script to take post/get vars, and > spit out XML: > > <?php > > $mode = $HTTP_GET_VARS['Mode']; > $keywords = $HTTP_GET_VARS['keywords']; > > header("Content-type: text/xml"); > > print "<?xml version=\"1.0\"?>\n"; > print "<results>\n"; > print "\t<mode>$mode</mode>\n"; > print "\t<keywords>$keywords</keywords>\n"; > print "</results>\n"; > > ?> > > Alright, pretty simple. Next I have my pipeline: > > <map:match pattern="testingtwo"> > <map:generate type="wsproxy" > src="http://host/testPost.php?Mode=keyword&keyword=age+race+sex"> > <map:parameter name="wsproxy-method" value="GET"/> > </map:generate> > <map:serialize type="xml"/> > </map:match> > > > Alas, I get the following error after I access the pipeline: > > > Cocoon 2 - Internal server error > > ------------------------------------------------------------------------ > > *type* fatal > > *message* _Error invoking remote service: java.io.IOException: Bad chunk > size: 58 _ > > *description* _org.apache.cocoon.ProcessingException: Error invoking > remote service: java.io.IOException: Bad chunk size: 58 : > java.io.IOException: Bad chunk size: 58 _ > > *sender* org.apache.cocoon.servlet.CocoonServlet > > *source* Cocoon servlet > > *stack-trace > * > > org.apache.cocoon.ProcessingException: Error invoking remote service: java.io.IOException: Bad chunk size: 58 : java.io.IOException: Bad chunk size: 58 > at org.apache.cocoon.generation.WebServiceProxyGenerator.fetch(WebServiceProxyG enerator.java:278) > at org.apache.cocoon.generation.WebServiceProxyGenerator.generate(WebServicePro xyGenerator.java:172) > at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLP ipeline(AbstractProcessingPipeline.java:515) > at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline .processXMLPipeline(AbstractCachingProcessingPipeline.java:204) > at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(Abs tractProcessingPipeline.java:486) > at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(Seri alizeNode.java:149) > at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:83) > at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invok e(PreparableMatchNode.java:162) > at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:107) > at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(Pipel ineNode.java:153) > at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invo keNodes(AbstractParentProcessingNode.java:107) > at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(Pipe linesNode.java:150) > at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess or.java:326) > at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcess or.java:308) > > *<snip/> > * > > * > *The weird thing is when I reload the pipeline in my browser, I get a > slightly different error: > > *message* _Error invoking remote service: > org.apache.commons.httpclient.HttpRecoverableException: Error in parsing > the status line from the response: unable to find line starting with > "HTTP/"_ > > *description* _org.apache.cocoon.ProcessingException: Error invoking > remote service: org.apache.commons.httpclient.HttpRecoverableException: > Error in parsing the status line from the response: unable to find line > starting with "HTTP/": > org.apache.commons.httpclient.HttpRecoverableException: Error in parsing > the status line from the response: unable to find line starting with "HTTP/" > _ > > _ > _I am getting the exact same behavior when I try to connect the wsproxy > to a servlet that takes Post: > > <map:match pattern="testing"> > <map:generate type="wsproxy" label="xml" > src="http://host:8080/servlets/DevServlet?Mode=keyword&keywords=age+race +sex"> > <map:parameter name="wsproxy-method" value="POST"/> > </map:generate> > <map:serialize type="xml"/> > </map:match> > > > I hate to complain about the documentation, since I'm trying to help out > with it :) I'm eventually going to work my way up to using XMLForms, > but I need to get the basis working correctly first. Can anyone give > me some pointers on how to get this working? > > > 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: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>