I have an InfoPath form connecting to an ASP.Net Web Service using .udc files stored in a SharePoint Data Connections Library. For several of the Web Service calls, I am passing in input parameters through FormCode.cs. Before converting my data connections to .udc files, everything was working. After converting, my Web Service calls that use input parameters are returning zero results.
From my FormCode.cs file:
WebServiceConnection wsc = (WebServiceConnection)this.DataConnections["GetContactsByThemeID"];
XmlDocument inputDocument = new XmlDocument();
XmlDocument outputDocument = new XmlDocument();
XmlDocument errorsDocument = new XmlDocument();
XPathNavigator inputNav = inputDocument.CreateNavigator();
XPathNavigator outputNav = outputDocument.CreateNavigator();
XPathNavigator errorsNav = errorsDocument.CreateNavigator();
inputDocument.LoadXml(@"<GetContactsByThemeID xmlns='http://myserver'> <themeID>" + themeID + "</themeID> </GetContactsByThemeID>");
wsc.Execute(inputNav, outputNav, errorsNav);
Before I converted my data connections, the outputDocument contained a DataSet with the correct results. After converting my data connections, the outputDocument contains an empty DataSet.
This is my .udc file:
<?xml version="1.0" ?>
<?MicrosoftWindowsSharePointServices
ContentTypeID="0x010100B4CBD48E029A4ad8B62CB0E41868F2B0"?>
- <udc:DataSource MajorVersion="2"
MinorVersion="0" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc">
<udc:Name>GetContactsByThemeID</udc:Name>
<udc:Description>Format: UDC V2; Connection Type: WebService;
Purpose: ReadOnly; Generated by Microsoft Office InfoPath 2007 on 2008-04-22 at
09:56:37 by MYNAME.</udc:Description>
- <udc:Type MajorVersion="2"
MinorVersion="0" Type="WebService">
<udc:SubType MajorVersion="0" MinorVersion="0" Type="" />
</udc:Type>
- <udc:ConnectionInfo Purpose="ReadOnly"
AltDataSource="">
<udc:WsdlUrl>http://myserver/mydirectory/Service.asmx?WSDL</udc:WsdlUrl>
<udc:ServiceUrl
UseFormsServiceProxy="false">http://myserver/mydirectory/Service.asmx</udc:ServiceUrl>
<udc:SoapAction>http://myserver/GetContactsByThemeID</udc:SoapAction>
</udc:SelectCommand>
<udc:ServiceUrl UseFormsServiceProxy="false" />
<udc:FileName>Specify a filename or formula</udc:FileName>
<udc:FolderName AllowOverwrite="" />
</udc:UpdateCommand>
- <!-- <udc:Authentication><udc:SSO AppId='' CredentialType='' /></udc:Authentication>
;
--> </udc:ConnectionInfo>
</udc:DataSource>
I think I need to be passing in the input parameter a different way, but I can't figure out how. Please help if you can. I have tons of Web Service calls like this.
Thanks in advance.