Это можно сделать, создав различные объекты SoapObject для соответствующего узла, поэтому, как и в приведенной выше задаче, нам нужно создать два объекта мыла, один для группы, а другой для GroupMembers.
весь код
public static String sendGroupMessageNotification(ArrayList<String>
groupIdList,ArrayList<String> members,String senderId,String messageText,boolean isUrgentFlag)
{
SOAP_ACTION = "http://tempuri.org/SendGroupMessageNotification";
METHOD_NAME = "SendGroupMessageNotification";
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat formatter= new SimpleDateFormat("yyyy/MMM/dd HH:mm:ss");
String dateNow = formatter.format(currentDate.getTime());
SoapObject myObject = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject groupSoap=new SoapObject(NAMESPACE,METHOD_NAME);
SoapObject groupMembers=new SoapObject(NAMESPACE,METHOD_NAME);
groupSoap.addProperty("groupid","1");
groupMembers.addProperty("Id","29");
groupMembers.addProperty("Id","36");
groupSoap.addProperty("groupMembers",groupMembers);
PropertyInfo receiverMemberid = new PropertyInfo();
receiverMemberid.setName("reciverMemberId");
receiverMemberid.setValue(groupSoap);
receiverMemberid.setType(groupSoap.getClass());
myObject.addProperty(receiverMemberid);
PropertyInfo memberId=new PropertyInfo();
memberId.setName("MemberId");
memberId.setValue(Integer.parseInt(senderId));
memberId.setType(PropertyInfo.INTEGER_CLASS);
myObject.addProperty(memberId);
PropertyInfo message=new PropertyInfo();
message.setName("MESSAGE");
message.setValue(messageText);
message.setType(PropertyInfo.STRING_CLASS);
myObject.addProperty(message);
PropertyInfo createDate=new PropertyInfo();
createDate.setName("CREATEDDATE");
createDate.setValue(dateNow);
createDate.setType(PropertyInfo.STRING_CLASS);
myObject.addProperty(createDate);
PropertyInfo isUrgent=new PropertyInfo();
isUrgent.setName("isUrent");
isUrgent.setValue(isUrgentFlag);
isUrgent.setType(PropertyInfo.BOOLEAN_CLASS);
myObject.addProperty(isUrgent);
PropertyInfo predifMessage=new PropertyInfo();
predifMessage.setName("Predifnemessage");
predifMessage.setValue("Hello");
predifMessage.setType(PropertyInfo.STRING_CLASS);
myObject.addProperty(predifMessage);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(myObject);
HttpTransportSE transport = new HttpTransportSE(URL);
try
{
transport.call(SOAP_ACTION, envelope);
}
catch (IOException ex)
{
Logger.getLogger(SoapWebServices.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
catch (XmlPullParserException ex)
{
Logger.getLogger(SoapWebServices.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
try
{
SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
return result.toString();
}
catch (SoapFault ex)
{
Logger.getLogger(SoapWebServices.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
Хорошо, если у кого-то есть проблемы, дайте мне знать