45 lines
3.4 KiB
Markdown
45 lines
3.4 KiB
Markdown
# Introduction
|
||
The CoreSoapApiWrapper was created to be a wrapper around making DNA Soap requests.
|
||
|
||
# Setting up Soap Request
|
||
1. Create controller class and desired endpoint(s).
|
||
2. Create service class and methods.
|
||
3. Create data access class
|
||
a. Use CoreSoapRequest class to call SubmitRequest or SubmitRequests. These methods take in a generic request(DNA RequestBase Extension) and return the response(DNA ResponseBase Extension). These should be the DNA ServiceReference generated models that extend the RequestBase and ResponseBase.
|
||
4. Create appropriate controller, service, and data access unit tests.
|
||
|
||
# CoreSoapRequest
|
||
The CoreSoapRequest was created to help handle soap request with the following 3 methods.
|
||
1. SubmitRequest - Takes in a TRequest generic and outputs a TResponse generic. The TRequest is an Extension of the DNA model RequestBase and the TResponse is an exention of the ResponseBase. This method will create a transaction input, submit transaction input, and will return TResponse.
|
||
2. SubmitRequests - Takes in a List<TRequest> generic and outputs a List<TResponse> generic. The TRequest is an Extension of the DNA model RequestBase and the TResponse is an extension of the ResponseBase. This method will create a transaction input, submit transaction input, and will return List<TResponse>.
|
||
3. SubmitTransactionInput - Takes a TransactionInput(DNA Model), creates a coreapiServiceclient, SubmitsRequest, handles basic null and authentication errors.
|
||
|
||
# CoreSoapConnection
|
||
The CoreSoapConnection was created for a central location to CreateTransactionInput, GetWhoIsToken, make a DirectSSORequest, make final WhoIsTokenRequest. This is all done to set up the TransactionInput(DNA model) to make soap transactions.
|
||
|
||
1. CreateTransactionInput - There is two CreateTransactionInput methods one takes in a TRequest that calls the second that takes in a List<TRequest>. The TransactionInput models holds the authentication and request. This method helps compile all the required elements.
|
||
2. GetWhoIsToken - top level method that starts the process of getting SSOTicket using a Direct SSOTicket request. Then calling the RequestWhoIsToken that uses the SSOTicket to get the required token.
|
||
3. DirectSSORequest - Makes SSOTicket Request.
|
||
4. RequestWhoIsToken - Uses SSOTicket to get the WhoIsToken.
|
||
5. WhoIsRequest - Makes the request to DNA to get the WhoIsToken.
|
||
|
||
# Generating the DNA ServiceReference.cs
|
||
Note from Fiserv reference: (never had any luck importing a WSDL file using Add Service Reference).
|
||
|
||
The following was performed o generate ServiceReference.
|
||
|
||
Open a “Developer Command Prompt for VS20NN” (Start->Visual Studio NNNN->Developer Command Prompt…)
|
||
|
||
svcutil /out:ServiceReference.cs /config:ServiceReference.config /n:*,YOURNAMESPACE.ServiceReference WSDLPATH\WSDLNAME.wsdl WSDLPATH\*.xsd
|
||
|
||
Where:
|
||
YOURNAMESPACE is the namespace you want to use.
|
||
WSDLPATH is the path to the WSDL files (you could just change to the WSDL folder).
|
||
WSDLNAME is the name of .wsdl file (I think it’s www.opensolutions.com.CoreApi.wsdl).
|
||
|
||
This will result in:
|
||
ServiceReference.cs (you can name something different if you wish) with all the definitions for the web service.
|
||
ServiceReference.config which has app.config entries you can add to your application’s app.config for bindings/endpoints.
|
||
|
||
So, then you can add ServiceReference.cs to your project and update your app.config with appropriate ServiceReference.config entries.
|