[android-developers] Problem on getting SOAP response

2010-03-24 Thread Prasanjit Deka
While connecting to web service i am getting an Exception:
SoapFault - faultcode: 'soap:Client' faultstring:
'System.Web.Services.Protocols.SoapException: Server did not recognize the
value of HTTP Header SOAPAction:
http://115.108.40.174/hionstockws/GetHomePageRecos.

Here the code is
Please help me out...


private static final String SOAP_ACTION = 
http://115.108.40.174/hionstockws/GetHomePageRecos;;
private static final String METHOD_NAME = GetHomePageRecos;
private static final String NAMESPACE = 
http://115.108.40.174/hionstocks/;;
private static final String URL = 
http://115.108.40.174/hionstockws/service1.asmx;;

// private Object resultRequestSOAP = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Log.i(Comies, im the lay);
try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
Log.i(Comies, request.getName());
// Add Property
request.addProperty(country, 1);
request.addProperty(recordPerPage, 1);
request.addProperty(pageNumber, 5);

/**
 * String ip = 193.99.144.80; PropertyInfo ipaddress = new
 * PropertyInfo(); ipaddress.setName(IPAddress);
 * ipaddress.setValue(ip); request.addProperty(ipaddress);
 **/
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(
SoapEnvelope.VER11);
// .Net
envelope.dotNet = true;

envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
// XML Version Tag
androidHttpTransport
.setXmlVersionTag(?xml version=\1.0\
encoding=\UTF-8\?);

SoapObject result = (SoapObject) envelope.getResponse();

// Get the Header and Body of the Request and Response
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyOut;
SoapObject resultsResponseSOAP = (SoapObject) envelope.bodyIn;
Log.i(Envelope Request: , resultsRequestSOAP.toString());
Log.i(Envelope Response:, resultsResponseSOAP.toString());


Exception:SoapFault - faultcode: 'soap:Client' faultstring:
'System.Web.Services.Protocols.SoapException: Server did not recognize the
value of HTTP Header SOAPAction:
http://115.108.40.174/hionstockws/GetHomePageRecos.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Problem on getting SOAP response

2010-03-22 Thread Prasanjit Deka
I want to call the webservice method ,where have to pass the three parameter
.

But on soap response i am getting a Exception called as System web service
Protocols SOAP exception server did no get response And faultcode   soap
client  faultstring

here the code is

public class Main extends Activity {
private static final String SOAP_ACTION = 
http://115.108.40.174/hionstockws/service1.asmx/GetHomePageRecos;;
private static final String METHOD_NAME = GetHomePageRecos;
private static final String NAMESPACE = 
http://115.108.40.174/hionstockws;;
private static final String URL = 
http://115.108.40.174/hionstockws/service1.asmx;;
private Object resultRequestSOAP = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
setContentView(tv);

Log.i(Comies,im the lay);
try{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
Log.i(Comies,request.getName());
// Add Property
request.addProperty(vcountry, 1);
request.addProperty(vrecorPerPage, 5);
request.addProperty(vrpageNo, 1);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
// .Net
envelope.dotNet = true;

envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);

resultRequestSOAP =  envelope.getResponse();
String[] results = (String[])  resultRequestSOAP;
Log.i(Result,results.toString());


tv.setText( results[0]);
// Display Results in log (adb.exe logcat)
  }
catch(Exception e){
e.printStackTrace();
}
}
}

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.