Introduction
The CoreSoapApiWrapper was created to be a wrapper around making DNA Soap requests.
Setting up Soap Request
- Create controller class and desired endpoint(s).
- Create service class and methods.
- 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.
- Create appropriate controller, service, and data access unit tests.
CoreSoapRequest
The CoreSoapRequest was created to help handle soap request with the following 3 methods.
- 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.
- SubmitRequests - Takes in a List generic and outputs a List 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.
- 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.
- CreateTransactionInput - There is two CreateTransactionInput methods one takes in a TRequest that calls the second that takes in a List. The TransactionInput models holds the authentication and request. This method helps compile all the required elements.
- 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.
- DirectSSORequest - Makes SSOTicket Request.
- RequestWhoIsToken - Uses SSOTicket to get the WhoIsToken.
- 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.