我在尝试在Visual Studio中调试VB代码以与特定WebService进行交互时遇到此错误。
我对Visual Basic不太熟悉。
错误在Imports System.IO Imports System.Xml
Imports System.Xml.Serialization
Imports WebReference
Partial Class _Default
Inherits System.Web.UI.Page
Dim ws As New USD_WebService
Dim sid As String
Dim userhandle, username, password As String
Dim attrVal(5), attr(0), prop(0) As String
Dim requestHandle, requestNumber As String
Dim persistent_id As String
Dim catAttrib(5) As String
Sub Main()
Dim ws As New USD_WebService
ws.Url = "http://hummer:8080/axis/services/USD_R11_WebService?wsdl"
Dim username, password
Dim sid
username = "servicedesk"
password = "password"
sid = ws.login(username, password)
Dim userhandle
userhandle = ws.getHandleForUserid(sid, username)
Dim USD As New WebReference.USD_WebService
sid = USD.login(username, password)
Dim ticket_handle As String = “cr:1001” ws.closeTicket(Sid,“ticket fechado”, ticket_handle)
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ws.Url = "http://hummer:8080/axis/services/USD_R11_WebService?wsdl"
End Sub
End Class
行
完整的代码:
(1..2).each do |i|
# <name of cookbook>_instance will lead to instance.rb . weird.
google_cloud_instance "#{name_prefix}-#{i}" do
machine_type 'n1-standard-1'
zone_name "#{zone_a}"
boot_disk_image "debian-7-wheezy-v20140408"
service_account_scopes ["compute", "userinfo.email", "devstorage.full_control"]
tags ["application-server"] # TODO take from metadata
metadata "application-server"=> true, "foo"=>"bar"
auto_restart true
on_host_maintenance "TERMINATE"
# enable turbo mode!
wait_for false
# bootstrap attributes
first_boot_json FIRST_BOOT
client_rb CLIENT_RB
validation_pem VALIDATION_PEM
# auth
client_email AUTH_EMAIL
project_id AUTH_PROJECT
key_location AUTH_KEYPATH
action :create
end
servers << "#{name_prefix}-#{i}"
end
任何人都可以帮助我吗?!?!
答案 0 :(得分:3)
在VB.NET中,每行只能执行一个语句。其他语言,如Java或C#使用';'表示语句的结束,但是在VB.NET中它是一行的结尾。编译器试图告诉你在一行上有两个语句,并且它只希望有一个语句。
Dim ticket_handle As String = “cr:1001” ws.closeTicket(Sid,“ticket fechado”, ticket_handle)
应该是
Dim ticket_handle As String = “cr:1001”
ws.closeTicket(Sid,“ticket fechado”, ticket_handle)