"Steve Loughran" <[EMAIL PROTECTED]> wrote on 07/24/2002 07:55:19 AM:
> > ----- Original Message ----- > From: "Jeff Turner" <[EMAIL PROTECTED]> > To: "Ant Developers List" <[EMAIL PROTECTED]> > Sent: Monday, July 22, 2002 4:53 PM > Subject: HTTP/SOAP tasks (Re: what I want to see in the next version of ant) > > > > On Mon, Jul 22, 2002 at 01:08:42PM -0700, Steve Loughran wrote: > > > Here's my list what I'd like to see in the next version of ant. > > ... > > > What do I want to see in terms of task evolution: > > > > > > 2. try and get the http tasks to work with httpclient, and so work > properly > > > 3. I also want to be able to make soap calls from inside ant; that would > be > > > slick for some deployment actions > > > > For these two, see the Anteater project, http://aft.sourceforge.net/, > > which is a functional testing (poke a URL, test the result) framework. > > > > The SOAP example being: > > > > <target name="simple"> > > <http description="Post a simple SOAP request"> > > <soapRequest href="http://services.xmethods.net:80/soap" > > content="test/requests/get-quote"> > > <match> > > <responseCode value="200"/> > > <xpath > > select="/soap:Envelope/soap:Body/n:getQuoteResponse/Result"/> > > </match> > > </soapRequest> > > </http> > > </target> > > > > There's also a task to deploy an embedded Tomcat instance, which makes > > possible testing of interactive SOAP services, as well as mundane things > > like cron-driven webapp testing. There are regex, xpath, Relax NG and > > 'contentEquals' validators, and an XML/HTML reporting framework stolen > > straight from <junitreport> :) > > > > yea, I know of anteater. > > I was thinking of something less test centric, and more building soap calls > from properties and things > > <soapcall endpoint="http://localhost:8080/foo/services/something" > action="update" > resultproperty="results" > > > <param name="user" value="${user}" type="string"/> > </soapcall> This would be a piece of cake to do with Jelly and the Jelly HTTP Tag library in Latka. Jelly can use ant properties as well. Currently there's no SOAP taglib in Jelly, but it should be simple given the HTTP stuff has already been done. Sounds like an interesting addition though. Here's a sample using just POST (ugly but functional): <!-- use yours here --> <j:set var="googleKey" value="00000000000000000000000000000000" /> <post var="google" uri="http://api.google.com/search/beta2"> <header name="Content-Type" value="text/xml"/> <body> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"> <env:Body> <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <ns1:key xsi:type="xsd:string">${googleKey}</ns1:key> <ns1:q xsi:type="xsd:string">jelly java xml</ns1:q> <ns1:start xsi:type="xsd:int">0</ns1:start> <ns1:maxResults xsi:type="xsd:int">10</ns1:maxResults> <ns1:filter xsi:type="xsd:boolean">true</ns1:filter> <ns1:restrict xsi:type="xsd:string"></ns1:restrict> <ns1:safeSearch xsi:type="xsd:boolean">false</ns1:safeSearch> <ns1:lr xsi:type="xsd:string"></ns1:lr> <ns1:ie xsi:type="xsd:string">latin1</ns1:ie> <ns1:oe xsi:type="xsd:string">latin1</ns1:oe> </ns1:doGoogleSearch> </env:Body> </env:Envelope> </body> </post> <!-- display result headers --> <j:forEach items="${google.requestHeaders}" var="rHeader" indexVar="i"> reqHeader[${i}] = ${rHeader} </j:forEach> -- dIon Gillard, Multitask Consulting Work: http://www.multitask.com.au Developers: http://adslgateway.multitask.com.au/developers
