GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
How to send an array of objects to a Webservice ?
How to send an array of objects to a Webservice ?
Iniciado por Ntt68, set., 01 2015 9:15 AM - 2 respostas
Conecte-se…
Ntt68
#1
Membro registado
104 mensagems
Popularité : +1 (1 vote)
Publicado em setembro, 01 2015 - 9:15 AM
My Webservice is expecting an array of strings but I'm unable to pass the array to my Webservcice using WM20.
Here's the declaration of the array:
<s:element name="StopOpname">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Authentication" nillable="true" type="tns:Authentication"/>
<s:element minOccurs="1" maxOccurs="1" name="Opname" nillable="true" type="tns:OpnameMainData"/>
<s:element minOccurs="0" maxOccurs="1" name="Wagons" type="tns:ArrayOfString2"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfString2">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Wagon" nillable="true" type="s:string"/>
</s:sequence>
</s:complexType>
So element "Wagons" should contain an array of 'wagon'
but I'm unable to assign an array of strings to the webservice:
arr_Wagons is Array of strings
results is a RFWS.StopOpnameResponse
params is a RFWS.StopOpname
params.Wagons = arr_Wagons
results = RFWS.StopOpname(params)
WM throws an exception at line 5 (params.Wagons = arr_Wagons). WM is saying the variable params.Wagons is not a subscripted element. How can I solve this kind of problem ? Please help
Denunciar
0
0
KJVA
#2
Publicado em setembro, 01 2015 - 9:57 AM
I wrote a webservice in java that sends a List<String> result = new ArrayList<String>() to my andorid app;
in WM I process it as follows:
v
1 is wsKAMapp.getListOfMeldingTypes
v
2 is wsKAMapp.getListOfMeldingTypesResponse
v
2
=
wsKAMapp.getListOfMeldingTypes
(
v
1
)
FOR
...
...
n
ID is
int
=
v
2.return
[i]
s
Type is
string
=
v
2.return
[
i
+
1
]
END
don't know how it's the other way around
Denunciar
0
0
Ntt68
#3
Publicado em setembro, 07 2015 - 10:47 AM
I've just found the solution, the array of 'Wagon' (instead of 'Wagons')
IF garr_Wagons..Occurrence > 0 THEN
params is a RFWS.StopOpname
results is a RFWS.StopOpnameResponse
FOR i=1 TO garr_Wagons..Occurrence
params.Wagons.Wagon[i] = garr_Wagons[i]
END
results = RFWS.StopOpname(params)
END
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto