IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Android Discussion :

XmlPullParserException: expected: START_TAG


Sujet :

Android

  1. #1
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2012
    Messages
    23
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Bâtiment

    Informations forums :
    Inscription : Novembre 2012
    Messages : 23
    Points : 20
    Points
    20
    Par défaut XmlPullParserException: expected: START_TAG
    Bonjour,
    Jet tente d’interagir avec un fichier WSDL situer dans une passerelle de marque échelon. Pour cela j'ai développer une petite application android demandent juste une requête a cette dernière. J'ai pour cela utiliser la bibliothèque Ksoap1.1.
    Quand je demande la requette j'abtien une erreur XmlPullParserException: expected: START_TAG.

    J'ai cherché a résoudre ce problème en modifiant mon adressage mais rien ni change.

    Si vous pouvez m'aidez ou me donné des piste de recherche je vous en serez très reconnaissant.
    (ps. Je suis débutant en web-service et K soap.)

    voici mon logcat:
    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
     
    11-26 13:02:39.635: E/Trace(1262): error opening trace file: No such file or directory (2)
    11-26 13:02:40.355: D/gralloc_goldfish(1262): Emulator without GPU emulation detected.
    11-26 13:02:45.655: E/Connect(1262): Erreur: 
    11-26 13:02:45.655: E/Connect(1262): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <H1>@1:5 in java.io.InputStreamReader@4123dda8) 
    11-26 13:02:45.655: E/Connect(1262): 	at org.kxml2.io.KXmlParser.require(KXmlParser.java:2046)
    11-26 13:02:45.655: E/Connect(1262): 	at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:127)
    11-26 13:02:45.655: E/Connect(1262): 	at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
    11-26 13:02:45.655: E/Connect(1262): 	at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
    11-26 13:02:45.655: E/Connect(1262): 	at com.myconnexionsoap.Connexion$GroundServiceRead.doInBackground(Connexion.java:91)
    11-26 13:02:45.655: E/Connect(1262): 	at com.myconnexionsoap.Connexion$GroundServiceRead.doInBackground(Connexion.java:1)
    11-26 13:02:45.655: E/Connect(1262): 	at android.os.AsyncTask$2.call(AsyncTask.java:287)
    11-26 13:02:45.655: E/Connect(1262): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
    11-26 13:02:45.655: E/Connect(1262): 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
    11-26 13:02:45.655: E/Connect(1262): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
    11-26 13:02:45.655: E/Connect(1262): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    11-26 13:02:45.655: E/Connect(1262): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    11-26 13:02:45.655: E/Connect(1262): 	at java.lang.Thread.run(Thread.java:856)
    Ma fonction Connexion
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    package com.myconnexionsoap;
     
    /****
     * dépendance android
     */
    import android.app.Activity;
    import android.os.AsyncTask;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.View;
    import android.widget.Toast;
     
    /****
     * dépendance de ksoap
     */
    import org.ksoap2.SoapEnvelope;
    import org.ksoap2.serialization.SoapObject;
    import org.ksoap2.serialization.SoapPrimitive;
    import org.ksoap2.serialization.SoapSerializationEnvelope;
    import org.ksoap2.transport.HttpTransportSE;
    import org.ksoap2.serialization.PropertyInfo;
     
    public class Connexion extends Activity
    {
    	/****
             * declaration de l'adresse et des methodes
             */
    	private static final String NAMESPACE = "http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/";
    	private static String URL="http://192.168.1.105:/WSDL/v4.0/iLON100.wsdl";
    	private static final String METHOD_NAME = "Read";
    	private static final String SOAP_ACTION =  "http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/";
     
    	private String Results = null;
    	private String Errors = null;
    	/****
             *  S'éffectue la première fois que l'activité ce lance:
             *  Initialisation de l'activité
             */
    	@Override
    	public void onCreate (Bundle savedInstanceState)
    	{
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.activity_connexion);		
    	}/*** end public void onCreate (Bundle savedInstanceThread) ***/
     
    	/****
             * Methode OnClick "ValRelais" de @+id/btn_TestValRelais
             * @param V
             */
    	public void ValRelais (View V)
    	{
    		/*** Appel de la tache de fond read ***/
    		GroundServiceRead MyRead = new GroundServiceRead();
    		MyRead.execute();
    	}/*** public void ValRelais (View V) ***/
     
    	private class GroundServiceRead extends AsyncTask<Void, Void, Void> 
    	{
    		@Override
    		protected void onPreExecute()
    		{
    			super.onPreExecute();
    			Toast.makeText(getApplicationContext(), "Début du traitement asynchrone", Toast.LENGTH_LONG).show();
    		}
     
    		@Override
    		protected Void doInBackground(Void... V)
    		{
    			try
    			{
    				SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
     
    				//PropertyInfo propInfo=new PropertyInfo();
    				//propInfo.name="Read";
    				//propInfo.type=PropertyInfo.STRING_CLASS;
    				//request.addProperty(propInfo, "");
     
    				SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    				envelope.setOutputSoapObject(request);
    				envelope.bodyOut = request;
     
    				HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
     
    				try
    				{
    					androidHttpTransport.call(SOAP_ACTION, envelope);
     
    					SoapPrimitive resultsRequestSOAP = (SoapPrimitive) envelope.getResponse();
    					Results = resultsRequestSOAP.toString();
    				}
    				catch (Exception e) //connexion NOK: afficher l'exeption
    				{
    					//Affiche l'exeption clairement dans le logcat
    					Log.e("Connect","Erreur: ",e);
    					Errors =  e.getMessage();
    				}
    			}
    			catch (Exception e)
    			{
    				Log.e("URL","Erreur: ",e);
    				Errors =  e.getMessage();			
    			}
    			/*********************************************************************************************/			
    			return null;
    		}/*** protected Void doInBackground(Void... V) ***/
     
    		@Override
    		protected void onPostExecute(Void result) 
    		{
    			super.onPostExecute(result);
    			if (Errors != null)
    			{
    				Toast.makeText(getApplicationContext(), "" + Results, Toast.LENGTH_LONG).show();
    			}
    			else
    			{
    				Toast.makeText(getApplicationContext(), "" + Errors, Toast.LENGTH_LONG).show();
    			}
    			Toast.makeText(getApplicationContext(), "Le traitement asynchrone est terminé", Toast.LENGTH_LONG).show();
    		}/*** protected void onPostExecute(Void result) ***/
     
    	}/*** end private class GroundServiceRead extends AsyncTask<Void, Integer, Void> ***/
     
    }/*** end public class Connexion extends Activity ***/
    J'ai bien mi aussi dans le manifest la permission internet:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    Et j'accède bien a mon wsdl sur internet (navigateur: Mozilla).
    Voici mon fichier wsdl:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    <definitions name="iLON100" targetNamespace="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/"><types><xsd:annotation><xsd:appinfo>
    				_________________________________________________________
    				i.LON100's general declaration of the SOAP interface.
    				_________________________________________________________
    				It is prohibited to change any declaration in this file!
     
    				Copyright 2007 Echelon Corporation
    				http://www.echelon.com
    			</xsd:appinfo><xsd:documentation>
    				Look into the imported xsd file for more informations
    			</xsd:documentation></xsd:annotation><!-- ******************************************************** --><!-- external schema import                                   --><!-- ******************************************************** --><xsd:schema elementFormDefault="qualified"><xsd:import namespace="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/" schemaLocation="iLON100.xsd"/></xsd:schema></types><!-- ******************************************************** --><!-- declaration: 'wsdl:message'                              --><!-- ******************************************************** --><!-- ________________________________________________________ --><!--  List                                                    --><message name="List_SoapIn"><part name="parameters" element="ilon:List"/></message><message name="List_SoapOut"><part name="parameters" element="ilon:ListResponse"/></message><!--  Get                                                     --><message name="Get_SoapIn"><part name="parameters" element="ilon:Get"/></message><message name="Get_SoapOut"><part name="parameters" element="ilon:GetResponse"/></message><!-- Set                                                      --><message name="Set_SoapIn"><part name="parameters" element="ilon:Set"/></message><message name="Set_SoapOut"><part name="parameters" element="ilon:SetResponse"/></message><!-- Delete                                                   --><message name="Delete_SoapIn"><part name="parameters" element="ilon:Delete"/></message><message name="Delete_SoapOut"><part name="parameters" element="ilon:DeleteResponse"/></message><!-- Read                                                     --><message name="Read_SoapIn"><part name="parameters" element="ilon:Read"/></message><message name="Read_SoapOut"><part name="parameters" element="ilon:ReadResponse"/></message><!-- Write                                                    --><message name="Write_SoapIn"><part name="parameters" element="ilon:Write"/></message><message name="Write_SoapOut"><part name="parameters" element="ilon:WriteResponse"/></message><!-- Clear                                                    --><message name="Clear_SoapIn"><part name="parameters" element="ilon:Clear"/></message><message name="Clear_SoapOut"><part name="parameters" element="ilon:ClearResponse"/></message><!-- InvokeCmd                                                   --><message name="InvokeCmd_SoapIn"><part name="parameters" element="ilon:InvokeCmd"/></message><message name="InvokeCmd_SoapOut"><part name="parameters" element="ilon:InvokeCmdResponse"/></message><!-- ________________________________________________________ --><!-- common header                                            --><message name="iLON100SoapHeader"><part name="soapHeaderPart" element="ilon:messageProperties"/></message><!-- ******************************************************** --><!-- declaration: 'wsdl:portType'                                 --><!-- ******************************************************** --><portType name="iLON100portType"><!-- ______________________________________________________ --><!--  List                                                  --><operation name="List"><input message="ilonwsdl:List_SoapIn"/><output message="ilonwsdl:List_SoapOut"/></operation><!--  Get                                                   --><operation name="Get"><input message="ilonwsdl:Get_SoapIn"/><output message="ilonwsdl:Get_SoapOut"/></operation><!-- Set                                                    --><operation name="Set"><input message="ilonwsdl:Set_SoapIn"/><output message="ilonwsdl:Set_SoapOut"/></operation><!-- Delete                                                 --><operation name="Delete"><input message="ilonwsdl:Delete_SoapIn"/><output message="ilonwsdl:Delete_SoapOut"/></operation><!-- Read                                                   --><operation name="Read"><input message="ilonwsdl:Read_SoapIn"/><output message="ilonwsdl:Read_SoapOut"/></operation><!-- Write                                                  --><operation name="Write"><input message="ilonwsdl:Write_SoapIn"/><output message="ilonwsdl:Write_SoapOut"/></operation><!-- Clear                                                  --><operation name="Clear"><input message="ilonwsdl:Clear_SoapIn"/><output message="ilonwsdl:Clear_SoapOut"/></operation><!-- InvokeCmd                                              --><operation name="InvokeCmd"><input message="ilonwsdl:InvokeCmd_SoapIn"/><output message="ilonwsdl:InvokeCmd_SoapOut"/></operation></portType><!-- ******************************************************** --><!-- declaration: 'wsdl:binding'                              --><!-- ******************************************************** --><binding name="iLON100soap11Binding" type="ilonwsdl:iLON100portType"><!-- ______________________________________________________ --><!-- 'soap:binding'                                         --><soapbind:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><!-- ______________________________________________________ --><!-- List                                                   --><operation name="List"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/List"/><input name="ListRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="ListResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- Get                                                    --><operation name="Get"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Get"/><input name="GetRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="GetResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- Set                                                    --><operation name="Set"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Set"/><input name="SetRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="SetResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- Delete                                                 --><operation name="Delete"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Delete"/><input name="DeleteRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="DeleteResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- Read                                                   --><operation name="Read"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Read"/><input name="ReadRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="ReadResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- Write                                                  --><operation name="Write"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Write"/><input name="WriteRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="WriteResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- Clear                                                  --><operation name="Clear"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Clear"/><input name="ClearRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="ClearResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation><!-- InvokeCmd                                                 --><operation name="InvokeCmd"><soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/InvokeCmd"/><input name="InvokeCmdRequest"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></input><output name="InvokeCmdResponse"><soapbind:body parts="parameters" use="literal"/><soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/></output></operation></binding><!-- ************************************************************* --><!-- declaration: 'wsdl:service'                                   --><!-- ************************************************************* --><service name="iLON100"><port name="iLON100httpPort" binding="ilonwsdl:iLON100soap11Binding"><soapbind:address location="http://localhost/WSDL/iLON100.wsdl"/></port></service></definitions>
    Voila je remerci d'avance tout personne ce penchant sur mon problème.
    Merci.

  2. #2
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Je te suggère d'afficher ce que contient ton flux retourné. Il pense trouver un START_TAG (donc une balise ouvrante), mais tombe sur une URL avec un {, ce qui me laisserait penser que tu récupérerais du JSON.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  3. #3
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2012
    Messages
    23
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Bâtiment

    Informations forums :
    Inscription : Novembre 2012
    Messages : 23
    Points : 20
    Points
    20
    Par défaut
    Après plusieurs recherche je sais pas si j'ai amélioré le problème ou empiré mais je me suis concentré sur l'appel d'une fonction seulement et j’obtiens maintenant le logcat suivant:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    11-28 10:13:25.184: E/IOException(1149): SoapFault - faultcode: '18' faultstring: 'Requested namespace is not supported.' faultactor: 'null' detail: org.kxml2.kdom.Node@41244198
    J'ai récupérer mon wsdl en FTP et enlever les autres fonction que la fonction Read pour que sa vous soit plus rapide a le lire.
    iLON100.wsdl
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    <?xml version="1.0" encoding="utf-8"?>
    <definitions name="iLON100"
    		targetNamespace="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/"
    		xmlns:ilon="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/"
    		xmlns:ilonwsdl="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/"
    		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    		xmlns="http://schemas.xmlsoap.org/wsdl/"
    		xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    		xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/">
    	<types>
    		<xsd:annotation>
    			<xsd:appinfo>
    				_________________________________________________________
    				i.LON100's general declaration of the SOAP interface.
    				_________________________________________________________
    				It is prohibited to change any declaration in this file!
     
    				Copyright 2007 Echelon Corporation
    				http://www.echelon.com
    			</xsd:appinfo>
    			<xsd:documentation>
    				Look into the imported xsd file for more informations
    			</xsd:documentation>
    		</xsd:annotation>
     
    		<!-- ******************************************************** -->
    		<!-- external schema import                                   -->
    		<!-- ******************************************************** -->
    		<xsd:schema  elementFormDefault="qualified">
    			<xsd:import namespace="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/" schemaLocation="iLON100.xsd"/>
    		</xsd:schema>
    	</types>
     
    	<!-- ******************************************************** -->
    	<!-- declaration: 'wsdl:message'                              -->
    	<!-- ******************************************************** -->
     
    	<!-- ________________________________________________________ -->
    	<!--  List                                                    -->
     
    	<!-- Read                                                     -->
    	<message name="Read_SoapIn">
    		<part name="parameters" element="ilon:Read"/>
    	</message>
    	<message name="Read_SoapOut">
    		<part name="parameters" element="ilon:ReadResponse"/>
    	</message>
     
    	<!-- ________________________________________________________ -->
    	<!-- common header                                            -->
    	<message name="iLON100SoapHeader">
    		<part name="soapHeaderPart" element="ilon:messageProperties"/>
    	</message>
     
    	<!-- ******************************************************** -->
    	<!-- declaration: 'wsdl:portType'                                 -->
    	<!-- ******************************************************** -->
    	<portType name="iLON100portType">
    		<!-- ______________________________________________________ -->
     
    		<!-- Read                                                   -->
    		<operation name="Read">
    			<input message="ilonwsdl:Read_SoapIn"/>
    			<output message="ilonwsdl:Read_SoapOut"/>
    		</operation>
     
    	</portType>
     
     
    	<!-- ******************************************************** -->
    	<!-- declaration: 'wsdl:binding'                              -->
    	<!-- ******************************************************** -->
    	<binding name="iLON100soap11Binding" type="ilonwsdl:iLON100portType">
    		<!-- ______________________________________________________ -->
    		<!-- 'soap:binding'                                         -->
    		<soapbind:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
     
    		<!-- ______________________________________________________ -->
     
    		<!-- Read                                                   -->
    		<operation name="Read">
    			<soapbind:operation soapAction="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Read"/>
    			<input name="ReadRequest">
    				<soapbind:body parts="parameters" use="literal"/>
    				<soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/>
    			</input>
    			<output name="ReadResponse">
    				<soapbind:body parts="parameters" use="literal"/>
    				<soapbind:header message="ilonwsdl:iLON100SoapHeader" part="soapHeaderPart" use="literal"/>
    			</output>
    		</operation>
    	</binding>
     
    	<!-- ************************************************************* -->
    	<!-- declaration: 'wsdl:service'                                   -->
    	<!-- ************************************************************* -->
    	<service name="iLON100">
    		<port name="iLON100httpPort" binding="ilonwsdl:iLON100soap11Binding">
    			<soapbind:address location="http://localhost/WSDL/iLON100.wsdl"/>
    		</port>
    	</service>
    </definitions>
    maintenant mon code:
    declaration
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    	private static final String NAMESPACE = "http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/wsdl/";
    	private static String URL="http://192.168.1.105:7000/WSDL/iLON100.wsdl";
    	private static final String METHOD_NAME = "Read";
    	private static final String SOAP_ACTION =  "http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/action/Read";
    fonction soap
    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
    	/*****
             * SoapObject soap
             * 
             * @param property
             * @param value
             * @return resultsRequestSOAP
             * @throws IOException
             * @throws XmlPullParserException
             */
    	public static SoapObject soap (String property, String value) throws IOException, XmlPullParserException
    	{
    		// Création de la requête SOAP
    		SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
     
    		//Ajout de propriété: addProperty(nom de variable, valeur) -> Le nom de la variable vient du fichier WSDL
    		if (property != null)
    		{
    			request.addProperty(property, value);
    		}
     
    		//Toutes les données demandées sont mises dans une enveloppe.
    		SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
     
    		//Préparation de la requête
    		envelope.setOutputSoapObject(request);		
    		HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
     
     
    		//Ceci est optionnel, on l'utilise pour savoir si nous voulons ou non utiliser 
    		//un paquet "sniffer" pour vérifier le message original (androidHttpTransport.requestDump)
    		androidHttpTransport.debug = true; 
     
    		//Envoi de la requête
    		androidHttpTransport.call(SOAP_ACTION, envelope);
    		//Obtention du résultat
    		SoapObject resultsRequestSOAP = (SoapObject) envelope.getResponse();
    		return resultsRequestSOAP;
    	}/*** public static SoapObject soap (String property, String value) throws IOException, XmlPullParserException ***/
    appel de la fonction:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SoapObject soap = soap ("Item_Coll", "Read");
    class java de la fonction Read
    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
     
    package com.echelon.wsdl.web_services_ns.ilon100.v4_0.message;
     
    import javax.xml.bind.annotation.XmlAccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlRootElement;
    import javax.xml.bind.annotation.XmlType;
     
     
    /**
     * <p>Classe Java pour anonymous complex type.
     * 
     * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;element name="iLonItem" type="{http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/}Item_Coll"/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "iLonItem"
    })
    @XmlRootElement(name = "Read")
    public class Read {
     
        @XmlElement(required = true)
        protected ItemColl iLonItem;
     
        /**
         * Obtient la valeur de la propriété iLonItem.
         * 
         * @return
         *     possible object is
         *     {@link ItemColl }
         *     
         */
        public ItemColl getILonItem() {
            return iLonItem;
        }
     
        /**
         * Définit la valeur de la propriété iLonItem.
         * 
         * @param value
         *     allowed object is
         *     {@link ItemColl }
         *     
         */
        public void setILonItem(ItemColl value) {
            this.iLonItem = value;
        }
    }
    Merci de m'aidé s'il vous plais.
    Si il vous manque la moindre information n'hésiter pas... merci

  4. #4
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2012
    Messages
    23
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Bâtiment

    Informations forums :
    Inscription : Novembre 2012
    Messages : 23
    Points : 20
    Points
    20
    Par défaut
    Après quelque heure de recherche je pense qu'il me manque un header et body a ma requête soap.
    Car mon erreur étant:
    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
    11-29 10:13:26.947: E/IOException(811): SoapFault - faultcode: '1' faultstring: 'No application response. Application not loaded or busy' faultactor: 'null' detail: null
    11-29 10:13:26.947: E/IOException(811): 	at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:136)
    11-29 10:13:26.947: E/IOException(811): 	at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:137)
    11-29 10:13:26.947: E/IOException(811): 	at org.ksoap2.transport.Transport.parseResponse(Transport.java:96)
    11-29 10:13:26.947: E/IOException(811): 	at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:189)
    11-29 10:13:26.947: E/IOException(811): 	at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
    11-29 10:13:26.947: E/IOException(811): 	at com.myconnexionsoap.Connexion.soap(Connexion.java:162)
    11-29 10:13:26.947: E/IOException(811): 	at com.myconnexionsoap.Connexion$GroundServiceRead.doInBackground(Connexion.java:78)
    11-29 10:13:26.947: E/IOException(811): 	at com.myconnexionsoap.Connexion$GroundServiceRead.doInBackground(Connexion.java:1)
    11-29 10:13:26.947: E/IOException(811): 	at android.os.AsyncTask$2.call(AsyncTask.java:287)
    11-29 10:13:26.947: E/IOException(811): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
    11-29 10:13:26.947: E/IOException(811): 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
    11-29 10:13:26.947: E/IOException(811): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
    11-29 10:13:26.947: E/IOException(811): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
    11-29 10:13:26.947: E/IOException(811): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
    11-29 10:13:26.947: E/IOException(811): 	at java.lang.Thread.run(Thread.java:856)
    la partie:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Application not loaded or busy' faultactor: 'null' detail: null
    Cela est correspond t'il bien au manque d'un header et body dans ma requête?

    J'ai cherché un peu partout sans grand succès pouvez vous m'indiquer la méthode ou un cour en Ksoap 1.1 Merci.

Discussions similaires

  1. #include expects "FILENAME" or <FILENAME>
    Par Nocif dans le forum C
    Réponses: 9
    Dernier message: 06/10/2005, 15h01
  2. Scalar found where operator expected at...
    Par Mr Hyde dans le forum Langage
    Réponses: 4
    Dernier message: 21/09/2005, 16h06
  3. [Débutant(e)]Erreur 'class' or 'interface' expect
    Par chevy dans le forum Général Java
    Réponses: 7
    Dernier message: 30/03/2005, 08h13
  4. Problème avec le lieur "Expected a file name : "
    Par RA/m dans le forum C++Builder
    Réponses: 3
    Dernier message: 16/06/2004, 08h41
  5. [Plugin]package does not match the expected package src
    Par Fladnag dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 10/03/2004, 20h17

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo