digitaldrew
Well-known member
- Joined
- Nov 10, 2012
- Messages
- 167
- Programming Experience
- Beginner
I'm trying to create a new user contact using XML-RPC (the the xml-rpc.net library), but I seam to be having an issue with my structure (I think..)
First, this is what I'm working with:
and the parameters:
Now, here is what I have in my code:
Finally, this is the error I continue to receive..
Error: response contains struct value where string expected (as type String) [response]
I can't see where I'm going wrong here..Any help/input would be greatly appriciated!
First, this is what I'm working with:
and the parameters:
Now, here is what I have in my code:
VB.NET:
Imports CookComputing.XmlRpc
Public Structure gandiContactDetails
Public city As String
Public country As String
Public email As String
Public family As String
Public given As String
Public password As String
Public phone As String
Public streetaddr As String
Public type As String
End Structure
Public Interface createContact
<CookComputing.XmlRpc.XmlRpcMethod("contact.create")> _
Function GandiContact(ByVal apikey As String, ByVal params As gandiContactDetails) As String
End Interface
Public Class Form1
Public clientProtocol As XmlRpcClientProtocol
Public createcontacts As createContact
Private Sub btnCreateContact_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreateContact.Click
'=========== Some inputboxes here to get the required details. ===========
Dim Parameters As gandiContactDetails
Parameters.city = gandicity
Parameters.country = gandicountry
Parameters.email = gandiemail
Parameters.family = gandifamily
Parameters.given = gandigiven
Parameters.password = gandipassword
Parameters.phone = gandiphone
Parameters.streetaddr = gandistreetaddr
Parameters.type = "0"
createcontacts = CType(XmlRpcProxyGen.Create(GetType(createContact)), createContact)
clientProtocol = CType(createcontacts, XmlRpcClientProtocol)
clientProtocol.Url = "https://rpc.websitehere.net/xmlrpc/"
Dim response As String
response = ""
Try
response = createcontacts.GandiContact(txtGandiApiKey.Text, Parameters)
MsgBox(response)
Catch ex As Exception
MsgBox("Error: " & ex.Message)
End Try
End Sub
End Class
Finally, this is the error I continue to receive..
Error: response contains struct value where string expected (as type String) [response]
I can't see where I'm going wrong here..Any help/input would be greatly appriciated!