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
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