views:

321

answers:

1

Hi,

I have a custom class declared as follows (in vb.net)

<Serializable()> _
Public Class NumInfo Public n As String
Public f As Integer Public fc As char() Public t As Integer
Public tc As char() Private validFlag As Boolean = True
Public Sub New()
End Sub
'I also have public properties(read/write) for all the public variables
End Class

In my service.asmx codebehind class I have a webmethod as follows:

<WebMethod()> _
<XmlInclude(GetType(NumInfo))> _
Public Function ConvertTo(ByVal info As NumInfo) As String
Return mbc(info)
'mbc is another function defined in my service.asmx "service" class
End Function

The problem is that when I start debugging it to test it, the page that I get does not contain any fields where I could input the values for the public fields of numInfo. How do I initialise the class? There is no "Invoke" button either. All I see are soap details as below:

ConvertTo
Test
The test form is only available for methods with primitive types as parameters.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The
placeholders shown need to be replaced with actual values.
POST /Converter/BC.asmx
HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://Services/ConvertTo"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<soap:Body>
<ConvertTo xmlns="http://Services/"&gt;
<info>
<n>string</n>
<f>int&lt/f>
<fc>
<char>char</char>
<char>char>/char>
</fc>
..etc..



What am I doing wrong? For the record I tried replacing char() with string to see if it was the array causing problems but that didn't help either. I'm fairly new to web services. I tried replacing the custom object parameter with a primitive parameter just to check how things worked and it rendered a page with an input field and invoke button. I just can't seem to get it working with custom object. Help!

A: 

as the message says "The test form is only available for methods with primitive types as parameters." meaning string, bool, int etc.

I find it is simple enough to set up a test page where I can define my object and pass it to the web method for debugging purposes.

senloe
lol..thanks Senloe. I can't believe I've been blind and stupid enough to not see it!! :D. I've already posted this question on a hundred forums by now and wasted a whole day thinking I must be doing something wrong!! :D THANKS A TON!
Jon