Managed Code Setting Parameters Of A WebService - Help

S

Scott at RVC

Hi All,

The user makes a "Patient Name" selection from a dropdown list.

The "Patient Name" is used as a parameter in a webService to obtain
all the patient's data.

below is my code, i get an object not set error. Please could someone
guide me.

// The following function handler is created by Microsoft Office
// InfoPath. Do not modify the type or number of arguments.
[InfoPathEventHandler(MatchPath="/my:prototype/my:cboPatient",
EventType=InfoPathEventType.OnAfterChange)]
public void cboPatient_OnAfterChange(DataDOMEvent e)
{

if (e.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}

// Get a reference to the Web Service
// NOTE: SelectSinglePatient is the data connection name.
IXMLDOMDocument3 wsDOM =
(IXMLDOMDocument3)thisXDocument.DataObjects["SelectSinglePatient"].DOM;

// Set the SelectionNamespaces so that you can find the correct field
wsDOM.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\""
+ " xmlns:s0=\"http://tempuri.org/ManagedCodeWebService/Prototype.asmx/\"");

// Set Web Service parameters
// NOTE: SelectSinglePatient is the data connection name.
// NOTE: strFullName is the webservice parameter name.
// ** ERROR HERE **
wsDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/s0:SelectSinglePatient/s0:strFullName").text
= thisXDocument.DOM.selectSingleNode("/my:prototype/my:cboPatient").text;

// Requery the webservice datasource
// NOTE: SelectSinglePatient is the data connection name.
thisXDocument.DataObjects["SelectSinglePatient"].Query();
}

Thanking you in advance.
Scott
 

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