Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

webservice e parametri input

13 views
Skip to first unread message

Mariarita Costanza

unread,
Jun 5, 2009, 11:23:25 AM6/5/09
to
Salve a tutti,
avrei un problemino con un webservice: sto realizzando un client per un
webservice e lo sto facendo in vb.net. Ho aggiunto il riferimento web al
progetto, mi sono scaricata il file wsdl.
Quando chiamo per� un metodo che vuole due parametri in ingresso, mi viene
un errore prima ancora di chiamarlo, proprio nell'istruzione di chiamata del
metodo.
Questo � il metodo estratto dal file wsdl:

<xs:element name="getNuoveNotifiche">
<xs:complexType>
<xs:sequence>
<xs:element name="pid" nillable="true" type="xs:string" />
<xs:element name="pwd" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>

e questo � il mio codice che richiama il metodo

Dim RichiestaNotifiche As New WebReference.Elenco_Notifiche
Dim PID As String
Dim Password As String
Dim dsResults As DataSet

dsResults = RichiestaNotifiche.getNuoveNotifiche(PID, Password)

mi sottolinea PID e password e se passo su col mouse mi dice "Impossibile
convertire il valore di tipo string in GetNuoveNotifiche"

Qualcuno pu� aiutarmi?

grazie mille

mary


Riddler ?

unread,
Jun 8, 2009, 6:05:09 PM6/8/09
to
On 5 Giu, 17:23, "Mariarita Costanza" <mariarita.costa...@macnil.it>
wrote:
Ciao Mariarita,

> avrei un problemino con un webservice: sto realizzando un client per un
> webservice e lo sto facendo in vb.net. Ho aggiunto il riferimento web al
> progetto, mi sono scaricata il file wsdl.

> Quando chiamo però un metodo che vuole due parametri in ingresso, mi viene


> un errore prima ancora di chiamarlo, proprio nell'istruzione di chiamata del
> metodo.

> Questo è il metodo estratto dal file wsdl:


>
>       <xs:element name="getNuoveNotifiche">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="pid" nillable="true" type="xs:string" />
>             <xs:element name="pwd" nillable="true" type="xs:string" />
>           </xs:sequence>
>         </xs:complexType>
>       </xs:element>
>

> e questo è il mio codice che richiama il metodo


>
>         Dim RichiestaNotifiche As New WebReference.Elenco_Notifiche
>         Dim PID As String
>         Dim Password As String
>         Dim dsResults As DataSet
>
>         dsResults = RichiestaNotifiche.getNuoveNotifiche(PID, Password)
>
> mi sottolinea PID e password e se passo su col mouse mi dice "Impossibile
> convertire il valore di tipo string in GetNuoveNotifiche"
>

NON sono molto pratico di vb.net, ma la teoria dovrebbe essere sempre
la stessa ;-)
Dal progetto aggiungi la referenza al webservice chiamandola per
esempio my_WS

Quando vuoi utilizzarne un metodo:

my_WS.NomeClasseService WS = new my_WS.NomeClasseService(); //
WebService
//uso il metodo
WS.metodo(parametri)

Quindi nel tuo caso se non ho capito male protresti provare così:
instanzi il webservice e richiami il suo metodo
Dim WS As New WebReference


Dim PID As String
Dim Password As String
Dim dsResults As DataSet

dsResults = WS.getNuoveNotifiche(PID, Password)

spero di aver fornito qualcosa di utile ;-)

saluti

--
Riddler ?

0 new messages