•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 391,944 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,880 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 3639 | Replies: 3
![]() |
i tried this code
<%Option Explicit
Const StringToFax = "Hello world from text."
Dim objSoap, SendfaxResult
Dim B
B = Stream_StringToBinary(StringToFax,"us-ascii")
Set objSoap = Server.CreateObject("MSSOAP.SOAPClient30")
objSoap.ClientProperty("ServerHTTPRequest") = True
objSoap.mssoapinit("http://ws.interfax.net/dfs.asmx?WSDL")
objSoap.ConnectorProperty("EnableAutoProxy") = True
'SendfaxResult = objSoap.Sendfax("username", "password", "5480015", B , "txt")
SendfaxResult = objSoap.SendfaxEx_2("username", "password", "5480015", "", B, _
"txt", UBOUND(B)+1, Now, 3, "MyCSID", "", "", "Fax Subject", "myaddress@mydomain.com", _
"Letter", "Landscape", False, True)
'SendfaxResult = objSoap.Sendfax("your user name", "your password", "+44965157785", base64_Text, "html")
If CLng(SendfaxResult) > 0 Then
Response.Write "Fax submitted. Transaction ID: " & SendfaxResult
Else
Response.Write "Error sending fax. Return code: " & SendfaxResult
End If
Function Stream_StringToBinary(Text, CharSet)
Const adTypeText = 2
Const adTypeBinary = 1
'Create Stream object
Dim BinaryStream 'As New Stream
Set BinaryStream = CreateObject("ADODB.Stream")
'Specify stream type - we want To save text/string data.
BinaryStream.Type = adTypeText
'Specify charset For the source text (unicode) data.
If Len(CharSet) > 0 Then
BinaryStream.CharSet = CharSet
Else
BinaryStream.CharSet = "us-ascii"
End If
'Open the stream And write text/string data To the object
BinaryStream.Open
BinaryStream.WriteText Text
'Change stream type To binary
BinaryStream.Position = 0
BinaryStream.Type = adTypeBinary
'Open the stream And get binary data from the object
Stream_StringToBinary = BinaryStream.Read
'Clean up
BinaryStream.Close
Set BinaryStream = Nothing
End Function
%>
but i ,m getting the error as
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/myweb/fax.asp, line 10
is this becos i m using ssoap client which is not supported
<%Option Explicit
Const StringToFax = "Hello world from text."
Dim objSoap, SendfaxResult
Dim B
B = Stream_StringToBinary(StringToFax,"us-ascii")
Set objSoap = Server.CreateObject("MSSOAP.SOAPClient30")
objSoap.ClientProperty("ServerHTTPRequest") = True
objSoap.mssoapinit("http://ws.interfax.net/dfs.asmx?WSDL")
objSoap.ConnectorProperty("EnableAutoProxy") = True
'SendfaxResult = objSoap.Sendfax("username", "password", "5480015", B , "txt")
SendfaxResult = objSoap.SendfaxEx_2("username", "password", "5480015", "", B, _
"txt", UBOUND(B)+1, Now, 3, "MyCSID", "", "", "Fax Subject", "myaddress@mydomain.com", _
"Letter", "Landscape", False, True)
'SendfaxResult = objSoap.Sendfax("your user name", "your password", "+44965157785", base64_Text, "html")
If CLng(SendfaxResult) > 0 Then
Response.Write "Fax submitted. Transaction ID: " & SendfaxResult
Else
Response.Write "Error sending fax. Return code: " & SendfaxResult
End If
Function Stream_StringToBinary(Text, CharSet)
Const adTypeText = 2
Const adTypeBinary = 1
'Create Stream object
Dim BinaryStream 'As New Stream
Set BinaryStream = CreateObject("ADODB.Stream")
'Specify stream type - we want To save text/string data.
BinaryStream.Type = adTypeText
'Specify charset For the source text (unicode) data.
If Len(CharSet) > 0 Then
BinaryStream.CharSet = CharSet
Else
BinaryStream.CharSet = "us-ascii"
End If
'Open the stream And write text/string data To the object
BinaryStream.Open
BinaryStream.WriteText Text
'Change stream type To binary
BinaryStream.Position = 0
BinaryStream.Type = adTypeBinary
'Open the stream And get binary data from the object
Stream_StringToBinary = BinaryStream.Read
'Clean up
BinaryStream.Close
Set BinaryStream = Nothing
End Function
%>
but i ,m getting the error as
Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/myweb/fax.asp, line 10
is this becos i m using ssoap client which is not supported
•
•
Join Date: Mar 2005
Location: LTT, South Africa
Posts: 125
Reputation:
Rep Power: 4
Solved Threads: 1
•
•
Join Date: Jul 2004
Location: Sydney, Australia
Posts: 166
Reputation:
Rep Power: 5
Solved Threads: 7
SOAP is supported as long as you have the dlls installed on the server. It looks like the code you have is example only code from the providers of the fax service. And which is line 10 of the code? Very difficult to track down the problem if we don't know which line the error refers to.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.
Lafinboy Productions
:: Website Design :: Website Development ::
Lafinboy Productions
:: Website Design :: Website Development ::
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
- News Article: eFax Messenger Plus (Windows Software)
- Sending HTML/Plain text Emails (PHP)
- Body Text lost when sending hotmail (Web Browsers)
- Sending HTML email via PHP mail function (PHP)
- Obtain Remote Assistance by Sending an E-mail Message in Windows XP (Windows tips 'n' tweaks)
- Obtain Remote Assistance by Sending an E-mail Message in Windows XP (Windows tips 'n' tweaks)
Other Threads in the ASP Forum
- Previous Thread: asp mysql
- Next Thread: Can we use "<% %>"inside <% % >


Linear Mode