Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Error while accessing the webservice...

  Asked By: Katie    Date: Oct 17    Category: Sharepoint    Views: 762

I am trying to use a webservice with infopath forms.

I have created a dataconnection for the webservice.

I am using VS.NET (C#.NET) for accessing the webservice using the following code in onload event of the ...

CodeSnippet

[InfoPathEventHandler(EventType=InfoPathEventType.OnLoad)]

public void OnLoad(DocReturnEvent e)

{

DataObject dtObj= thisXDocument.DataObjects["GetWorkFlowDetails"] ;

IXMLDOMDocument2 domTmp=(IXMLDOMDocument2)dtObj.DOM;

domTmp.setProperty("SelectionNamespaces",

" xmlns:dfs=\"schemas.microsoft.com/.../dataFormSolution\""

+ " xmlns:tns=\"http://tempuri.org/\"");

domTmp.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetWorkFlowDetails/tns:WorkFlowType").text="ABSR";

dtObj.Query();

string currentAction= domTmp.selectSingleNode("/dfs:myFields/dfs:dataFields/tns:GetWorkFlowDetailsResponse/tns:GetWorkFlowDetailsResult/ABSR/CurrentActions").text;

thisXDocument.UI.Alert (currentAction);

}

I am getting the following error.

System.NullReferenceException
Object reference not set to an instance of an object.
at Leave_Request.Leave_Request.OnLoad(DocReturnEvent e) in c:\inetpub\wwwroot\leave request\formcode.cs:line 63
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)

But when I try to access the same through browser, it works fine.
I am unable to understand the exact problem. Can someone help me out in solving this issue.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Error while accessing the webservice... Or get search suggestion and latest updates.




Tagged: