T
Tom
Anybody works with WSRF.NET???
I need just few newbie questions...
i use one resource:
[Resource]
private int _counterValue;
1. When i invoke method create(), and new resource is created...i get
message
System.Data.Odbc.OdbcException: ERROR [08001] [Microsoft][ODBC SQL
Server Driver][Shared Memory]SQL Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver][Shared
Memory]ConnectionOpen (Connect()).
at System.Data.Odbc.OdbcConnection.Open()
at
UVa.GCG.WSRF.Service.PersistentState.DatabaseManager.openNewConnection() in
C:\Program
Files\WSRF.Net\Src\Server\ServiceLib\WSRFServiceLib\PersistentState\Database
Manager.cs:line 49
at UVa.GCG.WSRF.Service.BaseTypes.WebServiceBase.beginMethod() in
C:\Program
Files\WSRF.Net\Src\Server\ServiceLib\WSRFServiceLib\BaseTypes\WebServiceBase
..cs:line 276
at UVa.GCG.Generated.WSRFTestServices.Jebada.create()
i dont know, if i must create database(for storing resource values), or
database is created automaticaly?
example with i have problems is...
---
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
using System.Xml.Serialization;
using UVa.GCG.WSRF.Common.Attributes;
using UVa.GCG.WSRF.Common.Configuration;
using UVa.GCG.WSRF.Common.WS;
using UVa.GCG.WSRF.Common.WS.Addressing;
using UVa.GCG.WSRF.Common.WS.Notification;
using UVa.GCG.WSRF.Service.BaseTypes;
using UVa.GCG.WSRF.Service.ResourceLifetime;
using UVa.GCG.WSRF.Service.ResourceProperties;
using UVa.GCG.WSRF.Service.WS.Notification;
using UVa.GCG.WSRF.Service.WS.Configuration;
using UVa.GCG.WSRF.Service.WS.Notification.PortTypes;
namespace WSRFTestServices
{
/// <summary>
/// Summary description for Jebada.
/// </summary>
[WsdlBaseName("Jebada", "http://gcg.cs.virginia.edu/testing")]
[WebService]
[WebServiceBinding]
[WSRFPortType(typeof(NotificationProducerPortType))]
[WSRFPortType(typeof(ImmediateResourceTerminationPortType))]
[WSRFPortType(typeof(SetResourcePropertiesPortType))]
[ResourceProperty("TestResourceProperty1", typeof(string), true, true, "0",
"1")]
[ResourceProperty("TestResourceProperty2", typeof(string), true, true, "0",
"1")]
public class Jebada : ServiceSkeleton
{
[Resource]
private int _counterValue;
public Jebada()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
#region WSRF.NET Methods
public override void InitResource(Hashtable parameters)
{
_counterValue = 0;
}
#endregion
#region Counter Methods
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/create",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElementAttribute("createResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public EndpointReferenceType create()
{
string guid = base.Create(null, null);
EndpointReferenceType epr = new EndpointReferenceType(
new AttributedURI(null,
ServiceBase.ServiceURL),
WSUtilities.createReferencePropertiesType(guid), null, null, null, null);
return epr;
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/getValue",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElementAttribute("getValueResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public int getValue()
{
return _counterValue;
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" + "/add",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElementAttribute("addResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public int add()
{
_counterValue++;
ServiceBase.NotificationQueue.fireNotificationEvent(
this, new XmlQualifiedName("counter-value-changed",
"http://gcg.cs.virginia.edu/testing/topics"), _counterValue);
return _counterValue;
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/setValue",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
public void setValue(
[XmlElement("newValue",
Namespace="http://gcg.cs.virginia.edu/testing")]
int newValue)
{
_counterValue = newValue;
ServiceBase.NotificationQueue.fireNotificationEvent(
this, new XmlQualifiedName("counter-value-changed",
"http://gcg.cs.virginia.edu/testing/topics"), _counterValue);
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/getSubscriptionStates",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElement("getSubscriptionStatesResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public int getSubscriptionStates(
[XmlElement("filterPaused", Namespace="http://gcg.cs.virginia.edu/testing")]
bool filterPaused,
[XmlElement("topic", Namespace="http://gcg.cs.virginia.edu/testing")]
XmlQualifiedName topic)
{
ISubscriptionManagerProxy proxy =
WSRFServiceConfiguration.Configuration.Notification.createSubscriptionManage
rProxy(
ServiceBase);
GCGSubscription []subscriptions = proxy.getSubscriptions(
ResourceID, topic, filterPaused);
return (subscriptions == null) ? 0 : subscriptions.Length;
}
#endregion
}
}
I need just few newbie questions...
i use one resource:
[Resource]
private int _counterValue;
1. When i invoke method create(), and new resource is created...i get
message
System.Data.Odbc.OdbcException: ERROR [08001] [Microsoft][ODBC SQL
Server Driver][Shared Memory]SQL Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver][Shared
Memory]ConnectionOpen (Connect()).
at System.Data.Odbc.OdbcConnection.Open()
at
UVa.GCG.WSRF.Service.PersistentState.DatabaseManager.openNewConnection() in
C:\Program
Files\WSRF.Net\Src\Server\ServiceLib\WSRFServiceLib\PersistentState\Database
Manager.cs:line 49
at UVa.GCG.WSRF.Service.BaseTypes.WebServiceBase.beginMethod() in
C:\Program
Files\WSRF.Net\Src\Server\ServiceLib\WSRFServiceLib\BaseTypes\WebServiceBase
..cs:line 276
at UVa.GCG.Generated.WSRFTestServices.Jebada.create()
i dont know, if i must create database(for storing resource values), or
database is created automaticaly?
example with i have problems is...
---
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
using System.Xml.Serialization;
using UVa.GCG.WSRF.Common.Attributes;
using UVa.GCG.WSRF.Common.Configuration;
using UVa.GCG.WSRF.Common.WS;
using UVa.GCG.WSRF.Common.WS.Addressing;
using UVa.GCG.WSRF.Common.WS.Notification;
using UVa.GCG.WSRF.Service.BaseTypes;
using UVa.GCG.WSRF.Service.ResourceLifetime;
using UVa.GCG.WSRF.Service.ResourceProperties;
using UVa.GCG.WSRF.Service.WS.Notification;
using UVa.GCG.WSRF.Service.WS.Configuration;
using UVa.GCG.WSRF.Service.WS.Notification.PortTypes;
namespace WSRFTestServices
{
/// <summary>
/// Summary description for Jebada.
/// </summary>
[WsdlBaseName("Jebada", "http://gcg.cs.virginia.edu/testing")]
[WebService]
[WebServiceBinding]
[WSRFPortType(typeof(NotificationProducerPortType))]
[WSRFPortType(typeof(ImmediateResourceTerminationPortType))]
[WSRFPortType(typeof(SetResourcePropertiesPortType))]
[ResourceProperty("TestResourceProperty1", typeof(string), true, true, "0",
"1")]
[ResourceProperty("TestResourceProperty2", typeof(string), true, true, "0",
"1")]
public class Jebada : ServiceSkeleton
{
[Resource]
private int _counterValue;
public Jebada()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
#region WSRF.NET Methods
public override void InitResource(Hashtable parameters)
{
_counterValue = 0;
}
#endregion
#region Counter Methods
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/create",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElementAttribute("createResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public EndpointReferenceType create()
{
string guid = base.Create(null, null);
EndpointReferenceType epr = new EndpointReferenceType(
new AttributedURI(null,
ServiceBase.ServiceURL),
WSUtilities.createReferencePropertiesType(guid), null, null, null, null);
return epr;
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/getValue",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElementAttribute("getValueResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public int getValue()
{
return _counterValue;
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" + "/add",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElementAttribute("addResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public int add()
{
_counterValue++;
ServiceBase.NotificationQueue.fireNotificationEvent(
this, new XmlQualifiedName("counter-value-changed",
"http://gcg.cs.virginia.edu/testing/topics"), _counterValue);
return _counterValue;
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/setValue",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
public void setValue(
[XmlElement("newValue",
Namespace="http://gcg.cs.virginia.edu/testing")]
int newValue)
{
_counterValue = newValue;
ServiceBase.NotificationQueue.fireNotificationEvent(
this, new XmlQualifiedName("counter-value-changed",
"http://gcg.cs.virginia.edu/testing/topics"), _counterValue);
}
[WebMethod]
[SoapDocumentMethodAttribute("http://gcg.cs.virginia.edu/testing" +
"/getSubscriptionStates",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=SoapParameterStyle.Bare)]
[return: XmlElement("getSubscriptionStatesResponse",
Namespace="http://gcg.cs.virginia.edu/testing")]
public int getSubscriptionStates(
[XmlElement("filterPaused", Namespace="http://gcg.cs.virginia.edu/testing")]
bool filterPaused,
[XmlElement("topic", Namespace="http://gcg.cs.virginia.edu/testing")]
XmlQualifiedName topic)
{
ISubscriptionManagerProxy proxy =
WSRFServiceConfiguration.Configuration.Notification.createSubscriptionManage
rProxy(
ServiceBase);
GCGSubscription []subscriptions = proxy.getSubscriptions(
ResourceID, topic, filterPaused);
return (subscriptions == null) ? 0 : subscriptions.Length;
}
#endregion
}
}