Extract a binary file that has been transmitted in base64 using xml.
Parameters:
format can be an extension or a full filename (only jpeg/gif/png/bmp/pdf have previews)
- base64_string
- format
_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” )
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_delimiterreturns 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=-” )
Note: in the following 4, 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” )
We added this function in 3.0 to allow for a seamless transition for developers when hosting files on server. This also fixed a number of schema related issues when loading a WSDL.
IMPORTANT: We recommended this method to load all WSDLs moving forward.
Example with WSDL: http://wslite.strikeiron.com/zipcodeinfolite01/ZIPCodeInfoLite.asmx?WSDL
_FmNx_Load_WSDL_From_URL( "DEMO"; WSDL_URL )
Returns the name of the WSDL and all of the function prototypes
Loaded: DEMO
DEMO_GetAllStatuses
DEMO_GetRemainingHits
DEMO_GetServiceInfo
DEMO_GetZIPCodeInfo( GetZIPCodeInfo_ZIPCode )
Note: If you try to create more functions for an already existing WSDL name an error will be generated.
ERROR: a service by that name already exists.
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.
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: _FmNx_Register( "WEB-2.0-YWXL-LTL1-Y9UI-T17F1"; "FM Nexus" )
Result: Returns "Success" if valid and "Error: Invalid license number or owner name"
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 preferences
Keys that can be set are:
verbose (change in version 3.0) will always log to the console on the Mac. On windows set verbose equal to a file path of a file where you want to have your requests logged to. Incoming and outgoing requests will then be written to that log file. Note that this is not a persistent value you will have to reset it with every launch.
Example: _FmNx_SetPref( "verbose=C:WebServicesLog.txt" ) // windows only - mac just open the console see the requests
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" )
proxy_user sets the proxy_user to the sting you have specified.
Example: _FmNx_SetPref( "proxy_user=ABC" )
proxy_password sets the proxy_password to the string you have specified.
Example: _FmNx_SetPref( "proxy_user=XYZ" )
wsdl:http_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. Note: Also changed the name of the name value pair from wsdl:user version 2.0 to wsdl:http_user in version 3.0 functionality stayed the same.
Example: _FmNx_SetPref( "wsdl:http_user= abc:tony" )
// "abc" is the name of the WSDL, and "tony" is the user name
wsdl:http_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. Note: Also changed the name of the name value pair from wsdl:password version 2.0 to wsdl:http_password in version 3.0 functionality stayed the same.
Example: _FmNx_SetPref( "wsdl:http_password=abc:top_secret_password" )
// "abc" is the name of the WSDL, and "top_secret_password" is the password
wsdl:http_timeout sets the timeout value in seconds. Note: Also changed the name of the name value pair from wsdl:password version 2.0 to wsdl:http_password in version 3.0 functionality stayed the same.
Example: _FmNx_SetPref( "wsdl:http_timeout=abc:10" )
// "abc" is the name of the WSDL, and the timeout is set to 10 seconds.
wsdl:http_strict_ssl Set to TRUE or FASLE to indicate where you want your requests sent securely or not. This is a new preference in version 3.0.
Example: _FmNx_SetPref( "wsdl:http_strict_ssl=TRUE" )
// This will enforce that all transactions are sent securely.
default_encoding Set the default encoding that what you would like it to be. New preference in version 3.0.
Example: _FmNx_SetPref( "default_encoding=UTF-8" )
param_delimiter Set the parameter delimiter that what you would like it to be. New preference in version 3.0.
Example: _FmNx_SetPref( "param_delimeter=-" )
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...
Parameters:
- URL
- header
This function returns...
Parameters:
- URL
- format
- header
// format can be jpeg/gif/png/bmp/pdf/txt
This function allows you to post raw data. and get the results back in a number of formats.
Parameters:
Example: _FmNx_HTTP_POST( "http://somedomain.com/something/" "My data"; "txt"; "true"; "MyUser"; "MyPassword")
This function returns...
Parameters:
- URL
- put_data
- header
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