Wednesday, July 27, 2011

[android-developers] WSDL+KSOAP2 WITHOUT PASSING ANY PARAMETER

Hi ,I am begginer in Web service.I developing app using ksoap2 jar
file.In my project i have add ksoap2 2.5.7 jar file.In my app user
does not pass any parameter.He is directly retrive all the data.When
im run my code the it get a error which is shown below & i am giveing
my code please see where i am wrong.


SoapFault-faultcode:'a:InternalServiceFault'faultstring:'The server
was unable tp process the request due to an internal error.For more
information about the error,either turn on
IncludeExceptionDetailInFault(either from ServiceBehavior Attribute or
from the <serviceDebug> configuration behavior) on the server in order
to send the exception information back to the client,ot turn on
tracing as per the Microsoft .NET Framework 3.0 SDK documntation &
inspect the server trace logs.' faultactor:'null' detail:null

import java.io.IOException;
import java.util.Vector;

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 org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

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

public class window extends Activity {
private static final String SOAP_ACTION = " http://xxxxxxxxxxxxxxxxxxxxxxxce/GetBollywoodPulse";
private static final String METHOD_NAME = "GetBollywoodPulse";
private static final String NAMESPACE = "http://
sesxxxxxxxxxxxxxxxxxxceModel";

private static final String URL = "http://xxxxxxxxxxxxxxupService.svc?
wsdl";
TextView tx_first,tx_second;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tx_first=(TextView)findViewById(R.id.tx_bt);
tx_second=(TextView)findViewById(R.id.tx_gh);
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope soapEnvelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(Request);
HttpTransportSE aht = new HttpTransportSE(URL);
try
{

aht.call(SOAP_ACTION, soapEnvelope);

/* SoapObject result = (SoapObject)soapEnvelope.bodyIn;

if(result != null){

TextView t =
(TextView)this.findViewById(R.id.tx_bt);

//Get the first property and change the label text

t.setText("SOAP response:\n\n" +
result.getProperty(0).toString()); */
SoapPrimitive resultsRequestSOAP = (SoapPrimitive)
soapEnvelope.getResponse();
tx_first.setText(resultsRequestSOAP.toString());


}catch (Exception e)
{
tx_first.setText("ews"+e);
}
}
}

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment