Ask a Question related to ASP.NET Web Services, Design and Development.
-
Lasse Edsvik #1
cant add another webmethod :(
Hello
I have this code:
<%@ WebService language="VB" class="TCPUtil" %>
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Imports System.Net
<System.Web.Services.WebService(Namespace
:="http://dotnet.100procent.com/tcp")> _
Public Class TCPUtil
<WebMethod(Description:="Returns a list of IPAdresses for an host")> _
Public Function HostToIPAddresses(ByVal Hostname As String) As
String()
Dim MyHost As IPHostEntry
Dim Addresses() As IPAddress
Dim i As Integer
MyHost = Dns.GetHostByName(Hostname)
Addresses = MyHost.AddressList
Dim AddressString(Addresses.GetUpperBound(0)) As String
For i = 0 To Addresses.GetUpperBound(0)
AddressString(i) = Addresses(i).ToString()
Next
HostToIPAddresses = AddressString
End Function
<WebMethod()>
Public Function Add(ByVal a as Integer, ByVal b as Integer) as Integer
Return a+b
End Function
End Class
and that second is just for testing, but i get:
Compiler Error Message: BC32035: Attribute specifier is not a complete
statement. Use a line continuation to apply the attribute to the following
statement.
on the line <WebMethod()> for the second one, have i forgot something or do
i need so add something?
Best regards
/Lasse
Lasse Edsvik Guest
-
WebMethod Delay
Hi, Got a webmethod which call a complex stored procedure on my Sybase Database. Running the procédure from a Query Tool last for 1'30 minute.... -
How do I get the WebMethodAttribute from within a webmethod?
I need the description out of the WebMethodAttribute on my web method. I want to be able to throw my own exception and tell it what method threw... -
WebMethod returning XMLdataDocument
Hi all, I am trying to consume a webservice that receives and returns XmlDataDocument , My problem is that the proxy created by VS.Net (by adding... -
Webmethod OnEnd
Hello, I have a requirement on my webservice. I want to track when a request had come to my webmethod and when the response was completed. I... -
Pulling DataSet From WebMethod -- Possible?
Is it possible to have a public WebMethod in a WebService that returns a DataSet? -- _____________________________ Ron Rodenberg Lead Software... -
Christopher Bova #2
cant add another webmethod :(
In this case you can take the error message at face value.
Just add the vb line continuation character '_' after
your "WebMethod" attribute. So:
<WebMethod()>_
Public Function Add(ByVal a as Integer, ByVal b as
Integer) as Integer
Return a+b
End Function
End Class
You can also put the attribute and the function
declaration on the same line like so:
<WebMethod()>Public Function Blah(ByVal Foo as Integer)...
for an host")> _>-----Original Message-----
>Hello
>
>I have this code:
>
><%@ WebService language="VB" class="TCPUtil" %>
>
>Imports System
>Imports System.Web.Services
>Imports System.Xml.Serialization
>Imports System.Net
>
><System.Web.Services.WebService(Namespace
>:="http://dotnet.100procent.com/tcp")> _
> Public Class TCPUtil
>
> <WebMethod(Description:="Returns a list of IPAdressesAs String) As> Public Function HostToIPAddresses(ByVal HostnameString>String()
>
> Dim MyHost As IPHostEntry
>
> Dim Addresses() As IPAddress
>
> Dim i As Integer
>
> MyHost = Dns.GetHostByName(Hostname)
> Addresses = MyHost.AddressList
>
> Dim AddressString(Addresses.GetUpperBound(0)) AsInteger) as Integer>
> For i = 0 To Addresses.GetUpperBound(0)
> AddressString(i) = Addresses(i).ToString()
> Next
>
> HostToIPAddresses = AddressString
> End Function
>
>
> <WebMethod()>
> Public Function Add(ByVal a as Integer, ByVal b asnot a complete> Return a+b
> End Function
>End Class
>
>
>
>and that second is just for testing, but i get:
>
>Compiler Error Message: BC32035: Attribute specifier isto the following>statement. Use a line continuation to apply the attributeforgot something or do>statement.
>
>
>on the line <WebMethod()> for the second one, have i>i need so add something?
>
>Best regards
>/Lasse
>
>
>
>
>.
>Christopher Bova Guest
-
Lasse Edsvik #3
Re: cant add another webmethod :(
Thanks Christopher, was to blind to see that one :)
/Lasse
"Christopher Bova" <invalidemail@address.com> wrote in message
news:b15201c3813a$3e635790$a601280a@phx.gbl...> In this case you can take the error message at face value.
> Just add the vb line continuation character '_' after
> your "WebMethod" attribute. So:
>
> <WebMethod()>_
> Public Function Add(ByVal a as Integer, ByVal b as
> Integer) as Integer
> Return a+b
> End Function
> End Class
>
> You can also put the attribute and the function
> declaration on the same line like so:
>
> <WebMethod()>Public Function Blah(ByVal Foo as Integer)...
>
>
>> for an host")> _> >-----Original Message-----
> >Hello
> >
> >I have this code:
> >
> ><%@ WebService language="VB" class="TCPUtil" %>
> >
> >Imports System
> >Imports System.Web.Services
> >Imports System.Xml.Serialization
> >Imports System.Net
> >
> ><System.Web.Services.WebService(Namespace
> >:="http://dotnet.100procent.com/tcp")> _
> > Public Class TCPUtil
> >
> > <WebMethod(Description:="Returns a list of IPAdresses> As String) As> > Public Function HostToIPAddresses(ByVal Hostname> String> >String()
> >
> > Dim MyHost As IPHostEntry
> >
> > Dim Addresses() As IPAddress
> >
> > Dim i As Integer
> >
> > MyHost = Dns.GetHostByName(Hostname)
> > Addresses = MyHost.AddressList
> >
> > Dim AddressString(Addresses.GetUpperBound(0)) As> Integer) as Integer> >
> > For i = 0 To Addresses.GetUpperBound(0)
> > AddressString(i) = Addresses(i).ToString()
> > Next
> >
> > HostToIPAddresses = AddressString
> > End Function
> >
> >
> > <WebMethod()>
> > Public Function Add(ByVal a as Integer, ByVal b as> not a complete> > Return a+b
> > End Function
> >End Class
> >
> >
> >
> >and that second is just for testing, but i get:
> >
> >Compiler Error Message: BC32035: Attribute specifier is> to the following> >statement. Use a line continuation to apply the attribute> forgot something or do> >statement.
> >
> >
> >on the line <WebMethod()> for the second one, have i> >i need so add something?
> >
> >Best regards
> >/Lasse
> >
> >
> >
> >
> >.
> >
Lasse Edsvik Guest



Reply With Quote

