Extract a binary file that has been transmitted in base64 using xml.
Parameters:
format
- base64_string
format can be an extension or a full filename (only jpeg/gif/png/bmp/pdf have previews)
_FmNx_Base64Encode( binary_data )
Encode data into base64 to be transmitted to your web service.
Parameters:
encode any binary data which will then allow you to send it over XML.
- binary_data
Preferences have been expanded in 3.0. We have added a few new preferences that you can get. The following preferences are new (proxy_user, proxy_password, wsdl:strict_ssl, default_encoding, and parameter_delimiter).
NOTE: the parameter delimiter cannot contain a colon.
Some functions require authentication headers as part of your request. In this case, you would be setting the user and password information before you execute any other function calls. So lets say you had a wsdl named "TEST" then setting the http password would be done like this:
_FmNx_SetPref( "TEST:http_user=my-user-name" )
If you needed to get what was set in this preference you could then call:
_FmNx_GetPref( "TEST:http_user" ) // the result would be "my-user-name"
If a function requires authentication, and they haven't included authentication parameters in the function you are using, then make certain you have set the username and password with "_FmNx_SetPref" before you executing your function.
Possible keys include:
wsdl_count returns the number of WSDLs installed
Example:
_FmNx_GetPref( “wsdl_count” )Returns 4 if 4 WSDLs were installed
wsdl_names returns the names of all the WSDLs installed
Example:
_FmNx_GetPref( “wsdl_names” )Returns the list of WSDL names (example assumes you have only 4 WSDLs installed)
xQuotesfunction_count returns the number of WSDL functions installed
Demographics
PhoneNotify
SMSNotify
Example:
_FmNx_GetPref( “function_count” )Returns 82 for the 4 WSDLs installed
function_names returns the function names of each installed function
Example:
_FmNx_GetPref( “function_names” )Returns 82 function names
NOTE: the list is reduced to only show a few entries to save space
SMS_GetCountryCodes
xQuotes_GetChartDesign
PhoneNotify_CancelNotify
Demographics_GetIncomeHouseValueByAddress …
function_prototypes returns the function name and parameters of each installed function
Example:
_FmNx_GetPref( “function_prototypes” )Returns 82 function prototypes (and yes those would be 82 new FileMaker functions you could use)
NOTE: the list is reduced to only show a few entries to save space
SMS_GetCountryCodes( EmailAddress; UserID; Password )
PhoneNotify_LM_AddNewList( ListName; ParentListID; LicenseKey )
xQuotes_GetChartDesign( Username; Password; Tracer ) …
verbose returns “true” or “false”. This is helpful when debugging what is sent and returned by the request. On a Mac it can be viewed using the console application. By default this option is set to “true”.
Example:
_FmNx_GetPref( “verbose” )Returns “true” if previously set with
_FmNx_SetPref( “verbose=true” )
host returns the host ip address of request's destination.
Example:
_FmNx_GetPref( “host” )Returns "125.168.26.36” if previously set with
_FmNx_SetPref( “host=125.168.26.36” )port returns the destination port number of the request.
Example:
_FmNx_GetPref( “port” )Returns “591” if previously set with
_FmNx_SetPref( “port=591” )
proxy_user returns the proxy_user that was set.
Example:
_FmNx_GetPref( “proxy_user” )
Returns “TestProxyUser” if previously set with
_FmNx_SetPref( “proxy_user=TestProxyUser” )
proxy_password returns the proxy_password that was set.
Example:
_FmNx_GetPref( “proxy_password” )
Returns “TestProxyPassword” if previously set with
_FmNx_SetPref( “proxy_password=TestProxyPassword” )
Note: in the following 3, you would substitute the WSDL name in the place of “wsdl”
wsdl:http_user – [required format] – returns the user name associated with this WSDL.
Example:
_FmNx_GetPref( “xQuotes:http_user” )Returns “fmnexus” if previously set with
_FmNx_SetPref( “xQuotes:http_user=fmnexus” )wsdl:http_password – [required format] – returns the password associated with this WSDL
Example:
_FmNx_GetPref( “xQuotes:http_password” )Returns “abc123” if is was previously set with
_FmNx_SetPref( “xQuotes:http_password=abc123” )
wsdl:http_timeout – needs to be supplied in this format – returns the timeout value in seconds.
Example:
_FmNx_GetPref( “xQuotes:http_timeout” )Returns “10” if is was previously set with
_FmNx_SetPref( “xQuotes:http_timeout=10” )
wsdl:http_strict_ssl – needs to be supplied in this format – returns true or false.
Example:
_FmNx_GetPref( “xQuotes:http_strict_ssl” )Returns “TRUE” if is was previously set with
_FmNx_SetPref( “xQuotes:http_strict_ssl=TRUE” )default_encoding – returns true or false.
Example:
_FmNx_GetPref( "default_encoding” )Returns “TRUE” if is was previously set with
_FmNx_SetPref( “default_encoding=TRUE” )
param_delimiter – returns the delimiter that was set with "_FmNx_SetPref". Note you cannot user ":"
Example:
_FmNx_GetPref( "param_delimiter” )Returns “-” if is was previously set with
_FmNx_SetPref( “param_delimiter=-” )
This function allows you the ability to dynamically load the WSDL functions. Because you can load the WSDL functions dynamically from fields, you don't need to worry about also distributing the WSDLs to each client. For example you could have a table with 2 fields; the WSDL name, and the WSDL data. Your script could then loop over all these records and automatically load the functions. As soon as you have loaded the functions from the WSDL, they become instantly available in your solution.
Note: the WSDL name can be set to anything you would like it to be. Sometimes it is a good idea to keep it short as there is little space available in the External functions list to view the WSDL name and its function name. But once you have started using the WSDL with the name you have selected, don't change it because your function references will not be able to be resolved. View information about the WSDL used in this example.
Downloadexample file to experiment with this function.
Load_WSDL has 2 parameters:
- wsdl_name: text - the name of the WSDL
- wsdl_document: text - the entire contents of the WSDL you wish to load
Example:
_FmNx_Load_WSDL( “n2t”; WSDL::data )
Result: Loads the following 2 functions as FileMaker native functions - Ready to be used!
n2t_NumberToDollars( NumberToDollars_dNum )
n2t_NumberToWords( NumberToWords_ubiNum )
This function is used to register your FM::Nexus Web Services Plug-in
Register has 2 parameters:
Example:
Result: Returns "Success" if valid and "Error: Invalid license number or owner name"_FmNx_Register( "WEB-2.0-YWXL-LTL1-Y9UI-T17F1"; "FM Nexus" )
This function can be used to load new WSDL functions. Drop a new WSDL file in your WSDL directory (which should be located at the root of your Extensions directory), and call this function to load its functions to become instantly available as FIleMaker native functions. Lets say you wanted to dynamically load the functions available to you from the Demographics WSDL provided by CDYNE.
Important: WSDLs that you put into the WSDL directory should have the extension of .xml or .wsdl
Example:
_FmNx_Reload_All
Result: Returns "Loaded: Demographics" followed by the list of function prototypes.
Set Preferences allow you to set the following perferences
Keys that can be set are:
verbose set to true will output incoming and outgoing requests to the console on the Mac.
Example:
_FmNx_SetPref( "verbose=true" )
host sets the url you would like the transaction to be sent to.
Normally you never have to set this as the WSDL knows where to send the request.
Example:
_FmNx_SetPref( "url=<some url>" )
port sets the port you would like the transaction to be sent to.
Normally you never have to set this as the WSDL knows where to send the request.
Example:
_FmNx_SetPref( "port=591" )
wsdl:user sets user name that will be sent in the headers
Note: some WSDLs require authentication - using set preferences lets you sent the required header attributes.
Example: "abc" is the name of the WSDL, and "tony" is the user name
_FmNx_SetPref( "wsdl:user= abc:tony" )
wsdl:password sets the password that will be sent in the headers
Note: some WSDLs require authentication - using set preferences lets you sent the required header attributes.
Example: "abc" is the name of the WSDL, and "top_secret_password" is the password
_FmNx_SetPref( "wsdl:password=abc:top_secret_password" )
wsdl:timeout sets the timeout value in seconds.
Example: "abc" is the name of the WSDL, and the timeout is set to 10 seconds.
_FmNx_SetPref( "wsdl:timeout=abc:10" )
This function will remove the all the WSDL functions for the specified WSDL
Example:
_FmNx_Unload( "Demographics" )Result: Returns "Unloaded wsdl: Demographics" followed by the list of functions removed.
This function returns the version number of the FM::Nexus Web Service Plug-in.
Example:
_FmNx_Version( "short" )Result: "2.0"
Example:
_FmNx_Version( "long" )Result: "FM.NEXUS - Web Services 2.0"
Comments