Need Webservice..url..for FAX FINDER

Home Forums FaxFinder Need Webservice..url..for FAX FINDER

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2507
    krishna chava
    Participant

    Hi All,

    My company has a new faxfinder server. I need to integrate it in my asp.net web application. I am confuzed with the API.

    Can any one give me the exact web reference url, so that i can refer the url and use the methods to send fax.

    I will be grateful if any one gives me a good example to implement sending fax in asp.net web app.

    Thank you,

    krishna.

    #3015
    Steve Tuckner
    Participant

    Here is a link to some sample C# code to try.

    https://webfiles.multitech.com/engineering/sample-code/fax-finder/c-sharp/SendFax-Csharp.zip

    Steve Tuckner

    Multi-Tech Systems

    #3016
    krishna chava
    Participant

    Thank your very much for the code.

    #3017
    krishna chava
    Participant

    I am trying to implement the functionality in a webapplication using vb.net. But i am getting the below error:

    The RemoteServer returned an error:(400) Bad Request.

    I used the same xml file and below is my code: Can any one of you please help me in this issue…

    Dim url As String = “http://10.0.0.250/ffws/v1/ofax”

    ‘Dim request As HttpWebRequest = DirectCast(Net.WebRequest.Create(url), HttpWebRequest)

    Dim request As HttpWebRequest

    request = HttpWebRequest.Create(“http://10.0.0.280/ffws/v1/ofax”)

    request.Credentials = New NetworkCredential(“userid”, “xyz”)

    request.Method = “POST”

    request.ContentType = “text/xml”

    Dim fileSize As New FileInfo(“C:Userskrishnadocumentsvisual studio 2010ProjectsWebApplication5WebApplication5schedule.xml”)

    Dim len As Integer = CInt(fileSize.Length)

    Dim textIn As New StreamReader(New FileStream(“C:Userskrishnadocumentsvisual studio 2010ProjectsWebApplication5WebApplication5schedule.xml”, FileMode.Open, FileAccess.Read))

    Dim TextLines As String = textIn.ReadToEnd()

    Dim byteArray As Byte() = Encoding.UTF8.GetBytes(TextLines)

    ‘request.ContentLength = len

    request.ContentLength = byteArray.Length

    Dim dataStream As Stream = request.GetRequestStream()

    dataStream.Write(byteArray, 0, byteArray.Length)

    textIn.Close()

    dataStream.Close()

    Dim response As HttpWebResponse = request.GetResponse()

    ‘Console.WriteLine(DirectCast(response, HttpWebResponse).StatusDescription)

    ‘ Label1.Text = (DirectCast(response, HttpWebResponse).StatusDescription)

    Dim data As Stream = response.GetResponseStream()

    Dim reader As New StreamReader(data)

    Dim responseFromServer As String = reader.ReadToEnd()

    ‘Label2.Text = responseFromServer

    reader.Close()

    data.Close()

    response.Close()

    I will be gr8full if i get a solution for this.

    Thank you,

    Krishna.

    #3018
    Bryon Davis
    Moderator

    Hi Krishna,

    Can you post the XML file you are trying to send? Many times the Bad Request is because of a problem with the XML data.

    Regards,

    Bryon

    #3019
    Jesse Gilles
    Blocked

    One way to test the xml versus your code it is to use curl to post the same xml file to the server. Here is the command to send using curl on the command-line:

    curl –basic –user admin –data @schedule.xml http://ff230/ffws/v1/ofax

    Replace @schedule.xml with @yourfilename and make sure you use the right URL for your server.

    #3020
    krishna chava
    Participant

    I fixed the issue. Thanks for your help,

    Its the issue in xml file

    Instead of <organization> i have created my xml with <Organization>.

    I never expected a small difference in the case will error.

    Hope this will help other users.

    Right now i am able to send plain text with the help of your sample.

    Can any one provide me any sample to fax a pdf that i have on my server machine. I will be gr8 ful if i get sample of xml for this one. i tried changing xml tags as below… bug giving error 400.

    <attachment>

    <location>C:Krishnaxml files</location>

    <name>mypdffile.pdf</name>

    <content_type>application/pdf</content_type>

    #3021
    Jesse Gilles
    Blocked

    The schedule.xml file included with the C# sample sends a PDF. You need to base64 encode the PDF file and embed it into the xml just like the sample file.

    #3022
    krishna chava
    Participant

    Thank you Jesse, It worked for me.

    1 more question, can you let me know how to reduce the resolution?

    Right now i am getting the fax with very good resolution. Thanks for the immediate responses.

    #3023
    Chris Cousins
    Participant

    I have downloaded the example changed the fax finder path and credentials, but when I try to get the web response I receive an error “The underlying connection was closed: An unexpected error occurred on a receive.”

    So its failing, any help would be appreciated

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘FaxFinder’ is closed to new topics and replies.