Getting Object reference not set to an instance of an object error

  • Thread starter Error when querying a Web Service
  • Start date
E

Error when querying a Web Service

Getting Object reference not set to an instance of an object error when run
the Web Service

In Infopath 2003 I have added the web service as my secondary data source.
It has a query field call tmsSummaryId(its int64). It is a parameter of my
web service method.

I am trying to query the web service using user Input

I wrote following code.

public void CTRL1_23_OnClick(DocActionEvent e)
{

// Write your code here.
IXMLDOMNode filed6 =
thisXDocument.DOM.selectSingleNode("//my:field6");
IXMLDOMDocument2 domXml =
(IXMLDOMDocument2)thisXDocument.DataObjects["GetCustomerData"].DOM;
domXml.setProperty("SelectionNamespaces",
"xmlns:dfs='http://schemas.microsoft.com/office/infopath/2003/dataFormSolution' xmlns:ns1=' http://localhost:6548/BusinessServices'");
IXMLDOMNode queryField =
domXml.selectSingleNode("/dfs:myFields/dfs:queryFields");
//IXMLDOMNode queryField =
domXml.selectSingleNode("/dfs:myFields/dfs:dataFields/GetCustomerDataResponse/GetCustomerDataResult/ParentName");
//filed2.text = queryField.nodeValue;
queryField.text =field6.text;


thisXDocument.DataObjects["GetCustomerData"].Query();



}

when the executing the Query() method is giving an error calling

System.NullReferenceException: Object reference not set to an instance of an
object

Can any one please help on this
 

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