diff options
| -rw-r--r-- | lasso/xml/disco_description.c | 46 | ||||
| -rw-r--r-- | lasso/xml/disco_description.h | 18 | ||||
| -rw-r--r-- | swig/Lasso-wsf.i | 27 |
3 files changed, 72 insertions, 19 deletions
diff --git a/lasso/xml/disco_description.c b/lasso/xml/disco_description.c index 59213ac1..f19ab21a 100644 --- a/lasso/xml/disco_description.c +++ b/lasso/xml/disco_description.c @@ -127,26 +127,54 @@ lasso_disco_description_get_type() } LassoDiscoDescription* -lasso_disco_description_new(const gchar *securityMechID, - const gchar *wsdlURI, - const gchar *serviceNameRef, - const gchar *endpoint, - const gchar *soapAction) +lasso_disco_description_new() +{ + LassoDiscoDescription *description; + + description = g_object_new(LASSO_TYPE_DISCO_DESCRIPTION, NULL); + + return description; +} + +LassoDiscoDescription* +lasso_disco_description_new_with_WsdlRef(const gchar *securityMechID, + const gchar *wsdlURI, + const gchar *serviceNameRef) { LassoDiscoDescription *description; g_return_val_if_fail(securityMechID != NULL, NULL); - g_return_val_if_fail((wsdlURI != NULL && serviceNameRef != NULL) || endpoint != NULL, NULL); - /* SoapAction is associated with Endpoint but optional */ - + g_return_val_if_fail(wsdlURI != NULL, NULL); + g_return_val_if_fail(serviceNameRef != NULL, NULL); + description = g_object_new(LASSO_TYPE_DISCO_DESCRIPTION, NULL); description->SecurityMechID = g_list_append(description->SecurityMechID, g_strdup(securityMechID)); description->WsdlURI = g_strdup(wsdlURI); description->ServiceNameRef = g_strdup(serviceNameRef); + + return description; +} + +LassoDiscoDescription* +lasso_disco_description_new_with_BriefSoapHttpDescription(const gchar *securityMechID, + const gchar *endpoint, + const gchar *soapAction) +{ + LassoDiscoDescription *description; + + g_return_val_if_fail(securityMechID != NULL, NULL); + g_return_val_if_fail(endpoint != NULL, NULL); + + description = g_object_new(LASSO_TYPE_DISCO_DESCRIPTION, NULL); + + description->SecurityMechID = g_list_append(description->SecurityMechID, + g_strdup(securityMechID)); description->Endpoint = g_strdup(endpoint); - description->SoapAction = g_strdup(soapAction); + if (soapAction != NULL) { + description->SoapAction = g_strdup(soapAction); + } return description; } diff --git a/lasso/xml/disco_description.h b/lasso/xml/disco_description.h index e1f9fdf5..f1966fc4 100644 --- a/lasso/xml/disco_description.h +++ b/lasso/xml/disco_description.h @@ -77,13 +77,19 @@ struct _LassoDiscoDescriptionClass { LassoNodeClass parent; }; -LASSO_EXPORT GType lasso_disco_description_get_type (void); +LASSO_EXPORT GType lasso_disco_description_get_type (void); -LASSO_EXPORT LassoDiscoDescription* lasso_disco_description_new (const gchar *securityMechID, - const gchar *wsdlURI, - const gchar *serviceNameRef, - const gchar *endpoint, - const gchar *soapAction); +LASSO_EXPORT LassoDiscoDescription* lasso_disco_description_new(); + +LASSO_EXPORT LassoDiscoDescription* lasso_disco_description_new_with_WsdlRef( + const gchar *securityMechID, + const gchar *wsdlURI, + const gchar *serviceNameRef); + +LASSO_EXPORT LassoDiscoDescription* lasso_disco_description_new_with_BriefSoapHttpDescription( + const gchar *securityMechID, + const gchar *endpoint, + const gchar *soapAction); #ifdef __cplusplus } diff --git a/swig/Lasso-wsf.i b/swig/Lasso-wsf.i index 42161627..97b81a6e 100644 --- a/swig/Lasso-wsf.i +++ b/swig/Lasso-wsf.i @@ -86,7 +86,7 @@ LassoSoapEnvelope *lasso_soap_envelope_new_from_message(char *message); /* Liberty Security Mechanisms */ #ifndef SWIGPHP4 -%rename(SECURITY_MECH_NULL) LASSO_SECURITY_NULL; +%rename(SECURITY_MECH_NULL) LASSO_SECURITY_MECH_NULL; %rename(SECURITY_MECH_X509) LASSO_SECURITY_MECH_X509; %rename(SECURITY_MECH_SAML) LASSO_SECURITY_MECH_SAML; @@ -645,12 +645,20 @@ typedef struct { /* Constructor, Destructor & Static Methods */ - LassoDiscoDescription( - char *securityMechID, char *wsdlURI, char *serviceNameRef, - char *endpoint, char *soapAction); + LassoDiscoDescription(); ~LassoDiscoDescription(); + %newobject newWithWsdlRef; + static LassoDiscoDescription *newWithWsdlRef(gchar *securityMechID, + gchar *wsdlURI, + gchar *serviceNameRef); + + %newobject newWithBriefSoapHttpDescription; + static LassoDiscoDescription *newWithBriefSoapHttpDescription(gchar *securityMechID, + gchar *endpoint, + gchar *soapAction = NULL); + /* Methods inherited from LassoNode */ %newobject dump; @@ -674,6 +682,17 @@ typedef struct { #define LassoDiscoDescription_SecurityMechID_set(self, value) set_string_list(&(self)->SecurityMechID, (value)) /* Constructors, destructors & static methods implementations */ +#ifdef PHP_VERSION +#define LassoDiscoDescription_newWithWsdlRef lasso_disco_description_new_with_WsdlRef +#else +#define DiscoDescription_newWithWsdlRef lasso_disco_description_new_with_WsdlRef +#endif + +#ifdef PHP_VERSION +#define LassoDiscoDescription_newWithBriefSoapHttpDescription lasso_disco_description_new_with_BriefSoapHttpDescription +#else +#define DiscoDescription_newWithBriefSoapHttpDescription lasso_disco_description_new_with_BriefSoapHttpDescription +#endif #define new_LassoDiscoDescription lasso_disco_description_new #define delete_LassoDiscoDescription(self) lasso_node_destroy(LASSO_NODE(self)) |
