Add teardown SOAP request and fix param name
This commit is contained in:
parent
89547e1b67
commit
38b8207f0b
@ -45,7 +45,7 @@ static int ac_backend_soap_join(int forcereset) {
|
||||
if (!g_ac_backend.endthread) {
|
||||
request = ac_soapclient_create_request("joinBackend", SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "acid", g_ac.backendacid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idac", g_ac.backendacid);
|
||||
ac_soapclient_add_param(request, "xs:string", "version", g_ac.backendversion);
|
||||
ac_soapclient_add_param(request, "xs:boolean", "forcereset", (forcereset ? "true" : "false"));
|
||||
g_ac_backend.soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
@ -114,7 +114,7 @@ static int ac_backend_soap_waitevent(void) {
|
||||
if (!g_ac_backend.endthread) {
|
||||
request = ac_soapclient_create_request("waitBackendEvent", SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "sessionid", g_ac.backendsessionid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idsession", g_ac.backendsessionid);
|
||||
g_ac_backend.soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
|
||||
/* Change result timeout */
|
||||
@ -181,7 +181,7 @@ static void ac_backend_soap_leave(void) {
|
||||
/* Build Soap Request */
|
||||
request = ac_soapclient_create_request("leaveBackend", SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "sessionid", g_ac.backendsessionid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idsession", g_ac.backendsessionid);
|
||||
g_ac_backend.soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,19 @@
|
||||
|
||||
/* */
|
||||
static int ac_dfa_state_join_check_authorizejoin(struct ac_session_t* session, struct ac_soap_response* response) {
|
||||
if (response->responsecode != HTTP_RESULT_OK) {
|
||||
xmlChar* xmlResult;
|
||||
|
||||
if ((response->responsecode != HTTP_RESULT_OK) || !response->xmlResponseReturn) {
|
||||
/* TODO: check return failed code */
|
||||
return CAPWAP_RESULTCODE_JOIN_FAILURE_UNKNOWN_SOURCE;
|
||||
}
|
||||
|
||||
// Check return value
|
||||
xmlResult = xmlNodeGetContent(response->xmlResponseReturn);
|
||||
if (xmlStrcmp(xmlResult, (const xmlChar *)"true")) {
|
||||
return CAPWAP_RESULTCODE_JOIN_FAILURE_UNKNOWN_SOURCE;
|
||||
}
|
||||
|
||||
return CAPWAP_RESULTCODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,14 @@ int ac_dfa_state_teardown(struct ac_session_t* session, struct capwap_parsed_pac
|
||||
ASSERT(session != NULL);
|
||||
ASSERT(packet == NULL);
|
||||
|
||||
// Notify teardown session
|
||||
if (session->wtpid) {
|
||||
struct ac_soap_response* response = ac_soap_teardownevent(session, session->wtpid);
|
||||
if (response) {
|
||||
ac_soapclient_free_response(response);
|
||||
}
|
||||
}
|
||||
|
||||
/* Defered free resource */
|
||||
ac_dfa_change_state(session, CAPWAP_DEAD_STATE);
|
||||
return AC_DFA_DROP_PACKET;
|
||||
|
@ -806,7 +806,7 @@ struct ac_soap_response* ac_session_send_soap_request(struct ac_session_t* sessi
|
||||
/* Build Soap Request */
|
||||
request = ac_soapclient_create_request(method, SOAP_NAMESPACE_URI);
|
||||
if (request) {
|
||||
ac_soapclient_add_param(request, "xs:string", "sessionid", g_ac.backendsessionid);
|
||||
ac_soapclient_add_param(request, "xs:string", "idsession", g_ac.backendsessionid);
|
||||
session->soaprequest = ac_soapclient_prepare_request(request, server);
|
||||
}
|
||||
|
||||
|
@ -137,10 +137,11 @@ int ac_dfa_state_dead(struct ac_session_t* session, struct capwap_parsed_packet*
|
||||
|
||||
/* Soap function */
|
||||
struct ac_soap_response* ac_session_send_soap_request(struct ac_session_t* session, char* method, int numparam, ...);
|
||||
#define ac_soap_authorizejoin(s, wtpid) ac_session_send_soap_request((s), "authorizeJoin", 1, "xs:string", "wtpid", wtpid)
|
||||
#define ac_soap_joinevent(s, wtpid, joinparam) ac_session_send_soap_request((s), "joinEvent", 2, "xs:string", "wtpid", wtpid, "xs:base64Binary", "join", joinparam)
|
||||
#define ac_soap_configurestatusevent(s, wtpid, confstatusparam) ac_session_send_soap_request((s), "configureStatusEvent", 2, "xs:string", "wtpid", wtpid, "xs:base64Binary", "confstatus", confstatusparam)
|
||||
#define ac_soap_changestateevent(s, wtpid, changestateparam) ac_session_send_soap_request((s), "changeStateEvent", 2, "xs:string", "wtpid", wtpid, "xs:base64Binary", "changestate", changestateparam)
|
||||
#define ac_soap_runningevent(s, wtpid) ac_session_send_soap_request((s), "runningEvent", 1, "xs:string", "wtpid", wtpid)
|
||||
#define ac_soap_authorizejoin(s, wtpid) ac_session_send_soap_request((s), "authorizeJoin", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_joinevent(s, wtpid, joinparam) ac_session_send_soap_request((s), "joinEvent", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "join", joinparam)
|
||||
#define ac_soap_configurestatusevent(s, wtpid, confstatusparam) ac_session_send_soap_request((s), "configureStatusEvent", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "confstatus", confstatusparam)
|
||||
#define ac_soap_changestateevent(s, wtpid, changestateparam) ac_session_send_soap_request((s), "changeStateEvent", 2, "xs:string", "idwtp", wtpid, "xs:base64Binary", "changestate", changestateparam)
|
||||
#define ac_soap_runningevent(s, wtpid) ac_session_send_soap_request((s), "runningEvent", 1, "xs:string", "idwtp", wtpid)
|
||||
#define ac_soap_teardownevent(s, wtpid) ac_session_send_soap_request((s), "teardownEvent", 1, "xs:string", "idwtp", wtpid)
|
||||
|
||||
#endif /* __AC_SESSION_HEADER__ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
<xs:schema targetNamespace="http://smartcapwap/namespace" elementFormDefault="qualified"/>
|
||||
</wsdl:types>
|
||||
<wsdl:message name="joinBackend">
|
||||
<wsdl:part name="acid" type="xs:string"/>
|
||||
<wsdl:part name="idac" type="xs:string"/>
|
||||
<wsdl:part name="version" type="xs:string"/>
|
||||
<wsdl:part name="forcereset" type="xs:boolean"/>
|
||||
</wsdl:message>
|
||||
@ -13,51 +13,58 @@
|
||||
<wsdl:part name="return" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="leaveBackend">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="leaveBackendResponse"/>
|
||||
<wsdl:message name="waitBackendEvent">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="waitBackendEventResponse">
|
||||
<wsdl:part name="return" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="authorizeJoin">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="wtpid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
<wsdl:part name="idwtp" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="authorizeJoinResponse">
|
||||
<wsdl:part name="return" type="xs:boolean"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="authorizeJoinResponse"/>
|
||||
<wsdl:message name="waitBackendEventFault"/>
|
||||
<wsdl:message name="authorizeJoinFault"/>
|
||||
<wsdl:message name="configureStatusEvent">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="wtpid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
<wsdl:part name="idwtp" type="xs:string"/>
|
||||
<wsdl:part name="confstatus" type="xs:base64Binary"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="joinEvent">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="wtpid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
<wsdl:part name="idwtp" type="xs:string"/>
|
||||
<wsdl:part name="join" type="xs:base64Binary"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="configureStatusEventResponse">
|
||||
<wsdl:part name="return" type="xs:base64Binary"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="changeStateEvent">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="wtpid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
<wsdl:part name="idwtp" type="xs:string"/>
|
||||
<wsdl:part name="changestate" type="xs:base64Binary"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="changeStateEventResponse">
|
||||
<wsdl:part name="return" type="xs:base64Binary"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="runningEvent">
|
||||
<wsdl:part name="sessionid" type="xs:string"/>
|
||||
<wsdl:part name="wtpid" type="xs:string"/>
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
<wsdl:part name="idwtp" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="runningEventResponse"/>
|
||||
<wsdl:message name="joinEventResponse">
|
||||
<wsdl:part name="return" type="xs:base64Binary"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="teardownEvent">
|
||||
<wsdl:part name="idsession" type="xs:string"/>
|
||||
<wsdl:part name="idwtp" type="xs:string"/>
|
||||
</wsdl:message>
|
||||
<wsdl:message name="teardownEventResponse"/>
|
||||
<wsdl:portType name="Presence">
|
||||
<wsdl:operation name="joinBackend">
|
||||
<wsdl:input message="tns:joinBackend"/>
|
||||
@ -95,6 +102,10 @@
|
||||
<wsdl:input message="tns:runningEvent"/>
|
||||
<wsdl:output message="tns:runningEventResponse"/>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="teardownEvent">
|
||||
<wsdl:input message="tns:teardownEvent"/>
|
||||
<wsdl:output message="tns:teardownEventResponse"/>
|
||||
</wsdl:operation>
|
||||
</wsdl:portType>
|
||||
<wsdl:binding name="Presence" type="tns:Presence">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
@ -176,6 +187,15 @@
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
<wsdl:operation name="teardownEvent">
|
||||
<soap:operation soapAction=""/>
|
||||
<wsdl:input>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:input>
|
||||
<wsdl:output>
|
||||
<soap:body use="literal"/>
|
||||
</wsdl:output>
|
||||
</wsdl:operation>
|
||||
</wsdl:binding>
|
||||
<wsdl:service name="SmartCAPWAP">
|
||||
<wsdl:port name="presence" binding="tns:Presence">
|
||||
|
Loading…
Reference in New Issue
Block a user