Upload
damian-parrish
View
217
Download
1
Embed Size (px)
Citation preview
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SSDG Connector sin
.Net
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP GenericApplication Specific
SPGeneric Application Specific
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connectors
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Generic SAP API
SubmitRequest() - This function should be used for making initial request to SSDG for availing a service.DocumentPoll() – This function is used to check the status of the request which has been submitted through asynchronous mode.DocumentDelete() –This function is used to delete the request and response which have already been fulfilled successfully.DocumentList() – It helps in getting the status of all the requests submitted to SSDG during a particular period.
Note: Only SubmitRequest() is used for Synchronous as well as asynchronous Requests while all the other functions will use Synchronous based requests only.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Generic Responses
Success Status –Actual Response
Failed Status
Resubmit
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : ClassValue
Data Type : String
Mandatory : YES (for all functions)
Description :Service ID of the service registered at gateway.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name :TransactionId
Data Type : String
Mandatory : Optional (Depends on the SAP Application Specific Connector)
Description :Used by the SAP application to club multiple Submit Request into single transaction.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : BodyContent
Data Type : XMLElement[ ]
Mandatory : YES (for SubmitRequest() )
Description : Payload or body content. SAP and SP must adhere to the schema of payload.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : CorrelationID
Data Type : String (32 bit character value)
Mandatory : YES (for functions DocumentPoll(), DocumentDelete() )
Description : Unique identifier of the message received from gateway.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : ResponseMode
Data Type : Enum
Mandatory : YES (for all functions)
Description :Response mode specifies the type of communication needed by Service.
ASYNCHRONOUSSYNCHRONOUS
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : SenderID
Data Type : String
Mandatory : YES(for SubmitRequest() and DocumentList() methods only)
Description :User Id of SAP for authentication at gateway.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name :Password
Data Type : String
Mandatory : YES (Required in SubmitRequest() and DocumentList() methods only)
Description :Password to authenticate SAP.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name :TargetEndpoint
Data Type : String
Mandatory : YES (for all functions)
Description :URL of the Gateway.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : AuthMode
Data Type : Enum
Mandatory : YES ( Required in SubmitRequest() and DocumentList() methods only. )
Description : Indicates how the SAP will be authenticated to gateway. There are three types of Authentication Modes
Clear -AuthMode.ClearSHA-1-AuthMode.SHA1;W3C signed-AuthMode.W3CSigned
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
SAP Generic Connector Elements
Element Name : SignedAuthentication
Data Type : Enum
Mandatory : OptionalDescription : Indicates whether the payload
should be signed or not.False –indicates payload should not be signed.
True-SAP will sign payload and signature verification of payload should be done by SP.
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Sequences
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Synchronous Submit Request from
SAP to SP
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Synchronous Submit RequestSynchronous Submit Request from SAPfrom SAP
SAP (portal) Gateway SP( Back off )
synSubmitRequest()
Synchronous Response
Synchronous Response
SubmitRequest()
ConnectorInterface inter = new ConnectorInterface ( );
//Optional Field set by Client
inter.TransactionId = "12345678912345678912345678912345";
inter .CorrelationID = "";
//Type of Service Requested i.e. Synchronous
inter.ResponseMode = ResponseMode.Synchronous;
//Valid Service Class
inter.ClassValue = "http://127.0.0.1/22";
//Address of SSDG
inter.TargetEndPoint="http://nsdg.staging.cdacmumbai.in/gateway/services/NSDGService";
//Authentication Details received after registration of SAP
inter.AuthMode = AuthMode.Clear;
inter.SenderID = "SAP130720081454";
inter.Password = "[B@13a87a0";
XmlElement[] body =Body received from SAP Application Specific Connector ;
inter.BodyContent = body;
//Calling of SSDG through Generic Connector API
ConnectorInterface.SubmitRequest(ref inter);
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Synchronous Response for Synchronous submit request
Gateway SP Generic Connector
SP Application Specific Connector
synSubmitRequest()
Sending Submit ResponseSending Submit Response
public void synSubmitRequest ( ref SPInterface interfaceSP )
{
//Retrieving the Values received from SAP through SSDG
XmlElement[] bodyArr = new XmlElement[1];
bodyArr = interfaceSP .Body;
//Processing of Body is done by SP application Specific Connector
//Business logic of body processing will come here
interfaceSP.Body[0] = bodyArr[0];
interfaceSP.SubmissionStatus = "response";
}
{
//If the content received in the body is incorrect. Also set the
body as per schema of Error giving the reason for the error.
setProperties .SubmissionStatus = "error";
}
SubmitRequest()
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Submit Response send to SAP
SAP (portal) Gateway SP( Back off )
synSubmitRequest()
Synchronous Response /ErrorSynchronous Response/Error
SubmitRequest()
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Submit Response
SAP (portal) Gateway
Synchronous Response
//If Status is error
string errorCode = inter .ErrorCode;
string[] errorList=new string[1];
XmlElement[] bodyArr = new XmlElement[1];
errorList = inter .ErrorList;
string error=null;
if ( errorList != null )
{ error = errorList [ 0 ]; }
//Receiving Result
string status= inter.SubmissionStatus;
//if status is response
string corrID=inter.CorrelationID;
string classID = inter.ClassValue;
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Synchronous SUBMIT_REQUEST
SAP (portal) Gateway SP( Back off )
Synchronous Submit Request
Synchronous Response
Synchronous Response
Synchronous Submit Request
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
ASynchronous Submit Request from
SAP to SP
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Asynchronous Submit Request from SAP
SAP (portal) Gateway SP( Back off )
asynSubmitRequest()
Submit Acknowledgement/ ErrorSubmit Acknowledgement/ Error
SubmitRequest()
ConnectorInterface inter = new ConnectorInterface ( );
//Optional Field set by Client
inter.TransactionId = "12345678912345678912345678912345";
inter .CorrelationID = "";
//Type of Service Requested i.e. Asynchronous
inter.ResponseMode = ResponseMode.ASynchronous;
//Valid Service Class
inter.ClassValue = "http://127.0.0.1/22";
//Address of SSDG
inter.TargetEndPoint="http://nsdg.staging.cdacmumbai.in/gateway/services/NSDGService";
//Authentication Details received after registration of SAP
inter.AuthMode = AuthMode.Clear;
inter.SenderID = "SAP130720081454";
inter.Password = "[B@13a87a0";
XmlElement[] body =Body received from SAP Application Specific Connector;
inter.BodyContent = body;
//Calling of SSDG through Generic Connector API
ConnectorInterface.SubmitRequest(ref inter);
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Submit Acknowledgement send to SAP
SAP (portal) Gateway SP( Back off )
asynSubmitRequest()
Submit Acknowledgement/ ErrorSubmit Acknowledgement/ Error
SubmitRequest()
string status= inter.SubmissionStatus;
//if status is acknowledgement
//Process the ConnectorInterface object
string corrID=inter.CorrelationID;
string classID = inter.ClassValue;
string endPoint = inter .TargetEndPoint;
//If Status is error
string errorCode = inter .ErrorCode;
string[] errorList=new string[1];
XmlElement[] bodyArr = new XmlElement[1];
errorList = inter .ErrorList;
string error=null;
if ( errorList != null )
{ error = errorList [ 0 ]; }
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Submit Poll from SAP
SAP (portal) Gateway SP( Back off )
Document Poll
Submit Response /Submit Acknowledgement
Submit Response /Submit Acknowledgement
DocumentPoll()
ConnectorInterface inter = new ConnectorInterface ( );
inter.TransactionId = "";
//It should contain the value as received in Asynchronous SubmitRequest
inter.CorrelationID = "34E17E40952F4EAEB37E7B1FD7BA67EF";
//Valid Service class
inter.ClassValue = "http://127.0.0.1/22";
//End Point Url of the Gateway where DocumentPoll can be done
inter.TargetEndPoint="http://nsdg.staging.cdacmumbai.in/gateway/services/NSDGService";
inter.DocumentPoll ( ref inter )
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Submit Response Component of SP
SP Generic Connector
SP Application Specific Connector
public void SPResponse ( ref SPInterface interfaceSP )
{
XmlElement[] bodyArr = new XmlElement[1];
interfaceSP.CorrelationID="Value stored in DB from asynchronous request";
interfaceSP.ClassValue=" Value stored in DB from asynchronous request ";
interfaceSP.TargetEndPoint="Address of SSDG";
//Create response in SP Application Specific connector code and write the business logic to store it in bodyArr element
interfaceSP.Body[0] = bodyArr[0];
interfaceSP.SubmissionStatus = "response";
SPImplSoapSoap callResponse = new SPImplSoapSoap ("path of Generic Connector");
callResponse .submitResponse ( ref interfaceSP );
}
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Submit Acknowledgement / Submit Acknowledgement / Submit Response send to SAP from SPSubmit Response send to SAP from SP
SAP (portal) Gateway SP( Back off )
Submit Poll
Submit Response /Submit AcknowledgementSubmit Response /Submit
Acknowledgement
DocumentPoll()
//Actual Response
//Can be retrieved for Business Error and response.
if ( inter.BodyContent != null )
{
element = inter .BodyContent
}
//If Status is error
string errorCode = inter .ErrorCode;
string[] errorList=new string[1];
errorList = inter .ErrorList;
string error=null;
if ( errorList != null )
{
error = errorList [ 0 ];
}
//Receiving Result
string status= inter.SubmissionStatus;
/if status is acknowledgement, it means response is still awaited from SSDG.
string corrID=inter.CorrelationID
//Target End point for the Gateway
string responseEndPoint=inter.TargetEndPoint;
string classId = inter .ClassValue
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Asynchronous CommunicationAsynchronous Communication
SAP (portal) Gateway SP( Back off )
Asynchronous Submit Request
Submit poll
Submit ACKSubmit Response
Submit poll
RESPONSE
Asynchronous Submit Request
Submit ACK
Submit ACK
Submit ACK
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
List Request from SAP List Request from SAP
SAP (portal) Gateway
List Response
DocumentList()
ConnectorInterface inter = new ConnectorInterface ( );
inter .CorrelationID = "";
//Type of Details Requested i.e. Asynchronous or Synchronous
inter .ResponseMode = ResponseMode.Asynchronous;
inter.ClassValue = "http://192.168.0.140/133";
//Address of SSDG
inter .TargetEndPoint = "http://nsdgstaging.cdacmumbai.in/gateway/services/NSDGService";
//Authentication Details received after registration of SAP
inter .AuthMode = AuthMode .Clear;
inter .SenderID = "SAP1238072453839";
inter .Password = "[B@1f19353";
//Prepare Body as List request Schema provided in Manual Appendix
inter.BodyContent = body;
//Calling of SSDG through Generic Connector API
ConnectorInterface .DocumentList (ref inter );
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
List Response From SSDG to SAPList Response From SSDG to SAP
SAP (portal) Gateway
List Response
//Receiving Result
string status = inter .SubmissionStatus;
//if status is response
string corrID=inter.CorrelationID;
string classID = inter .ClassValue;
XmlElement [ ] element=new XmlElement[1] ;
if ( inter .BodyContent != null )
{
//Receive result as per schema mentioned in Manual
element = inter .BodyContent;
}
//in case of error
string errorCode = inter .ErrorCode;
string[] errorList=new string[1];
errorList = inter .ErrorList;
string error=null;
if ( errorList != null )
{
error = errorList [ 0 ];
}
DocumentList()
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Delete Request from SAP Delete Request from SAP
SAP (portal) Gateway
Delete Response / Delete Acknowledgement
DocumentDelete()
ConnectorInterface inter = new ConnectorInterface ( );
inter.TransactionId = "12345678912345678912345678912345";
//or give response as it is optional field
inter.TransactionId = "";
//It should contain the value as received in Asynchronous SubmitRequest
inter.CorrelationID = "34E17E40952F4EAEB37E7B1FD7BA67EF";
//Valid Service Class
inter.ClassValue = "http://127.0.0.1/22";
//End Point Url of the Gateway where DocumentDelete can be done
inter.TargetEndPoint = “http://nsdg.staging.cdacmumbai.in/gateway/services/NSDGService";
inter.DocumentDelete ( ref inter );
©Centre for Development of Advanced Computinghttp://nsdg.gov.in©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Delete Response From SSDG to SAPDelete Response From SSDG to SAP
SAP (portal) Gateway
Delete Response / Delete Acknowledgement
//Receiving Result
string status= inter.SubmissionStatus;
//if status is response
string corrID=inter.CorrelationID;
//Target End point for the Gateway
string responseEndPoint=inter.TargetEndPoint;
string classId = inter .ClassValue;
//If Status is error
string errorCode = inter .ErrorCode;
string[] errorList=new string[1];
errorList = inter .ErrorList;
string error=null
if ( errorList != null )
{
error = errorList [ 0 ];
}
DocumentDelete()
©Centre for Development of Advanced Computinghttp://nsdg.gov.in
Thank You