🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.java
Article #153894

Re: Android - eWUŚ

#153894
From: Piotr S.
Date: Tue, 01 Oct 2013 11:34
33 lines
2265 bytes
W dniu 2013-10-01 13:27, Piotr S. pisze:

>
> Może nie na Anroidzie, ale w moim oprogramowaniu w Javie to wygląda tak:
>
>> SOAPConnection soapConnection =
>> SOAPConnectionFactory.newInstance().createConnection();
>> SOAPMessage message = convertXmlToSoapMessage(xml);
>> SOAPHeader header = message.getSOAPHeader();
>> SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
 >> Iterator it = header.getChildElements();
>> SOAPElement sessionHeader = (SOAPElement)it.next();
>> SOAPElement authTokenHeader = (SOAPElement)it.next();
>> sessionHeader.addAttribute(envelope.createName("id"),this.user.getSessionId());
>> //id sesji
>> authTokenHeader.addAttribute(envelope.createName("id"),this.user.getAuthTokenId());
>> //token sesji
>>
>> message.saveChanges();
>>
>> URL endpoint = new URL(BROKER_SERVER);
>>
>> SOAPMessage reply = soapConnection.call(message, endpoint);
>  > ...

To się tyczy tylko komunikatu z właściwym zapytaniem oczywiście (id 
sesji i token muszą być już znane), czyli po wysłaniu komunikatu o 
zalogowanie.

(wcięło mi jedną linijkę w poście wyżej - zmienna 'it').

Pozdrawiam
P.S.
Technical Details
Message-ID: <524ab323$0$2179$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
References: <5249e592$0$2185$65785112@news.neostrada.pl> <524ab192$0$2207$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!unt-spo-b-01.news.neostrada.pl!news.neostrada.pl.POSTED!not-for-mail
Date: Tue, 01 Oct 2013 13:34:01 +0200
From: "Piotr S." <sashxat@interia.pl>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
Newsgroups: pl.comp.lang.java
Subject: Re: Android - eWUŚ
References: <5249e592$0$2185$65785112@news.neostrada.pl> <524ab192$0$2207$65785112@news.neostrada.pl>
In-Reply-To: <524ab192$0$2207$65785112@news.neostrada.pl>
Lines: 33
Message-ID: <524ab323$0$2179$65785112@news.neostrada.pl>
Organization: Telekomunikacja Polska
NNTP-Posting-Host: 79.189.48.194
X-Trace: 1380627235 unt-rea-a-02.news.neostrada.pl 2179 79.189.48.194:16695
X-Complaints-To: abuse@news.neostrada.pl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit