how to send string array in soap request to webservice
i cant send my request to webservice.
string array not accept and show error to me.
i want to send array string in soap request but show error to me.
my webservice:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
Send one SMS.
Send one SMS to many.
Check SMS delivery status.
Verify sms validity when you receive an sms
Get account info.
Change account password.
Change traffic relay.
my code:
public String sendToMany(String username,String password,Category to,String msg,String from,Long time){
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.implicitTypes = true;
soapEnvelope.dotNet = true;
SoapObject soapReq = new SoapObject("urn:HostIranSmsWebService","sendToMany");
soapReq.addProperty("username",username);
soapReq.addProperty("password",password);
soapEnvelope.addMapping("urn:HostIranSmsWebService","to",new Category().getClass());
soapReq.addProperty("to",to);
soapReq.addProperty("msg",msg);
soapReq.addProperty("from",from);
soapReq.addProperty("time",time);
soapEnvelope.setOutputSoapObject(soapReq);
HttpTransportSE httpTransport = new HttpTransportSE(url);
try{
httpTransport.call("urn:HostIranSmsWebService/sendToMany", soapEnvelope);
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
public class Category extends Vector implements KvmSerializable
{
/**
*
*/
private static final long serialVersionUID = -1166006770093411055L;
@Override
public Object getProperty(int arg0) {
return this.get(arg0);
}
@Override
public int getPropertyCount() {
return this.size();
}
@Override
public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
arg2.name = "string";
arg2.type = PropertyInfo.STRING_CLASS;
}
@Override
public void setProperty(int arg0, Object arg1) {
this.add(arg1.toString());
}
}
my request code:
Category to =new Category();
to.add("1111111111");
to.add("2222222222");
to.add("3333333333");
String res = sendToMany("user1", "pass1", to, "hi", "",Long.valueOf(0));
error in eclipse:
11-14 16:19:51.317: D/msg(681): org.xmlpull.v1.XmlPullParserException: expected: END_TAG {http://schemas.xmlsoap.org/soap/envelope/}Body (position:END_TAG {http://schemas.xmlsoap.org/soap/envelope/}SOAP-ENV:Fault>@2:199 in java.io.InputStreamReader@44c28540)
Can someone help me where is the problem?