Thanks very much Codebear !!!

I did it and i can see this:


********************************************************************************
********************************************************************************
REQUEST

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
xmlns:d="http://www.w3.org/2001/XMLSchema"; xmlns:c="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://
schemas.xmlsoap.org/soap/envelope/"><v:Header /
><v:Body><GetDataUsingDataContract xmlns="http://tempuri.org/"; id="o0"
c:root="1"><composite i:type="n0:CompositeType" xmlns:n0="http://
schemas.datacontract.org/2004/07/TicketoWS"><BoolValue
i:type="d:boolean">true</BoolValue><StringValue
i:type="d:string">Probando</StringValue></composite></
GetDataUsingDataContract></v:Body></v:Envelope>
********************************************************************************
********************************************************************************


********************************************************************************
********************************************************************************
RESPONSE

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/
envelope/"><s:Body><GetDataUsingDataContractResponse xmlns="http://
tempuri.org/"><GetDataUsingDataContractResult xmlns:a="http://
schemas.datacontract.org/2004/07/TicketoWS" xmlns:i="http://www.w3.org/
2001/XMLSchema-instance"><a:BoolValue>false</
a:BoolValue><a:StringValue>data from server</a:StringValue></
GetDataUsingDataContractResult></GetDataUsingDataContractResponse></
s:Body></s:Envelope>

********************************************************************************
********************************************************************************

In the response, in the text "data from server" must be more text...
The method in the server is this:


        public CompositeType GetDataUsingDataContract(CompositeType
composite)
        {

            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }


            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }

            composite.StringValue = "data from server";
            return composite;
        }


Sincerely... i dont know what happens.. :S

Thanks for your time.


On 16 ene, 17:01, codebear <tfob...@gmail.com> wrote:
> While I cant speak to what is exactly wrong, try putting
> androidHttpTransport.debug = true. then after you make the
> androidHttpTransport.call() you can see responseDump and requestDump
> which contains the xml that is sent and recieved from the call. You
> can then compare it with the expected input... also I have heard there
> is a program that will help see what the request should look like.
> Maybe someone knows the name of the app im talking about?
>
> On Jan 13, 6:30 am, chankly <carlito.he...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi guys !!!
>
> > First... i'm sorry for my english... i am spanish, sorry.
>
> > I have a strange problem with my comunications.
>
> > I send a complex type from android to my service and i have anything
> > problem. All OK.
>
> > My service wcf recived the object, but... the properties is empty !!
>
> > however, my service update the properties and return to the client
> > which recived correctly the object with the values properties OK.
>
> > Please... can you help me??
>
> > My client code is this:
>
> > *************************
> > METHOD ACTIVITY WHICH CALL WEBSERVICE
> > *************************
> > private class LaunchWebService extends AsyncTask<String, String,
> > Integer>
> >     {
>
> >                 @Override
> >                 protected Integer doInBackground(String... params)
> >                 {
>
> >                 try
> >                 {
>
> >                         SoapObject request = new SoapObject(NAMESPACE, 
> > METHOD_NAME);
>
> >                         //*** OBJECT ***
> >                         CompositeType objComposite = new CompositeType();
> >                         objComposite.setProperty(0, true); //This arrive 
> > false.
> >                         objComposite.setProperty(1, "this arrive null");
>
> >                         //*** ADD NEW PROPERTY TO ENVELOPE WITH THE OBJECT 
> > ***
> >                         PropertyInfo objParameter = new PropertyInfo();
> >                         
> > objParameter.setName("http://schemas.xmlsoap.org/soap/
> > envelope/");
> >                         objParameter.setName("composite");
> >                         objParameter.setValue(objComposite);
> >                         objParameter.setType(CompositeType.class);
>
> >                         request.addProperty(objParameter);
>
> >                         SoapSerializationEnvelope envelope = new
> > SoapSerializationEnvelope(SoapEnvelope.VER11);
> >                         envelope.dotNet = true;
> >                         envelope.setOutputSoapObject(request);
> >                         envelope.addMapping(NAMESPACE_CONTRACT, 
> > "CompositeType",
> > CompositeType.class);
>
> >                         HttpTransportSE androidHttpTransport = new
> > HttpTransportSE(URL);
> >                         androidHttpTransport.call(SOAP_ACTION, envelope);
>
> >                         SoapObject response = 
> > (SoapObject)envelope.getResponse();
> >                         String txt = 
> > response.getProperty("StringValue").toString();
>
> >                     publishProgress(txt);
>
> >                     return 1;
> >                 }
> >                 catch(SoapFault exSoap)
> >                 {
>
> >                         exSoap.printStackTrace();
>
> >                         publishProgress(exSoap.getMessage());
>
> >                         return -1;
> >                 }
> >                 catch(Exception ex)
> >                         {
>
> >                         ex.printStackTrace();
>
> >                         publishProgress(ex.getMessage());
>
> >                         return -1;
> >                         }
> >                 }
>
> > *************************
> > COMPLEX TYPE DEFINITION
> > *************************
> > public class CompositeType implements KvmSerializable{
>
> > public static final int STRING_VALUE = 1;
> > public static final int BOOLEAN_VALUE = 0;
>
> > public String StringValue;
> > public Boolean BoolValue;
>
> > public CompositeType() {
>
> > }
>
> > @Override
> > public String toString() {
> >     return "StringValue = " + StringValue + ", BoolValue = " +
> > BoolValue.toString();
>
> > }
>
> > @Override
> > public Object getProperty(int arg0) {
> >     switch(arg0)
> >     {
> >     case STRING_VALUE:
> >         return StringValue;
> >     case BOOLEAN_VALUE:
> >         return BoolValue;
> >     }
>
> >     return null;
>
> > }
>
> > @Override
> > public int getPropertyCount() {
> >     return 2;
>
> > }
>
> > @Override
> > public void getPropertyInfo(int index, @SuppressWarnings("rawtypes")
> > Hashtable arg1, PropertyInfo info) {
> >     switch(index)
> >     {
> >     case STRING_VALUE:
> >         info.type = PropertyInfo.STRING_CLASS;
> >         info.name = "StringValue";
> >         break;
> >     case BOOLEAN_VALUE:
> >         info.type = PropertyInfo.BOOLEAN_CLASS;
> >         info.name = "BoolValue";
> >         break;
> >     default:break;
> >     }
>
> > }
>
> > @Override
> > public void setProperty(int index, Object value) {
> >     switch(index)
> >     {
> >     case STRING_VALUE:
> >         StringValue = value.toString();
> >         break;
> >     case BOOLEAN_VALUE:
> >         BoolValue = Boolean.parseBoolean(value.toString());
> >         break;
> >     default:
> >         break;
> >     }
>
> > }
> > }- Hide quoted text -
>
> > - Show quoted text -

-- 
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

Reply via email to