sending query to webservice - InfoPath Dev
in

InfoPath Dev

sending query to webservice

Last post 04-20-2011 09:10 AM by robszar. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-20-2011 06:44 AM

    sending query to webservice

    I have a webservice and I want to pass a string to it and it should return an array of strings that populate a dropdownbox. Right now I'm at the point where if I hard code the value that I'm passing to the web service it will populate the dropdownbox. yay! Now I have to pass the value of a text field to the webservice, I'm using VB

    this is the value I want to pass: Dim XNavigator As XPathNavigator Dim Client_ID As String = "NA" XNavigator = Me.MainDataSource.CreateNavigator().SelectSingleNode("/my:AllDataFields/my:RequestorInformationGroup/my:ExistingClientIDGroup/my:ClientID", NamespaceManager) Client_ID = XNavigator.Value()

    The datasource name is: QueryOppsForm
    can someone help me connect to the data source (QueryOppsForm) and pass the Client_ID, then refresh the dropdownbox to show the query results?
    Thanks in advance.
    Rob
  • 04-20-2011 06:54 AM In reply to

    Re: sending query to webservice

    Any reason you're using code to do this?  Ordinary rules should do the trick.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-20-2011 07:14 AM In reply to

    Re: sending query to webservice

    I am not very familiar with rules but I'm looking at them now. can you please guide me?

    I have a text field, a button and a dropdown box. do I create the rules on the button to:
    submit using a data connection?

    how does it then populate the dropdown?
  • 04-20-2011 07:32 AM In reply to

    Re: sending query to webservice

    Create a rule to set the field you want, and another rule to query the web service.  Both of these are options in the dropdown when you select a rule action.

    The dropdown options should update as soon as the web service is queried.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-20-2011 07:46 AM In reply to

    Re: sending query to webservice

    this is not working for me, this is what I did with the rules

    I took the button out of the picture so now I have a text field and dropdown
    2 rules,

    1) to "submit" the Client_ID to the webservice
    2) to "query" using data connection

    I am not returning anything, I am "submitting" but then my "query" doesn't have the client_id so I can understand why it's not returning any data

    Should I take out the "query data connection" because I'm not passing any parameters to the webservice?
    does the "submit" return the array? and can I just refresh the dropdown?

    Do I need to use a "set value rule?" if so what do I put in for the value?

    Thanks for your help
  • 04-20-2011 09:01 AM In reply to

    Re: sending query to webservice

    i found a good post on this subject and followed the directions but I'm not returning any data, does this look right?

    I create a new action to set a field’s value. For the field, I click on the Browse Icon and select my web service from the data source drop down. You should see query fields and data fields as nodes in the tree. Open the query fields until you find your parameter. Click on the parameter and click OK to set this value. For the value, I set this to the current node by selecting the function icon and choosing to insert a field or group. Make sure your main data source is selected and choose the appropriate field. In my case, this is the Client_ID field. Once these bindings are done, I click OK.

    I now need to add an action to query the web service, so I click on Add Action and choose Query using a data connection in the action drop down. Since I only have one data source, I choose the only available data source and click OK.

    Now, the final step is to add an action to set the fields of my main data source to the retrieved values from the web service. I click on Add Action and choose the action to Set a field’s value. This time, the field will be the dropdownbox from the main data source and the value will be the associated value from the web service.
  • 04-20-2011 09:10 AM In reply to

    Re: sending query to webservice

    got it, I put the rules on the dropdownbox field instead of the text field. thanks!

    here is the site for a reference: http://wssdevelopment.blogspot.com/2007/11/querying-web-service-with-infopath-2007.html
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.