You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2003/11/04 18:37:58 UTC

DO NOT REPLY [Bug 24402] New: - XML posting from SourceWritingTransformer by using an enhanced HTTPClientSource

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24402>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24402

XML posting from SourceWritingTransformer by using an enhanced HTTPClientSource

           Summary: XML posting from SourceWritingTransformer by using an
                    enhanced HTTPClientSource
           Product: Cocoon 2
           Version: Current CVS 2.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: sitemap components
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: danielf@nada.kth.se


This patch makes it posible to post XML from the SourceWritingTransformer, this 
is usefull for e.g. doing SOAP calls in a pipeline. The main advantage in 
comparison with the XSP implementation of SOAP is that one can create the SOAP 
call based on the result from earlier steps in the pipeline se 
http://webservices.xml.com/pub/a/ws/2003/03/18/cocoon.html for some ideas about 
that (I was not aware about Steve Puntes implementation when I wrote my 
implementation).

An example:
<?xml version="1.0"?>
<page>
  <source:post xmlns:source="http://apache.org/cocoon/source/1.0">
    <source:source>http://services.xmethods.net:9090/soap</source:source>
    <source:header name="Content-Type">text/xml; charset="utf-8"</source:header>
    <source:header name="SOAPAction">""</source:header>
    <source:fragment>
      <SOAP-ENV:Envelope xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
			 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
			 xmlns:xsd="http://www.w3.org/1999/XMLSchema">
	<SOAP-ENV:Body>
	  <ns1:getRate xmlns:ns1="urn:xmethods-CurrencyExchange"
		       SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
	    <country1 xsi:type="xsd:string">England</country1>
	    <country2 xsi:type="xsd:string">Japan</country2>
	  </ns1:getRate>
	</SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    </source:fragment>
  </source:post>
</page>

I have extended the HTTPClientSource from Avalon Excalibur so that one can post 
XML data (or actually any data) to it. The main functionality is in the 
HTTPClientSource, the SourceWritingTransformer just use it. I am not certain 
that the SourceWritingTransformer is the best place for this functionality, I 
used it as it allready contained functionality for modifyable sources.

To use it Avlon Excalibur source must be patched as well as Cocoon and the 
HTTPClientSource must be used for the http: protocol instead of the standard 
URLSourceFactory.