[android-developers] Re: Problem on getting SOAP response

2010-03-24 Thread Bob Kerns
Your server is telling you the problem -- you have the wrong value for
SOAP_ACTION.

It's likely that the correct value is . SOAPAction is similar in
intent to METHOD_NAME. It is not a URL; it does not have to have a
protocol and hostname,. But if you're supplying the method in the body
of the request, it's likely that the server is configured with the
SOAPAction being .

On Mar 24, 12:29 am, Prasanjit Deka prasanjitd...@gmail.com wrote:
 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.


Re: [android-developers] Re: Problem on getting SOAP response

2010-03-24 Thread Prasanjit Deka
Thanks a lot for ur reply,

I want to ask u one more doubt,

I got a envelope response in a String ,
The structure of String is like that.

03-24 17:36:52.588: INFO/R1(216):
anyType{schema=anyType{element=anyType{complexType=anyType{choice=anyType{element=anyType{complexType=anyType{sequence=anyType{element=anyType{};
element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{};
element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{};
element=anyType{}; element=anyType{}; element=anyType{}; element=anyType{};
element=anyType{}; }; }; };
element=anyType{complexType=anyType{sequence=anyType{element=anyType{}; };
}; }; }; }; }; }; *diffgram*=anyType{NewDataSet=anyType{*Table*=anyType{*
predictionMessage*=ADRX; *predictionPostDate*=Mar  8 2010 ; *RecoPrice*=Rs.
0.00; *TargetPrice*=Rs.  55.95; *CurrentPrice*=Rs.  0.00; *feedId*=134; *
feedType*=2; *userId*=46; *loginName*=username; *feedName*=username BEST
IDEAS; feedTypeName=Short Term(Weekly); predictionExpDate=Mar 14 2010 ;
rank=0; Row=1; }; Table=anyType{predictionMessage=ADRX;
predictionPostDate=Mar  8 2010 ; RecoPrice=Rs.  0.00; TargetPrice=Rs.
55.95; CurrentPrice=Rs.  0.00; feedId=134; feedType=2; userId=46;
loginName=username; feedName=username BEST IDEAS; feedTypeName=Short
Term(Weekly); predictionExpDate=Mar 14 2010 ; rank=0; Row=2; };
*Table*=anyType{predictionMessage=ADRX;
predictionPostDate=Mar  8 2010 ; RecoPrice=Rs.  0.00; TargetPrice=Rs.
55.95; CurrentPrice=Rs.  0.00; feedId=134; feedType=2; userId=46;
loginName=username; feedName=username BEST IDEAS; feedTypeName=Short
Term(Weekly); predictionExpDate=Mar 14 2010 ; rank=0; Row=3; };
*Table*=anyType{predictionMessage=ADRX;
predictionPostDate=Mar  8 2010 ; RecoPrice=Rs.  0.00; TargetPrice=Rs.
55.95; CurrentPrice=Rs.  0.00; feedId=134; feedType=2; userId=46;
loginName=username; feedName=username BEST IDEAS; feedTypeName=Short
Term(Weekly); predictionExpDate=Mar 14 2010 ; rank=0; Row=4; };*
Table*=anyType{predictionMessage=ADRX;
predictionPostDate=Mar  8 2010 ; RecoPrice=Rs.  0.00; TargetPrice=Rs.
55.95; CurrentPrice=Rs.  0.00; feedId=134; feedType=2; userId=46;
loginName=username; feedName=username BEST IDEAS; feedTypeName=Short
Term(Weekly); predictionExpDate=Mar 14 2010 ; rank=0; Row=5; }; }; }; }

So this is nothing but a String which produce by XML, so how do i parse it
and diaplay all the data in the mobile screen.
In the above String ,records are present in Table tag, So please help me out
on this

Here all the table tag having the records of data , should i have split it
by java program ? or there some methods are there to parse the attribute
element SOAp object.








On Wed, Mar 24, 2010 at 5:36 PM, Bob Kerns r...@acm.org wrote:

 Your server is telling you the problem -- you have the wrong value for
 SOAP_ACTION.

 It's likely that the correct value is . SOAPAction is similar in
 intent to METHOD_NAME. It is not a URL; it does not have to have a
 protocol and hostname,. But if you're supplying the method in the body
 of the request, it's likely that the server is configured with the
 SOAPAction being .

 On Mar 24, 12:29 am, Prasanjit Deka prasanjitd...@gmail.com wrote:
  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);