ozaka / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Start-Tag missing, absolutly new to kSOAP2! #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Staring the Application, since it's quite small I think that should do
it here.

What is the expected output? What do you see instead?

Well actually I'm not quite sure what should be the output in the end, but
while debugging the app I noticed that it won't execute the line:

aht.call(SOAP_ACTION, soapEnvelope);
and the errorlog says the following:
expected: START_TAG {http://www.w3.org/2001/12/soap-envelope}Envelope
(position:START_TAG <h1>@1:4 in java.io.InputStreamReader@43d1b8f8) 

Maybe you folks already know what's the problem is, but just to be sure
I'll provide the code of my app here, thanks a lot:

// Most of the code is taken from this really good video
// http://www.vimeo.com/9633556

package com.Connect;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class connect extends Activity {
    /** Called when the activity is first created. */
    // tempuri.Org wird aus der WSDL File genommen.
//  private static final String SOAP_ACTION =
"http://server.contextlayer.bscwi.de/createContext";
//  private static final String SOAP_ACTION = "ClientWS";
    private static final String SOAP_ACTION  = "";
    private static final String METHOD_NAME = "createContext";
    private static final String NAME_SPACE =
"http://server.contextlayer.bscwi.de/";
    // WICHTIG: nicht wsdl File!!
    private static final String URL = "http://10.0.2.2:10360/ContextWS";
    //private static final String URL = "http://10.0.2.2:10360/ContextWSService";
    TextView tv;
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        tv = (TextView) findViewById (R.id.TextView01);
        SoapObject Request = new SoapObject (NAME_SPACE, METHOD_NAME);
       Request.addProperty("arg0", "testSituation");

        SoapSerializationEnvelope soapEnvelope = new
SoapSerializationEnvelope (SoapEnvelope.VER12);
       // soapEnvelope.dotNet = true;
        soapEnvelope.setOutputSoapObject(Request);

        AndroidHttpTransport aht = new AndroidHttpTransport (URL);
        try{
        aht.call(SOAP_ACTION, soapEnvelope);
        Object bla = 
            soapEnvelope.getResponse();
        System.out.println(bla.toString());
        SoapPrimitive resultBoolean = (SoapPrimitive)
soapEnvelope.getResponse();

        // Eigentlich nicht sonderlich viel Anhnung was er bei einem
Boolean ausgibt, naja mal sehen.
        tv.setText("Result: "+ (bla));}
        catch(Exception e){
            e.printStackTrace();
            System.out.println(e);
        }
    }
}

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by Matthias...@googlemail.com on 19 May 2010 at 6:15

GoogleCodeExporter commented 8 years ago
Oh I just thought it might be handy for you to know the WSDL file so here you 
go and
thanks again!

<!--
 Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.6 in JDK 6. 
-->
−
<!--
 Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI
