data connections with parameters not working after converting to udc file - InfoPath Dev
in

InfoPath Dev

data connections with parameters not working after converting to udc file

Last post 04-23-2008 11:03 AM by tjholsman. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-22-2008 09:06 AM

    data connections with parameters not working after converting to udc file

    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:SelectCommand>
                   <udc:ListId />
                   <udc:WebUrl />
                   <udc:ConnectionString />
                   <udc:ServiceUrl UseFormsServiceProxy="false">http://myserver/mydirectory/Service.asmx</udc:ServiceUrl>
                   <udc:SoapAction>http://myserver/GetContactsByThemeID</udc:SoapAction>
                   <udc:Query />
            </udc:SelectCommand>
    -          <udc:UpdateCommand>
                   <udc:ServiceUrl UseFormsServiceProxy="false" />
                   <udc:SoapAction />
                   <udc:Submit />
                   <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. 
  • 04-22-2008 11:05 AM In reply to

    Re: data connections with parameters not working after converting to udc file

    Is this on the same website as SharePoint?

    You may need to enable cross domain in Central Admin if it has to go to another server.

    Also if there is authentication you cannot pass NTLM from one server to the other since SP is being your proxy with the UDC.

  • 04-22-2008 11:29 AM In reply to

    Re: data connections with parameters not working after converting to udc file

    Yes, it's on the SharePoint website in a Data Connection library at the root level site.  It is a single-server farm, so there is no cross domain or authentication issue.  The Web Service is a virtual directory within the SharePoint website in IIS.

    Let me clarify also that it is only data connections that get passed input parameters through the code that are not working.  All other data connections (no input, input passed in through InfoPath rules) are working as expected.  All data connections have been added and converted the same way.  The only difference is that I'm trying to pass the parameters to these data connections in FormCode.cs as shown in the code snippet above.
     

  • 04-23-2008 11:03 AM In reply to

    Re: data connections with parameters not working after converting to udc file

     Problem solved using code from this post:

     
    http://www.infopathdev.com/forums/t/6478.aspx 

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.