commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dário Luís Coneglian Oliveros <olive...@cpqd.com.br>
Subject RE: [jelly] soap example
Date Thu, 03 Nov 2005 10:27:17 GMT
Hi Jason,

Finally got my sample working. It converts currency between two countries, in this case from
dollar (united states) to real (brazil).
Here is a snippet of the jelly script:
<j:jelly xmlns:j="jelly:core" xmlns:http="jelly:http" xmlns:x="jelly:xml" trim="no">
	<http:post uri="http://services.xmethods.net:80/soap" var="response" trim="yes">
		<http:header name="SOAPAction" value=""/>
		<http:body>
			<soap:Envelope
				xmlns:mrns0="urn:xmethods-CurrencyExchange"
				xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
				xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
				xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
				xmlns:xsd="http://www.w3.org/1999/XMLSchema">
				<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
					<mrns0:getRate>
						<country1 xsi:type="xs:string">united states</country1>
						<country2 xsi:type="xs:string">brazil</country2>
					</mrns0:getRate>
				</soap:Body>
			</soap:Envelope>
		</http:body>
	</http:post>
    <x:parse var="doc" text="${response.responseBodyAsString}"/>    
    SOAP response:
    <x:copyOf select="$doc"/>    
    Currency Exchange (dollar to real):
    <x:expr select="$doc/*/*/*/Result"/>
</j:jelly>

I used the jelly:xml library to parse the response and show the result.

Dario

-----Original Message-----
From: Jason Vinson [mailto:vinson.lists@charter.net]
Sent: quarta-feira, 2 de novembro de 2005 00:42
To: Jakarta Commons Users List
Subject: Re: [jelly] soap example


Hi Dario,

Can you give me some idea what you are trying to parse here?  Is it  
the soap call from the stock quote webservice from before?  If so,  
can you just include a small snippet of the jelly script you have  
thus far?

Thanks,
Jason


On Nov 1, 2005, at 11:38 AM, Dário Luís Coneglian Oliveros wrote:

> Hi Jason,
>
> Still don´t know how to get a http response using jelly:http. I  
> couldn´t see in your example where the http response is kept as a  
> result of a request. I guess it is in the var attribute, but not sure.
>
> Thanks,
> Dario
>
> -----Original Message-----
> From: Jason Vinson [mailto:vinson.lists@charter.net]
> Sent: segunda-feira, 31 de outubro de 2005 18:50
> To: Jakarta Commons Users List
> Subject: Re: [jelly] soap example
>
>
> Dario,
>
> My only suggestion would be to use the xml tags to parse the
> response.  I haven't explicitly tried this with soap results, but i
> use it for parsing other xml.
>
> Feel free to Email me if you have problems with it.
> Jason
>
>
> On Oct 31, 2005, at 11:30 AM, Dário Luís Coneglian Oliveros wrote:
>
>> Hi Jason,
>>
>> Sorry for the misunderstanding. I thought the link you sent
>> previously was the same I'd been through before.
>> Anyway, I think your sample is pretty useful. I run it with no
>> problem at all.
>> Question: How can I handle a SOAP response using jelly:http ?
>> Thanks a bunch.
>>
>> Dario
>>
>> -----Original Message-----
>> From: Jason Vinson [mailto:vinson.lists@charter.net]
>> Sent: segunda-feira, 31 de outubro de 2005 12:26
>> To: Jakarta Commons Users List
>> Subject: Re: [jelly] soap example
>>
>>
>> Hi Dario,
>>
>> My experience with jelly soap is pretty much non-existent, but I have
>> used the http tags, and there's an example using jelly-http with
>> google's soap api.  It's much less elegant than the jelly-soap tags,
>> but may steer you in the right direction.
>>
>>
>> http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/jelly/trunk/
>> jelly-tags/http/src/test/org/apache/commons/jelly/google/ 
>> search.jelly?
>> rev=155420&view=markup
>>
>> Jason
>>
>>
>> On Oct 31, 2005, at 9:18 AM, Dário Luís Coneglian Oliveros wrote:
>>
>>
>>> Thanks Jason !
>>> I actually tried to run this sample (example.xml) before, but it
>>> did not work.
>>> So after spending some time figuring out how jelly:soap should
>>> work, I found some useful information I would like to share.
>>> First, you gotta place some jars from Apache Axis (axis.jar,
>>> saaj.jar and jaxrpc.jar), JavaMail (mail.jar) and JAF
>>> (activation.jar)at JELLY_HOME/custom directory. This allows you to
>>> use jelly:soap without getting runtime exceptions.
>>> Here´s a soap example that works fine.
>>>
>>> <j:jelly
>>>   xmlns:soap="jelly:soap"
>>>   xmlns:log="jelly:log"
>>>   xmlns:j="jelly:core">
>>>   <soap:invoke
>>>       var="quote"
>>>       endpoint="http://services.xmethods.net:80/soap/"
>>>       namespace="urn:xmethods-delayed-quotes"
>>>       method="getQuote">SUNW</soap:invoke>
>>>   <log:info>Quote for Sun Microsystems: ${quote}</log:info>
>>> </j:jelly>
>>>
>>> Note this web service requires just one parameter: SUNW. I could
>>> not find a way to pass more than one argument to a web service. Do
>>> you happen to know to do that ?
>>> Regards,
>>> Dario
>>>
>>>
>>> -----Original Message-----
>>> From: Jason Vinson [mailto:vinson.lists@charter.net]
>>> Sent: segunda-feira, 31 de outubro de 2005 11:38
>>> To: Jakarta Commons Users List
>>> Subject: Re: [jelly] soap example
>>>
>>>
>>> Check the svn testcase:
>>>
>>> http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/jelly/ 
>>> trunk/
>>> jelly-tags/soap/src/test/org/apache/commons/jelly/tags/soap/?
>>> rev=329819
>>>
>>> Not the most extensive test case, but it should give you some ideas.
>>>
>>> Jason
>>>
>>> On Oct 28, 2005, at 1:36 PM, Dário Luís Coneglian Oliveros wrote:
>>>
>>>
>>>
>>>> Hi,
>>>> Does anybody have any jelly example that uses SOAP taglib ?
>>>> Thanks,
>>>> Dário
>>>>
>>>> ------------------------------------------------------------------- 
>>>> -
>>>> -
>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: commons-user-
>>>> help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user- 
>>> help@jakarta.apache.org
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user- 
>>> help@jakarta.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message