当然:这里是代码——我把它缩短了一点,但主要功能已经给出
顺便说一句,我现在将数据类型更改为长,现在我得到了IllegalArgumentException
爪哇:
@WebMethod(operationName = "setData", action = "setData")
public void setData(final long k)
{
myValue = k;
}
Sheet1中的VBA我称之为:
Call dataService.wsm_setData(5)
在 serviceFile(使用 Web Service Toolkit 生成)中:
Private sc_DataServic As SoapClient30
Private Const c_WSDL_URL As String = "http://pcname:8010/myurl/data?wsdl"
Private Const c_SERVICE As String = "DataServiceService"
Private Const c_PORT As String = "DataServicePort"
Private Const c_SERVICE_NAMESPACE As String = "http://myurl"
Private Sub Class_Initialize()
Set sc_DataServic = New SoapClient30
sc_DataServic.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT, c_SERVICE_NAMESPACE
sc_DataServic.ConnectorProperty("ProxyServer") = "<CURRENT_USER>"
sc_DataServic.ConnectorProperty("EnableAutoProxy") = True
Set sc_DataServic.ClientProperty("GCTMObjectFactory") = New clsof_Factory_Data
End Sub
Public Function wsm_setData(ByVal dcml_arg0 As Double)
On Error GoTo wsm_setDataTrap
sc_DataServic.setData dcml_arg0
Set sc_DataServic = Nothing
Exit Function
wsm_setDataTrap:
DataServicErrorHandler "wsm_setData"
End Function