Author: <air@abac.com>
Posted: 2009-12-26 at 11:08:10
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