Bonjour,
je rencontre un problème depuis une semaine en voulant consommer un web service développé avec JaX WS sur un terminan Android
voici la description du WSDL
et voici mon activity principale:j'envoie une requête SOAP et j'affiche la réponse dans un textView
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 <definitions targetNamespace="http://service/" name="HelloWSService"><types><xsd:schema><xsd:import namespace="http://service/" schemaLocation="http://192.168.1.31:8585/?xsd=1"/></xsd:schema></types><message name="hello"><part name="parameters" element="tns:hello"/></message><message name="helloResponse"><part name="parameters" element="tns:helloResponse"/></message><portType name="HelloWordImp"><operation name="hello"><input wsam:Action="http://service/HelloWordImp/helloRequest" message="tns:hello"/><output wsam:Action="http://service/HelloWordImp/helloResponse" message="tns:helloResponse"/></operation></portType><binding name="HelloWSPortBinding" type="tns:HelloWordImp"><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><operation name="hello"><soap:operation soapAction=""/><input><soap:body use="literal"/></input><output><soap:body use="literal"/></output></operation></binding><service name="HelloWSService"><port name="HelloWSPort" binding="tns:HelloWSPortBinding"><soap:address location="http://192.168.1.31:8585/"/></port></service></definitions>
ça m'affiche dans le logcat l'erreur suivant:Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 public class MainActivity extends Activity { private static final String NAMESPACE = "http://service/"; private static String URL="http://192.168.1.31:8585/?wsdl"; private static final String METHOD_NAME = "hello"; private static final String SOAP_ACTION = "http://service/hello"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView text=(TextView)findViewById(R.id.resultat); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo nom=new PropertyInfo(); nom.setName("nom");nom.setValue("felix01"); nom.setType(String.class); request.addProperty(nom); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); SoapPrimitive resultsRequestSOAP = (SoapPrimitive) envelope.getResponse(); text.setText(resultsRequestSOAP.toString()); } catch (Exception e) { Toast.makeText(this,e.getMessage(),10000).show(); } }
apparemment j'ai commis une erreur lors des renseignement des informations pour accéder au service Web.
svp,qui peut me donner la source du problème je lui serai reconnaissant







Répondre avec citation
Partager