Click here to Skip to main content
15,906,333 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: VB 2013 Community (Transparent Text Control) Pin
Eddy Vluggen5-Jan-15 7:17
professionalEddy Vluggen5-Jan-15 7:17 
Questionann Pin
Member 1134553331-Dec-14 8:32
Member 1134553331-Dec-14 8:32 
AnswerRe: ann Pin
Dave Kreskowiak31-Dec-14 15:46
mveDave Kreskowiak31-Dec-14 15:46 
Questionhow to extract a sample from template dpfp visual basic .net 4.0 Pin
Member 1118030631-Dec-14 5:32
Member 1118030631-Dec-14 5:32 
AnswerRe: how to extract a sample from template dpfp visual basic .net 4.0 Pin
Eddy Vluggen5-Jan-15 7:20
professionalEddy Vluggen5-Jan-15 7:20 
Questionfilter records from ms access 2010 by vba Pin
Virendra Singh Bhanu30-Dec-14 16:40
Virendra Singh Bhanu30-Dec-14 16:40 
AnswerRe: filter records from ms access 2010 by vba Pin
Eddy Vluggen5-Jan-15 7:23
professionalEddy Vluggen5-Jan-15 7:23 
QuestionUsing a wsdl with HMAC Pin
jkirkerx30-Dec-14 12:53
professionaljkirkerx30-Dec-14 12:53 
I have this credit card API. You can write your own XML or use their WSDL file, register it as a Web Service. I starting to prefer the first method.

So on the XML, your suppose to generate a request header, then send the XML. Which makes sense to me.

On the WSDL, I have no clue how to do the same thing, of even come up with the search keywords to do research.

I guess my question is what would this be called, keyword suggestions.

Perhaps your thought on the task at hand here. Maybe go recode to XML using my XSD Class, and then use the bottom code.

For some reason, I'm including some code here, the give my question more clarity.

 'Make a tranaction
 Dim txn As New com.firstdata.globalgatewaye4.V14.Transaction

 'Credentials
 txn.ExactID = sCA.Exact_ID
 txn.Password = sCA.Exact_Password

'//////////////////////////////////////////////////////////////////////////////////////
'Transmit the Card Authorization Request

Dim ws As com.firstdata.globalgatewaye4.V14.Service = New com.firstdata.globalgatewaye4.V14.Service
Dim rxn As com.firstdata.globalgatewaye4.V14.TransactionResult = New com.firstdata.globalgatewaye4.V14.TransactionResult
rxn = ws.SendAndCommit(txn)

'//////////////////////////////////////////////////////////////////////////////////////

I started working on this, thinking I could just pass the XML generated from the WSDL to the transmitter, but I'm on the wrong track here.
Private Function transmit_HMAC( _
        ByVal pValue As String) As Integer

        Dim dwExitCode As Integer = 2

        'Generate the Hashed Content
        Dim encoder As ASCIIEncoding = New ASCIIEncoding
        Dim wsdl_bytes() As Byte = encoder.GetBytes(pValue)
        Dim sha1_crypto As SHA1CryptoServiceProvider = New SHA1CryptoServiceProvider
        Dim hash As String = BitConverter.ToString(sha1_crypto.ComputeHash(wsdl_bytes)).Replace("-", "")
        Dim hashed_content As String = hash.ToLower

        'Grab a copy of the keys
        Dim m_keyID As String = My.Resources.HMAC_KEY_ID
        Dim m_key As String = My.Resources.HMAC_KEY

        'Grab a copy of the EndPoint
        Dim m_url As String = My.Resources.endPoint_Demo

        'Build and assign values to hashing and header variables
        Dim m_method As String = "POST\n"
        Dim m_type As String = "application/xml" 'REST XML
        Dim m_time As String = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ")
        Dim m_uri As String = "/transaction/v14"
        Dim m_hashData As String = m_method & m_type & "\n" & hashed_content & "\n" & m_time & "\n" + m_uri
        Dim m_hmac_sha1 As New HMACSHA1(Encoding.UTF8.GetBytes(m_key))
        Dim m_hmac_data() As Byte = m_hmac_sha1.ComputeHash(Encoding.UTF8.GetBytes(m_hashData))
        Dim m_base64_hash As String = Convert.ToBase64String(m_hmac_data)

        'Build the HTTP Request
        Dim request As HttpWebRequest = HttpWebRequest.Create(m_url)
        request.Method = "POST"
        request.ContentType = m_type
        request.Accept = "*/*"
        request.Headers.Add("x-gge4-date", m_time)
        request.Headers.Add("x-gge4-content-sha1", hashed_content)
        request.Headers.Add("Authorization", "GGE4_API " + m_keyID + ":" + m_base64_hash)
        request.ContentLength = pValue.Length

        Using stream_writer As StreamWriter = New StreamWriter(request.GetRequestStream)
            stream_writer.Write(pValue)

        End Using



        Return dwExitCode


    End Function

QuestionNon-Web Async and Await Questions Pin
Member 1134379530-Dec-14 6:07
Member 1134379530-Dec-14 6:07 
AnswerRe: Non-Web Async and Await Questions Pin
Member 111128632-Jan-15 12:07
Member 111128632-Jan-15 12:07 
AnswerRe: Non-Web Async and Await Questions Pin
bojammis9-Jan-15 8:12
professionalbojammis9-Jan-15 8:12 
QuestionMicrosoft Access 2007 Instalation Pin
Member 1133914628-Dec-14 3:37
Member 1133914628-Dec-14 3:37 
AnswerRe: Microsoft Access 2007 Instalation Pin
Dave Kreskowiak28-Dec-14 6:29
mveDave Kreskowiak28-Dec-14 6:29 
AnswerRe: Microsoft Access 2007 Instalation Pin
Chris Quinn28-Dec-14 22:01
Chris Quinn28-Dec-14 22:01 
GeneralRe: Microsoft Access 2007 Instalation Pin
Member 1133914631-Dec-14 4:14
Member 1133914631-Dec-14 4:14 
QuestionCombobox Pin
sudevsu19-Dec-14 4:55
sudevsu19-Dec-14 4:55 
AnswerRe: Combobox Pin
sudevsu19-Dec-14 5:04
sudevsu19-Dec-14 5:04 
GeneralRe: Combobox Pin
Mycroft Holmes19-Dec-14 14:23
professionalMycroft Holmes19-Dec-14 14:23 
GeneralRe: Combobox Pin
sudevsu23-Dec-14 9:56
sudevsu23-Dec-14 9:56 
AnswerRe: Combobox Pin
Otekpo Emmanuel21-Dec-14 7:01
Otekpo Emmanuel21-Dec-14 7:01 
GeneralRe: Combobox Pin
sudevsu23-Dec-14 9:56
sudevsu23-Dec-14 9:56 
Questionstring params passing between VB.NET and C# Pin
SepPax18-Dec-14 10:52
SepPax18-Dec-14 10:52 
GeneralRe: string params passing between VB.NET and C# Pin
PIEBALDconsult18-Dec-14 11:37
mvePIEBALDconsult18-Dec-14 11:37 
QuestionDx8 issue Pin
Otekpo Emmanuel17-Dec-14 22:33
Otekpo Emmanuel17-Dec-14 22:33 
AnswerRe: Dx8 issue Pin
Eddy Vluggen18-Dec-14 0:29
professionalEddy Vluggen18-Dec-14 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.