I have written a simple web service that returns a string value.
here is the code for the web service:
Public Function getString() as String
If I test the webservice from the service.asmx page it returns the correct value and works.
Next i created a browser enabled from with a field called test-string-text-box
I have created a secondary data connection to a the web service called getString, and disabled the store a copy on form option and left the automatically retrieve data option enabled.
Next i went to the form open options and set the following actions:
1 - Query data using a web service: getString
2 - set a fields value: test-string-text-box = result of the getString web service retrieval.
I converted the data connection to a UCDX file and tried both link type relative and link type store options, approving the UDCX files and uploading them to the central data connection store.
Lastly i pulbished the form as a content type to a MOSS 2007 sharepoint library.
When i open the form in a web browser it does not set the value of the text box to the result of the get string command.
I have no idea what the problem is, any suggestions?
Thanks in advance.
If i use the infopath client to open the form the data is displayed in the field that i have bound the web service result to. I am guessing this means the web service is being invoked.
I have also tried adding a refresh button to the form and tried to set the values after opening the form and this is also not working.
Thanks for your reply.
Have you found a solution to this problem yet? I am having a problems with a secondary data connection not working in the browser as well. The first problem I had was solved by adding the username and password to the .udcx file as follows:
<udc: Password>Password</udc: Password>
"There is no space between the <udc: Password> above, but if I don't add the space, then a smiley face appears
This section will replace the existing udc:Authentication section of the file.
Unfortunately, this approach did not solve my second problem. I think the second problem has to do with the code I am using behind the form. Keep up with my other post if you would like: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2383548&SiteID=1
Anyway, try my first fix to see if it is Authentication related and hopefully it will help point you in the right direction.
Here is a sample UDC file for readonly type of web service. Hope this helps....Code Snippet
<?xml version="1.0" encoding="UTF-8"?>
<udc:DataSource MajorVersion="2" MinorVersion="0" xmlns:udc="http://schemas.microsoft.com/office/infopath/2006/udc">
<udc:Description>Format: UDC V2; Connection Type: WebService; Purpose: ReadOnly;</udc:Description>
<udc:Type MajorVersion="2" MinorVersion="0" Type="WebService">
<udc:SubType MajorVersion="0" MinorVersion="0" Type=""/>
<udc:FileName>Specify a filename or formula</udc:FileName>