SophiaFramework UNIVERSE 5.3 |
Caution | |
---|---|
This class does not support WSDL 1.1 completely. |
SFXSOAPServiceProxy is the class for accessing the Web service using the WSDL document.
About Web Services Description Language ( WSDL ) | |
---|---|
W3C WSDL 1.1 : Web Services Description Language ( WSDL ) 1.1 ( WSDL 1.1 is supported) |
Example 839. The method to call the web service using the SFXSOAPServiceProxy class for WSDL
SFXSOAPServiceProxy _wsdl; // variable for creating proxy and performing dynamic binding using the WSDL document // set callback function to be notified of having received result from web server _wsdl.SetNotifyHandler(OnResultSHP, this); // set WSDL document if (_wsdl.SetWSDLDocument(SFXPath("weatherbycity2.xml")) == SFERR_NO_ERROR) { // set name of web service _wsdl.SetServiceName("WeatherByCity"); // set port name of web service _wsdl.SetPortName("WeatherByCitySoap"); // set method name of web service _wsdl.SetMethodName("GetWeatherByCity"); // set values to parameters of web service // set user properties for web service _wsdl.SetParameterValue("UserID", SFXBuffer(SFXAnsiString("sophia@s-cradle.com"))); _wsdl.SetParameterValue("Password", SFXBuffer(SFXAnsiString("*******"))); // set parameters for web service _wsdl.SetParameterValue("CityName", SFXBuffer(SFXAnsiString("Washington"))); _wsdl.SetParameterValue("StateAbbreviationORCountryName", SFXBuffer(SFXAnsiString("PA"))); // call web service _wsdl.Invoke(); }
SFXSOAPWriter | SFXSOAPParser | SFXSOAPRPC | SFXXMLDOMParser
Constructor/Destructor |
---|
SFXSOAPServiceProxy( Void ) Constructor of the SFXSOAPServiceProxy class.
|
SFXSOAPServiceProxy(
SFXAnsiStringConstRef wsdl
) Constructor of the SFXSOAPServiceProxy class.
|
SFXSOAPServiceProxy(
SFXAnsiStringConstRef wsdl
, SFXAnsiStringConstRef service
, SFXAnsiStringConstRef port
, SFXAnsiStringConstRef method
) Constructor of the SFXSOAPServiceProxy class.
|
~SFXSOAPServiceProxy( Void ) Desctructor of SFXSOAPServiceProxy.
|
Public Functions | |
---|---|
Void |
Cancel( Void ) Cancel the SOAP communication.
|
ACharConstPtr |
GetMethodName( Void ) Get the method name of the web service.
|
ACharConstPtr |
GetPortName( Void ) Get the port name of the web service.
|
const SFXSOAPRPC::LPPARAMETER |
GetResultValueByName(
SFXAnsiStringConstRef name
) Get the return value of the specified parameter.
|
ParamsConstPtr |
GetResultValues( Void ) Get the array of the output parameters.
|
ACharConstPtr |
GetServiceName( Void ) Get the name of the web service.
|
UInt32 |
GetTrustMode( Void ) Get the SSL trust mode
|
SFCError |
Invoke(
NotifySPP spp = null
, VoidPtr reference = null
) Call the method of the web service.
|
Bool |
IsConnecting( Void ) Check whether or not to be connected to the server.
|
Void |
Reset( Void ) Reset all the internal variables.
|
SFCError |
SetMethodAttribute(
SFXAnsiStringConstRef name
, SFXAnsiStringConstRef value
) Set the attribute to the method of the web service.
|
Void |
SetMethodName(
SFXAnsiStringConstRef method
) Set the method name of the web service .
|
Void |
SetNotifyHandler(
SFXSOAPRPC::NotifySPP spp
, VoidPtr reference
) Set the callback function to be notified of the return value.
|
SFCError |
SetParameterValue(
SFXAnsiStringConstRef name
, SFXBufferConstRef value
, SFXPropertyConstRef attribute = SFXProperty::EmptyInstance()
) Set the content of the parameter and its attributes.
|
Void |
SetPortName(
SFXAnsiStringConstRef port
) Set the port name of the web service.
|
Void |
SetServiceName(
SFXAnsiStringConstRef service
) Set the name of the web service.
|
Void |
SetTrustMode(
UInt32 param
) Set the SSL trust mode.
|
SFCError |
SetWSDLDocument(
SFXAnsiStringConstRef wsdl
) Set the WSDL document.
|
SFCError |
SetWSDLDocument(
SFXPathConstRef wsdl
) Set the WSDL document.
|
[ public, explicit ] SFXSOAPServiceProxy(Void);
[ public, explicit ] SFXSOAPServiceProxy( SFXAnsiStringConstRef wsdl );
[ public, explicit ] SFXSOAPServiceProxy( SFXAnsiStringConstRef wsdl // name of the WSDL document SFXAnsiStringConstRef service // name of web service SFXAnsiStringConstRef port // port name SFXAnsiStringConstRef method // method name );
[ public ] ~SFXSOAPServiceProxy(Void);
[ public ] Void Cancel(Void);
[ public, const ] ACharConstPtr GetMethodName(Void);
[ public, const ] ACharConstPtr GetPortName(Void);
[ public, const ] const SFXSOAPRPC::LPPARAMETER GetResultValueByName( SFXAnsiStringConstRef name // name of parameter );
[ public, const ] ParamsConstPtr GetResultValues(Void);
Array of the output parameters of the SFXSOAPRPC::LPPARAMETER type(SFXSOAPRPC::Params).
This function gets the array of the output parameters of the SFXSOAPRPC::LPPARAMETER type(SFXSOAPRPC::Params).
Note | |
---|---|
SFXSOAPRPC::LPPARAMETER is the type of pointer to the SFXSOAPRPC::PARAMETER structure. |
SFXSOAPServiceProxy _wsdl; // SFXSOAPServiceProxy object SFXSOAPRPC::ParamsConstPtr lp; lp = _wsdl.GetResultValues(); // get list of output parameters SFXSOAPRPC::LPPARAMETER item; item = lp->Get(0); // get first element TRACE("%s",item->_name.GetCString()); // display type of parameter TRACE("%s",item->_value.GetBuffer()); // display value of parameter
SFXSOAPServiceProxy::SetNotifyHandler | SFXSOAPServiceProxy::Invoke | SFXSOAPRPC::Params | SFXSOAPRPC::LPPARAMETER | SFXSOAPRPC::PARAMETER | SFXSOAPRPC::NotifySPP
[ public, const ] ACharConstPtr GetServiceName(Void);
[ public, const ] UInt32 GetTrustMode(Void);
The SSL trust mode can be one of the following values.
Note | |
---|---|
Reference: ISSL_NegotiateV in the BREW API Reference |
[ public ] SFCError Invoke( NotifySPP spp = null // callback function(Default: null) VoidPtr reference = null // data passed to the callback function(Default: null) );
The errors on the WSDL document is as follows:
Reference: SFCErrorEnum
SFXSOAPServiceProxy::SFXSOAPServiceProxy | SFXSOAPServiceProxy::SetTrustMode | SFXSOAPServiceProxy::SetNotifyHandler | SFXSOAPServiceProxy::SetWSDLDocument | SFXSOAPServiceProxy::SetServiceName | SFXSOAPServiceProxy::SetPortName | SFXSOAPServiceProxy::SetMethodName | SFXSOAPServiceProxy::SetMethodAttribute | SFXSOAPServiceProxy::SetParameterValue | SFXSOAPServiceProxy::GetResultValueByName | SFXSOAPRPC::Invoke | SFXSOAPServiceProxy::IsConnecting | SFXHTTPConnection::SetTrustMode | SFXHTTPConnection::Connect | SFXSOAPRPC | SFCErrorEnum
[ public, const ] Bool IsConnecting(Void);
[ public ] Void Reset(Void);
[ public ] SFCError SetMethodAttribute( SFXAnsiStringConstRef name // name of attribute SFXAnsiStringConstRef value // value of attribute );
[ public ] Void SetMethodName( SFXAnsiStringConstRef method // method name );
[ public ] Void SetNotifyHandler( SFXSOAPRPC::NotifySPP spp // callback function VoidPtr reference // data passed to callback function );
[ public ] SFCError SetParameterValue( SFXAnsiStringConstRef name // name of parameter SFXBufferConstRef value // value of parameter SFXPropertyConstRef attribute = SFXProperty::EmptyInstance() // attributes(pairs of an attribute name and its value) );
[ public ] Void SetPortName( SFXAnsiStringConstRef port // port name );
[ public ] Void SetServiceName( SFXAnsiStringConstRef service // name of the web service );
One of the following values are available for the SSL trust mode:
Note | |
---|---|
Reference: ISSL_NegotiateV in the BREW API Reference |
[ public ] SFCError SetWSDLDocument( SFXAnsiStringConstRef wsdl // WSDL document );
[ public ] SFCError SetWSDLDocument( SFXPathConstRef wsdl // file path );
The error codes that may occur when parsing a SOAP document are as follows:
Reference: SFCErrorEnum
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |