Author: <kamcginnis@gmail.com>
Posted: 2009-12-26 at 14:41:19
It looks like you are trying to use SOAP. Is that what they are using? I haven't seen SOAP used in new projects in a
while.
If you are sending ANSI X.12 transactions sets such as the 837 they may want something like the code below. It could be
used for sending text files of any size.
We did a credit card project with Global Payments that used a different authentication format than shown below.
What is the name of the clearinghouse? What is the name of the payer? (Medicare/medicaid?)
pcUsername = "username"
pcPassword = "password"
tcMessage = your file
pc_URL = https://www.clearinghouse.com
Try
Local loHTTP As MSXML3.ServerXMLHTTP
loHTTP = Createobject('MSXML2.ServerXMLHTTP.6.0')
loHTTP.SetTimeouts(600000,600000,600000,600000)
With loHTTP
.Open('POST', pc_URL, .F., pcUsername, pcPassword )
.setRequestHeader("Content-Type","text/xml")
.Send(tcMessage)
----- Original Message -----
From: <air@abac.com>
To: "Profox List" <profox@leafe.com>
Sent: Saturday, December 26, 2009 8:08 AM
Subject: Webservices Authentication Header
Hi !
I'm working on a new webservice in VFP9 to send claims to a clearinghouse. Done
webservices with insurance companies before and it was a piece of cake
using westwind connection since everything was adding parameters to the
oSoap, sending the request and receiving a response. But this time I need a Webservices/Webconnection
expert cause can't figure out a section which says AuthenticationHeader which goes at the
beginning of the request and I know is the username and password part but
haven't found a way to send this before the other parameters. They send me a
code sample as follows:
**********************************TEST*CODE****************************************
Dim proxy As New svcServiceReference.EdiFileTransferSoapClient()
Dim AuthenticationHeader As svcServiceReference.AuthenticationHeader
AuthenticationHeader = New svcServiceReference.AuthenticationHeader
AuthenticationHeader.Username = "Username1"
AuthenticationHeader.Password = "Password1"
'file
Dim file As New svcServiceReference.EdiFile
file.FileName = "testfile"
Dim strFilePath = "C:\yourfiles\yourfile.txt"
Dim strBody = ""
Dim rdr As New StreamReader(strFilePath)
strBody = rdr.ReadToEnd()
rdr.Close()
file.FileBody = New String() {strBody}
file.RowDelimiter = "~"
Dim response As New svcServiceReference.Result
'Dim liMsgIDs As New List(Of String)
'liMsgIDs.Add("1")
'liMsgIDs.Add("2")
'liMsgIDs.Add("3")
'Dim strMsgIDs As String()
'strMsgIDs = liMsgIDs.ToArray()
'response = proxy.MarkFilesAsDownloaded(AuthenticationHeader, strMsgIDs)
'file.FileType = "837FILE"
'response = proxy.SendCustomFile(AuthenticationHeader, file)
response = proxy.SendX12File(AuthenticationHeader, file.FileName, file.FileBody(0), file.FileDate, True)
Tried using the Header in oHTTP and all the techniques regarding complex parameters in the help files but receive the
same response "Unable to Authenticate" and right now trying RawXML for this section as follows:
oHTTP = CREATE("wwHTTP")
oHTTP.nConnectTimeout = 360
oSOAP = CREATE("wwSOAP")
oSOAP.oHTTP = oHTTP
lcRequest = "<AuthenticationHeader>" + ;
lcUserPassword + ;
"</AuthenticationHeader>"
oSOAP.AddParameter("AuthenticationHeader", lcRequest, "RawXML")
oSOAP.AddParameter("Filename", lcFile)
oSOAP.AddParameter("Body", lcFileBody)
oSOAP.AddParameter("FileDate", lcFileDate)
lcStringXML = oSOAP.CallWSDLMethod("SendX12File", lcURL)
I ran out of ideas, Is there any guru out there that may help me figure out the Authentication Header section?
Regards,
AiR
Aida I. Rivera-Ben