shadowboxer
02-25-2009, 12:03 PM
Hi everyone,
I'm using Spring.Net WebServices as described in SpringAir example.
My webservice name is AutoCompleteWebService. When I evoke the url directly (Spring.QA.Web/AutoCompleteWebService.asmx) it works properly.
I am trying to use it with AutoCompleteExtender from AjaxControlToolkit:
<asp:ScriptManager runat="server" ID="scriptManager" EnablePartialRendering="true" >
<Services>
<asp:ServiceReference Path = "../AutoCompleteWebService.asmx"></asp:ServiceReference>
</Services>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox id="txtClientAcronym" runat="server" CssClass="inputNormal" width="70px" AutoCompleteType="Disabled">*</asp:TextBox>
<cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1"
TargetControlID="txtClientAcronym" ServicePath = "../AutoCompleteWebService.asmx" ServiceMethod = "FindClientByAcronym" EnableCaching="true">
</ContentTemplate>
</asp:UpdatePanel>
Here's my Services.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<objects>
<object id="autoCompleteWebService" name="/AutoComplete.asmx" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="autoComplete"/>
<property name="Name" value="AutoComplete"/>
<property name="Namespace" value="http:Spring.QA.Web/WebServices"/>
<property name="Description" value="Spring QA AutoComplete Web Service"/>
<property name="TypeAttributes">
<list>
<object type="System.Web.Script.Services.ScriptServiceAttribute, System.Web.Extensions"/>
<object type="System.Web.Services.Protocols.SoapRpcServiceAttrib ute, System.Web.Services">
<property name="Use" value="Literal" />
</object>
</list>
</property>
<property name="MemberAttributes">
<dictionary>
<entry key="FindClientByAcronym">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Return a collection of all clients"/>
</object>
</entry>
</dictionary>
</property>
</object>
<!-- Production service definitions -->
<object id="autoComplete" type="Spring.QA.Services.DefaultAutoComplete, Spring.QA.Dao">
<description>
The main service interface for the SpringAir application.
</description>
<constructor-arg name="clientDao" ref="clientDao" />
</object>
</objects>
And my service class:
public class DefaultAutoComplete : IAutoComplete
{
private IClientDao clientDao;
public DefaultAutoComplete(IClientDao clientDao)
{
#region Sanity Checks
if (clientDao == null)
{
throw new ArgumentNullException("clientDao", "The 'clientDao' argument is required.");
}
#endregion
this.clientDao = clientDao;
}
public string[] FindClientByAcronym(string acronym)
{
string value = acronym.ToLower() + "%";
ArrayList results = (ArrayList)clientDao.Load("from Client where lower(sigla) like ?", new object[] { value });
int count = results.Count;
string[] clients = new string[count];
for (int i = 0; i < count; i++ )
{
clients[i] = ((Client)results[i]).Acronym;
}
return clients;
}
}
What am I doing wrong?
I'm using Spring.Net WebServices as described in SpringAir example.
My webservice name is AutoCompleteWebService. When I evoke the url directly (Spring.QA.Web/AutoCompleteWebService.asmx) it works properly.
I am trying to use it with AutoCompleteExtender from AjaxControlToolkit:
<asp:ScriptManager runat="server" ID="scriptManager" EnablePartialRendering="true" >
<Services>
<asp:ServiceReference Path = "../AutoCompleteWebService.asmx"></asp:ServiceReference>
</Services>
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox id="txtClientAcronym" runat="server" CssClass="inputNormal" width="70px" AutoCompleteType="Disabled">*</asp:TextBox>
<cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1"
TargetControlID="txtClientAcronym" ServicePath = "../AutoCompleteWebService.asmx" ServiceMethod = "FindClientByAcronym" EnableCaching="true">
</ContentTemplate>
</asp:UpdatePanel>
Here's my Services.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<objects>
<object id="autoCompleteWebService" name="/AutoComplete.asmx" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="autoComplete"/>
<property name="Name" value="AutoComplete"/>
<property name="Namespace" value="http:Spring.QA.Web/WebServices"/>
<property name="Description" value="Spring QA AutoComplete Web Service"/>
<property name="TypeAttributes">
<list>
<object type="System.Web.Script.Services.ScriptServiceAttribute, System.Web.Extensions"/>
<object type="System.Web.Services.Protocols.SoapRpcServiceAttrib ute, System.Web.Services">
<property name="Use" value="Literal" />
</object>
</list>
</property>
<property name="MemberAttributes">
<dictionary>
<entry key="FindClientByAcronym">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="Return a collection of all clients"/>
</object>
</entry>
</dictionary>
</property>
</object>
<!-- Production service definitions -->
<object id="autoComplete" type="Spring.QA.Services.DefaultAutoComplete, Spring.QA.Dao">
<description>
The main service interface for the SpringAir application.
</description>
<constructor-arg name="clientDao" ref="clientDao" />
</object>
</objects>
And my service class:
public class DefaultAutoComplete : IAutoComplete
{
private IClientDao clientDao;
public DefaultAutoComplete(IClientDao clientDao)
{
#region Sanity Checks
if (clientDao == null)
{
throw new ArgumentNullException("clientDao", "The 'clientDao' argument is required.");
}
#endregion
this.clientDao = clientDao;
}
public string[] FindClientByAcronym(string acronym)
{
string value = acronym.ToLower() + "%";
ArrayList results = (ArrayList)clientDao.Load("from Client where lower(sigla) like ?", new object[] { value });
int count = results.Count;
string[] clients = new string[count];
for (int i = 0; i < count; i++ )
{
clients[i] = ((Client)results[i]).Acronym;
}
return clients;
}
}
What am I doing wrong?