3

I want to know how to apply SOAP-Request parameter in the android source.

example...

Q1. Is this right ? (<--)

private static final String SOAP_ACTION = "           "; <-- ???
private static final String METHOD_NAME = "GetStationStats "; <-- Is this right?
private static final String NAMESPACE = " http://cisco/mse/location"; <-- Is this right?
private static final String URL = "https://192.168.100.231/location"; <-- Is this right?

Q2. change from Soap-xml

<AesBusinessSession id="10510"/>      
<AesMobileStation macAddress="00:01:02:03:04:05"/> 

=> to android source

request.addProperty("AesBusinessSession id" ,10510);    <-- Is this right?
request.addProperty("AesMobileStation macAddress" ,00:01:02:03:04:05);    <-- Is this right?

this is my souce.

private void soapData(String searchData) {
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);        
Log.e("dd", "Soap Created");        
SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);        
envelope.dotNet=true;        
envelope.setOutputSoapObject(request);
request.addProperty("SQL" ,searchData);
HttpTransportSE androidHttpTransport=new HttpTransportSE(URL);
androidHttpTransport.debug = true;
 try       
{            
   androidHttpTransport.call(SOAP_ACTION, envelope);           
   SoapPrimitive result = (SoapPrimitive)envelope.getResponse();            //String result1 = xmlPasing(result.toString()); //xml파싱           
   String re_xml = result.toString();            
   outPut.setText(re_xml); //결과값 출력       
} 
catch(Exception e)       
{           
   Log.e("dd", "Soap Catch",e);            
   e.printStackTrace();       
} //try-catch    
}

==================================================== Example METHOD: GetStationStats

Returns an AesMobileStation statistics record currently stored in the MSE based on various search criteria. Result: An AesBaseStats object or null if not found Arguments: AesBusinessSession, AesMobileStation Key

7.3.1 SOAP Request

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">   
<SOAP-ENV:Body>    
<GetStationStats xmlns=” http://cisco.com/mse/location”>       
<AesBusinessSession id="10510"/>      
<AesMobileStation macAddress="00:01:02:03:04:05"/>     
</GetStationStats>   
</SOAP-ENV:Body>
 </SOAP-ENV:Envelope> 

7.3.2 SOAP Response 7.3.2.1 Success

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">   
<SOAP-ENV:Body>    
<Response xmlns=” http://cisco.com/mse/location”>       
<AesBaseStats  macAddress="00:01:02:03:04:05" packetsSent=”12” bytesSent=”1221111” packetsRecv=”1111” bytesRecv=”1212204” policyErrors=”0” changedOn=”1220324324”/>    
</Response>  
</SOAP-ENV:Body>
</SOAP-ENV:Envelope> 

============================================================

1 Answers1

0

SOAP_ACTION - you can see it in wsdl, probably smth like that: "http://cisco/mse/location/GetStationStats". METHOD_NAME and NAMESPACE seems to be correct. URL - service url, i don't know wether it is correct. You can see it in wsdl also.

request.addProperty("AesBusinessSession id" ,10510);
request.addProperty("AesMobileStation macAddress" ,00:01:02:03:04:05);

It's wrong (output will be like: <AesBusinessSession id>10510</AesBusinessSession id>. You can use SoapObject or SoapPrimitive for adding attributes:

SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject aesBusinessSession = new SoapObject(NAMESPACE, "AesBusinessSession");
aesBusinessSession.addAttribute("id",10510); 
SoapObject aesBaseStats = new SoapObject(NAMESPACE, "AesBaseStats");  
...//add attrs to aesBaseStats 
request.addSoapObject(aesBusinessSession);
request.addSoapObject(aesBaseStats);
esentsov
  • 6,372
  • 21
  • 28