I am trying to create a proxy and soap from a sample file and it won't
create multiple dimensional arrays for some reason. I am getting the same
results if "Line" is not a Multidimensiona l array. Why is "Line" not there?
I have the following Class that I compile and put into my Bin directory as:
vbc /t:library NewsItem.vb
copy NewsItem.dll bin
*************** *************** *******
Namespace myComponents
Public Class NewsItem
Public Headline As String
Public Posted As Date
Public URL As String
Public Line As String ()()
End Class
End Namespace
*************** *************** ************
I then have an .asmx file that uses this class:
*************** *************** *************** *********
<%@ WebService Class="BetterNe wsService" %>
Imports System
Imports System.Web.Serv ices
Imports myComponents
<WebService( Namespace:="htt p://yourdomain.com/webservices" )> _
Public Class BetterNewsServi ce : Inherits WebService
<WebMethod( CacheDuration:= 30 )> Public Function GetNews() As NewsItem()
Dim arrNews( 2 ) As NewsItem
arrNews( 0 ) = New NewsItem
arrNews( 0 ).Headline = "Visit superexpert.com for ASP.NET News!"
arrNews( 0 ).Posted = #12/12/2002#
arrNews( 0 ).URL = "http://www.superexpert .com"
arrNews( 1 ) = New NewsItem
arrNews( 1 ).Headline = "Visit ASPWorkshops for ASP.NET Training!"
arrNews( 1 ).Posted = #2/1/2002#
arrNews( 1 ).URL = "http://www.AspWorkshop s.com"
arrNews( 2 ) = New NewsItem
arrNews( 2 ).Headline = "Visit superexpertCont rols.com for ASP.NET
Controls!"
arrNews( 2 ).Posted = #2/14/2002#
arrNews( 2 ).URL = "http://www.superexpert Controls.com"
Return arrNews
End Function
End Class
*************** *************** *************** *********
This compiles fine as:
wsdl /l:vb http://localhost/hello/BetterNewsService.asmx?WSDL
The soap envelop is:
*************** *************** *************** **********
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/">
<soap:Body>
<GetNewsRespons e xmlns="http://yourdomain.com/webservices">
<GetNewsResul t>
<NewsItem>
<Headline>strin g</Headline>
<Posted>dateTim e</Posted>
<URL>string</URL>
</NewsItem>
<NewsItem>
<Headline>strin g</Headline>
<Posted>dateTim e</Posted>
<URL>string</URL>
</NewsItem>
</GetNewsResult>
</GetNewsResponse >
</soap:Body>
</soap:Envelope>
*************** *************** *************** ************
The HTTP Post is:
*************** *************** *************** **************
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfNewsIte m xmlns="http://yourdomain.com/webservices">
<NewsItem>
<Headline>strin g</Headline>
<Posted>dateTim e</Posted>
<URL>string</URL>
</NewsItem>
<NewsItem>
<Headline>strin g</Headline>
<Posted>dateTim e</Posted>
<URL>string</URL>
</NewsItem>
</ArrayOfNewsItem >
*************** *************** *************** ***************
Now if I added into the asmx file something like:
arrNews( 0 ).Line(1)(1) = "a test"
I get an error saying that there is no Line in the Class?????
What happened to it?
Thanks,
Tom