calling web services method in asp.net page throws error


G

gane

Hi,

I am calling a web service method in a asp.net page. This works fine if the
web services is in the local system,
but when i put in test server and reference it in asp.net page, it throws
error saying
Server was unable to process request. --> Object reference not set to an
instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: Server was
unable to process request. --> Object reference not set to an instance of an
object.

Source Error:

Line 82:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetInfo",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 83: public System.Data.DataSet GetInfo(string objectClass,
[System.Xml.Serialization.XmlArrayItemAttribute(NestingLevel=1)] object[][]
PropertyNameValue, string[] columns, bool useCached) {
Line 84: object[] results = this.Invoke("GetInfo", new object[]
{
Line 85: objectClass,
Line 86: PropertyNameValue,

Source File: c:\inetpub\wwwroot\phonebook\web
references\localhost\reference.cs Line: 84

Stack Trace:

[SoapException: Server was unable to process request. --> Object reference
not set to an instance of an object.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
Phone.localhost.Info.GetInfo(String objectClass, Object[][]
PropertyNameValue, String[] columns, Boolean useCached) in
c:\inetpub\wwwroot\phone\web references\localhost\reference.cs:84
Phone.Info.CreateDataSource() in
c:\inetpub\wwwroot\phone\default.aspx.cs:209
Phone.Info.btnSearch_ServerClick(Object sender, EventArgs e) in
c:\inetpub\wwwroot\phone\default.aspx.cs:136
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)
System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




Code:
localhost.Info info = new localhost.Info();
DataSet dsInfo = new DataSet();
object[][] obj = new object[1][];
obj[0]=new object[]{strSearchBy,strSearchFor};
string[] columns = new string[ColumnNames.Keys.Count];
columns = ColumnKey;
dsInfo = info.GetInfo("person",obj,columns,true);
 
Ad

Advertisements

S

Simon Hart

What is different on the test server from the development server? Is the
method GetInfo reading a database? Can you post the GetInfo web method for
us to see.

Regards
Simon.

gane said:
Hi,

I am calling a web service method in a asp.net page. This works fine if
the web services is in the local system,
but when i put in test server and reference it in asp.net page, it throws
error saying
Server was unable to process request. --> Object reference not set to an
instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: Server was
unable to process request. --> Object reference not set to an instance of
an object.

Source Error:

Line 82:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetInfo",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 83: public System.Data.DataSet GetInfo(string objectClass,
[System.Xml.Serialization.XmlArrayItemAttribute(NestingLevel=1)]
object[][] PropertyNameValue, string[] columns, bool useCached) {
Line 84: object[] results = this.Invoke("GetInfo", new
object[] {
Line 85: objectClass,
Line 86: PropertyNameValue,

Source File: c:\inetpub\wwwroot\phonebook\web
references\localhost\reference.cs Line: 84

Stack Trace:

[SoapException: Server was unable to process request. --> Object reference
not set to an instance of an object.]

System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
Phone.localhost.Info.GetInfo(String objectClass, Object[][]
PropertyNameValue, String[] columns, Boolean useCached) in
c:\inetpub\wwwroot\phone\web references\localhost\reference.cs:84
Phone.Info.CreateDataSource() in
c:\inetpub\wwwroot\phone\default.aspx.cs:209
Phone.Info.btnSearch_ServerClick(Object sender, EventArgs e) in
c:\inetpub\wwwroot\phone\default.aspx.cs:136
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)

System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




Code:
localhost.Info info = new localhost.Info();
DataSet dsInfo = new DataSet();
object[][] obj = new object[1][];
obj[0]=new object[]{strSearchBy,strSearchFor};
string[] columns = new string[ColumnNames.Keys.Count];
columns = ColumnKey;
dsInfo = info.GetInfo("person",obj,columns,true);
 
Ad

Advertisements

M

Murtaza

I think there is a problem with your string, try n set the string some value
if it is set to null value...

Simon Hart said:
What is different on the test server from the development server? Is the
method GetInfo reading a database? Can you post the GetInfo web method for
us to see.

Regards
Simon.

gane said:
Hi,

I am calling a web service method in a asp.net page. This works fine if
the web services is in the local system,
but when i put in test server and reference it in asp.net page, it throws
error saying
Server was unable to process request. --> Object reference not set to an
instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Services.Protocols.SoapException: Server was
unable to process request. --> Object reference not set to an instance of
an object.

Source Error:

Line 82:
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetInfo",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 83: public System.Data.DataSet GetInfo(string objectClass,
[System.Xml.Serialization.XmlArrayItemAttribute(NestingLevel=1)]
object[][] PropertyNameValue, string[] columns, bool useCached) {
Line 84: object[] results = this.Invoke("GetInfo", new
object[] {
Line 85: objectClass,
Line 86: PropertyNameValue,

Source File: c:\inetpub\wwwroot\phonebook\web
references\localhost\reference.cs Line: 84

Stack Trace:

[SoapException: Server was unable to process request. --> Object reference
not set to an instance of an object.]

System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
Phone.localhost.Info.GetInfo(String objectClass, Object[][]
PropertyNameValue, String[] columns, Boolean useCached) in
c:\inetpub\wwwroot\phone\web references\localhost\reference.cs:84
Phone.Info.CreateDataSource() in
c:\inetpub\wwwroot\phone\default.aspx.cs:209
Phone.Info.btnSearch_ServerClick(Object sender, EventArgs e) in
c:\inetpub\wwwroot\phone\default.aspx.cs:136
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)

System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()




Code:
localhost.Info info = new localhost.Info();
DataSet dsInfo = new DataSet();
object[][] obj = new object[1][];
obj[0]=new object[]{strSearchBy,strSearchFor};
string[] columns = new string[ColumnNames.Keys.Count];
columns = ColumnKey;
dsInfo = info.GetInfo("person",obj,columns,true);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top