You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by pierre posset <p_...@hotmail.com> on 2008/07/07 16:29:55 UTC
Newbie
Hello,
I need to translate this XML in a java classe:
<soap:Envelope>
<soap:Header>
<wsse:Security SOAP-ENV:mustUnderstand="1">
<wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
<wsse:Username>username</wsse:Username>
<wsse:Password Type="wsse:PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<CreateAdvertiser xmlns="http://server/service">
<xmlAdv>
<Name>Advertiser Name</Name>
<Address>Advertiser Address</Address>
</xmlAdv>
</CreateAdvertiser>
</soap:Body>
</soap:Envelope>
and I don't find a document which explain me how to do.
I have tried to use AXIOM but of course it doesn't work because I don't really know what I am doing.
I really need help.
Thank you very much.
Best Regards.
_________________________________________________________________
Mettez Messenger sur votre mobile !
http://www.messengersurvotremobile.com
Re: Newbie
Posted by Eran Chinthaka <er...@gmail.com>.
This is an interesting question.
What do you mean, when you say "I need to translate this XML in a java
classe".
Also if you don't know what you are doing, how do *we* know what you should
do ;) ?
On Mon, Jul 7, 2008 at 7:29 AM, pierre posset <p_...@hotmail.com> wrote:
> Hello,
>
> I need to translate this XML in a java classe:
>
> <soap:Envelope>
> <soap:Header>
> <wsse:Security SOAP-ENV:mustUnderstand="1">
> <wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
> <wsse:Username>username</wsse:Username>
> <wsse:Password
> Type="wsse:PasswordText">password</wsse:Password>
> </wsse:UsernameToken>
> </wsse:Security>
> </soap:Header>
> <soap:Body>
> <CreateAdvertiser xmlns="http://server/service">
> <xmlAdv>
> <Name>Advertiser Name</Name>
> <Address>Advertiser Address</Address>
> </xmlAdv>
> </CreateAdvertiser>
> </soap:Body>
> </soap:Envelope>
>
> and I don't find a document which explain me how to do.
>
> I have tried to use AXIOM but of course it doesn't work because I don't
> really know what I am doing.
>
> I really need help.
>
> Thank you very much.
>
> Best Regards.
>
> ------------------------------
> Discutez gratuitement avec vos amis en vidéo ! Téléchargez Messenger,
> c'est gratuit ! <http://www.windowslive.fr/majmessenger.asp>
>
--
With Mettha,
Eran Chinthaka
--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada
Re: Newbie
Posted by Heshan Suriyaarachchi <he...@gmail.com>.
Hi,
You can do like below as well.
String filePath = "my-xml-files/MyXMLFile.xml";
OMElement documentElement = new StAXOMBuilder(filePath).getDocumentElement();
On Wed, Jul 16, 2008 at 3:28 PM, Heshan Suriyaarachchi <
heshan.suri@gmail.com> wrote:
> Hi Pierre,
> I do not understand what exactly that you want to do, but you can
> do a thing like this
>
> String str2 =
> "<deduct><var1>1.8</var1><var2>4.87594</var2></deduct>";
> StAXOMBuilder builder = new StAXOMBuilder(new
> ByteArrayInputStream(str2.getBytes()));
> OMElement om = builder.getDocumentElement();
>
> Then you can do the AXIOM stuff that you want to do with the OMElement.
> Following articles will help you to get an understanding on AXIOM.
>
>
> [1] - http://www.ibm.com/developerworks/webservices/library/ws-java2/
> [2] - http://ws.apache.org/axis2/1_0/OMTutorial.html
> [3] - http://wso2.org/library/2512
>
>
>
> On Mon, Jul 7, 2008 at 7:59 PM, pierre posset <p_...@hotmail.com>
> wrote:
>
>> Hello,
>>
>> I need to translate this XML in a java classe:
>>
>> <soap:Envelope>
>> <soap:Header>
>> <wsse:Security SOAP-ENV:mustUnderstand="1">
>> <wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
>> <wsse:Username>username</wsse:Username>
>> <wsse:Password
>> Type="wsse:PasswordText">password</wsse:Password>
>> </wsse:UsernameToken>
>> </wsse:Security>
>> </soap:Header>
>> <soap:Body>
>> <CreateAdvertiser xmlns="http://server/service">
>> <xmlAdv>
>> <Name>Advertiser Name</Name>
>> <Address>Advertiser Address</Address>
>> </xmlAdv>
>> </CreateAdvertiser>
>> </soap:Body>
>> </soap:Envelope>
>>
>> and I don't find a document which explain me how to do.
>>
>> I have tried to use AXIOM but of course it doesn't work because I don't
>> really know what I am doing.
>>
>> I really need help.
>>
>> Thank you very much.
>>
>> Best Regards.
>>
>> ------------------------------
>> Discutez gratuitement avec vos amis en vidéo ! Téléchargez Messenger,
>> c'est gratuit ! <http://www.windowslive.fr/majmessenger.asp>
>>
>
>
>
> --
> Regards,
> Heshan Suriyaarachchi
>
> http://heshans.blogspot.com/
>
--
Regards,
Heshan Suriyaarachchi
http://heshans.blogspot.com/
Re: Newbie
Posted by Heshan Suriyaarachchi <he...@gmail.com>.
Hi Pierre,
I do not understand what exactly that you want to do, but you can do
a thing like this
String str2 =
"<deduct><var1>1.8</var1><var2>4.87594</var2></deduct>";
StAXOMBuilder builder = new StAXOMBuilder(new
ByteArrayInputStream(str2.getBytes()));
OMElement om = builder.getDocumentElement();
Then you can do the AXIOM stuff that you want to do with the OMElement.
Following articles will help you to get an understanding on AXIOM.
[1] - http://www.ibm.com/developerworks/webservices/library/ws-java2/
[2] - http://ws.apache.org/axis2/1_0/OMTutorial.html
[3] - http://wso2.org/library/2512
On Mon, Jul 7, 2008 at 7:59 PM, pierre posset <p_...@hotmail.com> wrote:
> Hello,
>
> I need to translate this XML in a java classe:
>
> <soap:Envelope>
> <soap:Header>
> <wsse:Security SOAP-ENV:mustUnderstand="1">
> <wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
> <wsse:Username>username</wsse:Username>
> <wsse:Password
> Type="wsse:PasswordText">password</wsse:Password>
> </wsse:UsernameToken>
> </wsse:Security>
> </soap:Header>
> <soap:Body>
> <CreateAdvertiser xmlns="http://server/service">
> <xmlAdv>
> <Name>Advertiser Name</Name>
> <Address>Advertiser Address</Address>
> </xmlAdv>
> </CreateAdvertiser>
> </soap:Body>
> </soap:Envelope>
>
> and I don't find a document which explain me how to do.
>
> I have tried to use AXIOM but of course it doesn't work because I don't
> really know what I am doing.
>
> I really need help.
>
> Thank you very much.
>
> Best Regards.
>
> ------------------------------
> Discutez gratuitement avec vos amis en vidéo ! Téléchargez Messenger,
> c'est gratuit ! <http://www.windowslive.fr/majmessenger.asp>
>
--
Regards,
Heshan Suriyaarachchi
http://heshans.blogspot.com/
RE: R: Newbie
Posted by pierre posset <p_...@hotmail.com>.
Hello Simone,
Thank you for your answer it is clearer, do you know if there is a tutorial which explain me how to translate this in java?
Best Regards,
Pierre
> Subject: R: Newbie
> Date: Mon, 7 Jul 2008 16:53:45 +0200
> From: simonemaletta@alice.it
> To: axis-user@ws.apache.org
>
> Hi Pierre,
> you're trying to make an object from a Procedure Invocation.
> In the body you find the name of the method, or of the procedure if you like it better, and the <Name> and <Address> tags represents parameter of the Procedure.
> Axiom allows you to parse in a very easy way a SOAP envelope.
> I don't know what you're trying to do.
> I hope to be helpfull.
> regards
> Simone
>
> -----Messaggio originale-----
> Da: pierre posset [mailto:p_posset@hotmail.com]
> Inviato: lun 07/07/2008 16.29
> A: axis-user@ws.apache.org
> Oggetto: Newbie
>
>
> Hello,
>
> I need to translate this XML in a java classe:
>
> <soap:Envelope>
> <soap:Header>
> <wsse:Security SOAP-ENV:mustUnderstand="1">
> <wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
> <wsse:Username>username</wsse:Username>
> <wsse:Password Type="wsse:PasswordText">password</wsse:Password>
> </wsse:UsernameToken>
> </wsse:Security>
> </soap:Header>
> <soap:Body>
> <CreateAdvertiser xmlns="http://server/service">
> <xmlAdv>
> <Name>Advertiser Name</Name>
> <Address>Advertiser Address</Address>
> </xmlAdv>
> </CreateAdvertiser>
> </soap:Body>
> </soap:Envelope>
>
> and I don't find a document which explain me how to do.
>
> I have tried to use AXIOM but of course it doesn't work because I don't really know what I am doing.
>
> I really need help.
>
> Thank you very much.
>
> Best Regards.
>
> _________________________________________________________________
> Mettez Messenger sur votre mobile !
> http://www.messengersurvotremobile.com
>
_________________________________________________________________
Découvrez les profils Messenger de vos amis
http://home.services.spaces.live.com/
R: Newbie
Posted by si...@alice.it.
Hi Pierre,
you're trying to make an object from a Procedure Invocation.
In the body you find the name of the method, or of the procedure if you like it better, and the <Name> and <Address> tags represents parameter of the Procedure.
Axiom allows you to parse in a very easy way a SOAP envelope.
I don't know what you're trying to do.
I hope to be helpfull.
regards
Simone
-----Messaggio originale-----
Da: pierre posset [mailto:p_posset@hotmail.com]
Inviato: lun 07/07/2008 16.29
A: axis-user@ws.apache.org
Oggetto: Newbie
Hello,
I need to translate this XML in a java classe:
<soap:Envelope>
<soap:Header>
<wsse:Security SOAP-ENV:mustUnderstand="1">
<wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
<wsse:Username>username</wsse:Username>
<wsse:Password Type="wsse:PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<CreateAdvertiser xmlns="http://server/service">
<xmlAdv>
<Name>Advertiser Name</Name>
<Address>Advertiser Address</Address>
</xmlAdv>
</CreateAdvertiser>
</soap:Body>
</soap:Envelope>
and I don't find a document which explain me how to do.
I have tried to use AXIOM but of course it doesn't work because I don't really know what I am doing.
I really need help.
Thank you very much.
Best Regards.
_________________________________________________________________
Mettez Messenger sur votre mobile !
http://www.messengersurvotremobile.com
Re: Newbie
Posted by Amila Suriarachchi <am...@gmail.com>.
On Mon, Jul 7, 2008 at 7:59 PM, pierre posset <p_...@hotmail.com> wrote:
> Hello,
>
> I need to translate this XML in a java classe:
>
> <soap:Envelope>
> <soap:Header>
> <wsse:Security SOAP-ENV:mustUnderstand="1">
> <wsse:UsernameToken xsi:type="wsse:UsernameTokenType">
> <wsse:Username>username</wsse:Username>
> <wsse:Password
> Type="wsse:PasswordText">password</wsse:Password>
> </wsse:UsernameToken>
> </wsse:Security>
> </soap:Header>
> <soap:Body>
> <CreateAdvertiser xmlns="http://server/service">
> <xmlAdv>
> <Name>Advertiser Name</Name>
> <Address>Advertiser Address</Address>
> </xmlAdv>
> </CreateAdvertiser>
> </soap:Body>
> </soap:Envelope>
>
> and I don't find a document which explain me how to do.
>
> I have tried to use AXIOM but of course it doesn't work because I don't
> really know what I am doing.
>
I think you need to go for either a code first (POJO) or contract first
(start with a wsdl) approach which automatically do you the databinding.
Please see the Quick start guide
http://ws.apache.org/axis2/1_4/quickstartguide.html#clientadb
thanks,
Amila.
>
>
> I really need help.
>
> Thank you very much.
>
> Best Regards.
>
> ------------------------------
> Discutez gratuitement avec vos amis en vidéo ! Téléchargez Messenger,
> c'est gratuit ! <http://www.windowslive.fr/majmessenger.asp>
>
--
Amila Suriarachchi,
WSO2 Inc.