2.1.6 in JDK 6. 
-->
−
<definitions targetNamespace="http://server.contextlayer.bscwi.de/"
name="ContextWSService">
<types/>
<message name="isAlive"/>
−
<message name="isAliveResponse">
<part name="return" type="xsd:boolean"/>
</message>
−
<message name="removeSituation">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
</message>
−
<message name="removeSituationResponse">
<part name="return" type="xsd:boolean"/>
</message>
−
<message name="createContext">
<part name="arg0" type="xsd:string"/>
</message>
−
<message name="createContextResponse">
<part name="return" type="xsd:boolean"/>
</message>
−
<message name="subscribeToSituation">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
<part name="arg3" type="xsd:string"/>
<part name="arg4" type="xsd:string"/>
</message>
<message name="subscribeToSituationResponse"/>
−
<message name="unsubscribeSituation">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
</message>
<message name="unsubscribeSituationResponse"/>
−
<message name="changeConditionState">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:boolean"/>
</message>
<message name="changeConditionStateResponse"/>
−
<message name="getSituationState">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
</message>
−
<message name="getSituationStateResponse">
<part name="return" type="xsd:boolean"/>
</message>
−
<message name="kill">
<part name="arg0" type="xsd:string"/>
</message>
<message name="killResponse"/>
−
<message name="getCausedSituationsByRecipient">
<part name="arg0" type="xsd:string"/>
</message>
−
<message name="getCausedSituationsByRecipientResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getCausedSituationsByTime">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
</message>
−
<message name="getCausedSituationsByTimeResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getContextLayerData">
<part name="arg0" type="xsd:string"/>
</message>
−
<message name="getContextLayerDataResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getSensorLayerData">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
</message>
−
<message name="getSensorLayerDataResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getSensorList">
<part name="arg0" type="xsd:string"/>
</message>
−
<message name="getSensorListResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getOnlineSensorList">
<part name="arg0" type="xsd:string"/>
</message>
−
<message name="getOnlineSensorListResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getCausedConditionsByIp">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
</message>
−
<message name="getCausedConditionsByIpResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getCausedConditionsByRecipient">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
</message>
−
<message name="getCausedConditionsByRecipientResponse">
<part name="return" type="xsd:string"/>
</message>
−
<message name="getCausedConditionsByTime">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
<part name="arg3" type="xsd:string"/>
</message>
−
<message name="getCausedConditionsByTimeResponse">
<part name="return" type="xsd:string"/>
</message>
−
<portType name="ContextWS">
−
<operation name="isAlive">
<input message="tns:isAlive"/>
<output message="tns:isAliveResponse"/>
</operation>
−
<operation name="removeSituation" parameterOrder="arg0 arg1">
<input message="tns:removeSituation"/>
<output message="tns:removeSituationResponse"/>
</operation>
−
<operation name="createContext">
<input message="tns:createContext"/>
<output message="tns:createContextResponse"/>
</operation>
−
<operation name="subscribeToSituation" parameterOrder="arg0 arg1 arg2 arg3 
arg4">
<input message="tns:subscribeToSituation"/>
<output message="tns:subscribeToSituationResponse"/>
</operation>
−
<operation name="unsubscribeSituation" parameterOrder="arg0 arg1 arg2">
<input message="tns:unsubscribeSituation"/>
<output message="tns:unsubscribeSituationResponse"/>
</operation>
−
<operation name="changeConditionState" parameterOrder="arg0 arg1">
<input message="tns:changeConditionState"/>
<output message="tns:changeConditionStateResponse"/>
</operation>
−
<operation name="getSituationState" parameterOrder="arg0 arg1">
<input message="tns:getSituationState"/>
<output message="tns:getSituationStateResponse"/>
</operation>
−
<operation name="kill">
<input message="tns:kill"/>
<output message="tns:killResponse"/>
</operation>
−
<operation name="getCausedSituationsByRecipient">
<input message="tns:getCausedSituationsByRecipient"/>
<output message="tns:getCausedSituationsByRecipientResponse"/>
</operation>
−
<operation name="getCausedSituationsByTime" parameterOrder="arg0 arg1 arg2">
<input message="tns:getCausedSituationsByTime"/>
<output message="tns:getCausedSituationsByTimeResponse"/>
</operation>
−
<operation name="getContextLayerData">
<input message="tns:getContextLayerData"/>
<output message="tns:getContextLayerDataResponse"/>
</operation>
−
<operation name="getSensorLayerData" parameterOrder="arg0 arg1">
<input message="tns:getSensorLayerData"/>
<output message="tns:getSensorLayerDataResponse"/>
</operation>
−
<operation name="getSensorList">
<input message="tns:getSensorList"/>
<output message="tns:getSensorListResponse"/>
</operation>
−
<operation name="getOnlineSensorList">
<input message="tns:getOnlineSensorList"/>
<output message="tns:getOnlineSensorListResponse"/>
</operation>
−
<operation name="getCausedConditionsByIp" parameterOrder="arg0 arg1 arg2">
<input message="tns:getCausedConditionsByIp"/>
<output message="tns:getCausedConditionsByIpResponse"/>
</operation>
−
<operation name="getCausedConditionsByRecipient" parameterOrder="arg0 arg1">
<input message="tns:getCausedConditionsByRecipient"/>
<output message="tns:getCausedConditionsByRecipientResponse"/>
</operation>
−
<operation name="getCausedConditionsByTime" parameterOrder="arg0 arg1 arg2 
arg3">
<input message="tns:getCausedConditionsByTime"/>
<output message="tns:getCausedConditionsByTimeResponse"/>
</operation>
</portType>
−
<binding name="ContextWSPortBinding" type="tns:ContextWS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
−
<operation name="isAlive">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="removeSituation">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="createContext">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="subscribeToSituation">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="unsubscribeSituation">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="changeConditionState">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getSituationState">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="kill">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getCausedSituationsByRecipient">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getCausedSituationsByTime">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getContextLayerData">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getSensorLayerData">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getSensorList">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getOnlineSensorList">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getCausedConditionsByIp">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getCausedConditionsByRecipient">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
−
<operation name="getCausedConditionsByTime">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</input>
−
<output>
<soap:body use="literal" namespace="http://server.contextlayer.bscwi.de/"/>
</output>
</operation>
</binding>
−
<service name="ContextWSService">
−
<port name="ContextWSPort" binding="tns:ContextWSPortBinding">
<soap:address location="http://127.0.0.1:10360/ContextService"/>
</port>
</service>
</definitions>

Original comment by Matthias...@googlemail.com on 19 May 2010 at 10:36

GoogleCodeExporter commented 8 years ago
Hey I guess I solved the problem by entering the correct URL, which can be 
found in
the WSDL under <soap:address location="...."> or actually just 4 lines above 
this
post =). 
Still I'm getting some errors but to keep this thread tidy I decided to create 
a new
thread.
http://code.google.com/p/ksoap2-android/issues/detail?id=21

Thanks Folks!

Original comment by Matthias...@googlemail.com on 24 May 2010 at 10:10

GoogleCodeExporter commented 8 years ago
Submitter fixed himself.

Original comment by mosa...@gmail.com on 12 Oct 2010 at 5:28