este é o elemento no qual eu devo enviar meu array e nao estou obtendo sucesso!
<s:element minOccurs="0" maxOccurs="1" name="listString" type="tns:ArrayOfString"/>
WSDL:
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/"xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
JAVA:
@Override
public Object getProperty(int index)
{
Object object = null;
switch (index)
{
case 2:
{
object = this.nrpedido;
break;
}
case 1:
{
object = this.vlrpedido;
break;
}
case 0:
{
object = listString;
break;
}
}
return object;
}
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#getPropertyCount()
*/
@Override
public int getPropertyCount()
{
// TODO Auto-generated method stub
return 3;
}
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#
* getPropertyInfo(int, java.util.Hashtable,
* org.ksoap2.serialization.PropertyInfo)
*/
@Override
public void getPropertyInfo(int index, Hashtable arg1,
PropertyInfo propertyInfo)
{
// TODO Auto-generated method stub
Log.i(" START CHECKING", "INDEX:"+ index + " -- " + propertyInfo.getName() + "/" + propertyInfo.getType() + "/" + propertyInfo.getClass() + "/" + propertyInfo.getNamespace() + "/" + propertyInfo.getElementType());
switch (index)
{
case 2:
{
propertyInfo.name = "nrpedido";
propertyInfo.type = PropertyInfo.STRING_CLASS;
break;
}
case 1:
{
propertyInfo.name = "vlrpedido";
propertyInfo.type = Double.class;
break;
}
case 0:
{
propertyInfo.name = "listString";
propertyInfo.type = "ArrayOfString";
break;
}
}
Log.i(" END CHECKING", "INDEX:"+ index + " -- " + propertyInfo.getName() + "/" + propertyInfo.getType() + "/" + propertyInfo.getClass() + "/" + propertyInfo.getNamespace() + "/" + propertyInfo.getElementType());
}
/* (non-Javadoc)
* @see org.ksoap2.serialization.KvmSerializable#setProperty
* (int, java.lang.Object)
*/
@Override
public void setProperty(int index, Object obj)
{
// TODO Auto-generated method stub
switch (index)
{
case 0:
{
this.nrpedido = Long.parseLong(obj.toString());
break;
}
case 1:
{
this.vlrpedido = Double.parseDouble(obj.toString());
break;
}
case 2:
{
this.listString = (Vector<String>) obj;
break;
}
}
}
}
Em 23/10/11 16:34, Diego Ampessan escreveu:
Poste o código fazendo o favor.
Em 23 de outubro de 2011 16:30, Andrei Silva <andreissf@gmail.com> escreveu:
esta serializando mas não estou conseguindo capturar este array no WS!
talvez seja na hora de setar o PropertyInfo que seria do tipo ArrayOfString
Em 23/10/11 14:53, Diego Ampessan escreveu:Andrei,
O que exatamente você não consegue ??
Como está implementando seu WebService ? ta usando WCF ?
Em 22 de outubro de 2011 21:28, Andrei Silva <andreissf@gmail.com> escreveu:
Pessoal, estou com um problema para enviar um array de objtos para um webservice em dotnet;
alguem teria um exemplo para me conseguir ou uma boa dica, site, tutorial??
Obrigado
--
Att.Diego AmpessanMicrosoft MTA
www.diegoampessan.com.br
Os computadores são incrivelmente rápidos, precisos e burros; Os homens são incrivelmente lentos, imprecisos e brilhantes; Juntos, seu poder ultrapassa os limites da imaginação - "Albert Einstein "
--
Att.Diego AmpessanMicrosoft MTA
www.diegoampessan.com.br
Os computadores são incrivelmente rápidos, precisos e burros; Os homens são incrivelmente lentos, imprecisos e brilhantes; Juntos, seu poder ultrapassa os limites da imaginação - "Albert Einstein "






0 comentários:
Postar um comentário