Date: Thu, 28 Mar 2024 11:04:49 +0000 (UTC) Message-ID: <215180954.4951.1711623889479@localhost4> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4950_1886074056.1711623889478" ------=_Part_4950_1886074056.1711623889478 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Create a blog post to share news and announcements with your team and co= mpany.
=20The AndroidSOAP is a "yet another" SOAP client for Android platform, it = is compatible with 1.5+ versions and uses Reflection API.
But... this is only a proof-of-concept library, I've te= sted it with JBoss WebService stack, see and/or try the example.
Using AndroidSOAP is a very easy way to call SOAP services, because it i= s based on JAX-WS interfaces. You can use all interfaces that the 'wsimport= ' generates from the WSDL.
/** * Creates a request, it is a JAX-WS generated class */ ListSkinPacksRequest request =3D new ListSkinPacksRequest(); /** * Put it into a 'request' map */=20 Map<String, Object> parameters =3D new HashMap<String, Object>= (); parameters.put("request", request); /** * Create an envelope with namespace and create a body with operation name= 'listSkinPacks' */ Envelope envelope =3D new SimpleEnvelope("http://skinpack.pop.javaforum.hu= /"); envelope.setHeader(new SimpleHeader()); envelope.setBody(new SimpleBody("listSkinPacks", parameters)); /** * Creates a transport (HTTP or HTTPS) with an optional username/password */ HttpsTransport transport =3D new HttpsTransport("https://services.power.of= .planets.hu/PoP-SkinPack-remote/listSkinPacks", "androidsoap.demo@javaforum.hu", "demopassword"); /** * Set the 'trust all' flag, if necessary */ transport.setTrustAll(Boolean.TRUE); /** * Call a service, the result arrives into the JAX-WS class */ ListSkinPacksResponse response =3D transport.call(envelope, ListSkinPacksR= esponse.class); /** * You can use the result as a normal bean */ for (SkinPackMetadata metadata : response.getReturn().getSkinPacksList()) { String fileName =3D metadata.getFileName(); String name =3D metadata.getName(); }=20
Can you see? The lists are lists, the classes are classes, the values ar= e in the properties, just like in the JAX-WX client...
If any field has XmlElement annotation in the generated source, you need= add jaxb-api into your Android project, like this:
<dep= endency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.2.6</version> <scope>compile</scope> </dependency>=20
And add coreLibrary into the configuration of the android-maven-plu= gin:
<dex= > <coreLibrary>true</coreLibrary> </dex>=20
Source: http://svn.javaforum.hu/svn/and= roid/AndroidSOAP/trunk/
Wiki: http://wiki.javaforum.hu/display/ANDRO= IDSOAP/Home
Issues: http://traq.javaforum.hu/browse/ANDROIDSOA= P
Example APK: http:= //nexus.javaforum.hu/nexus/content/repositories/releases/hu/javaforum/andro= id/androidsoap/AndroidSOAP-example/0.0.5/AndroidSOAP-example-0.0.5.apk<= /p>
Step by step tutorial with Maven3 project: Step by Step Tutorial
If you have a patch, don't hesitate, send me as fast you ca= n...
If you need a feature, create an issue...
The entire project (with dependencies) managed by Maven, if you aren't u= sing Maven, you need some jars to add your project's CLASSPATH: