Sales
Click for numbers
Welcome User Tools Developer Tools Prices Help Sign up Login
You are here: Home > Developer Tools > Fax Web Service > Samples > Java - Simple Fax Transmission

Fax Web Service Code Sample

Java - Simple Fax Transmission

Download the Java project files.

class TestFax { public static void main(String[] args) throws Exception
{
try {
long result;
// Create an instance of the Web Service Object
InterFaxSoapStub ifs = new InterFaxSoapStub(new URL("http://ws.interfax.net/DFS.asmx"), new Service(new QName("SendCharFax")));

// Invoke the SendCharFax method
result = ifs.sendCharFax("MyUserName", "MyPassword", "+1-212-4567890", "This is a sample fax", "TXT");

if (result > 0)


// Positive returned value indicates that the fax was sent successfully.
// The return value is the Transaction ID.
System.out.println("Fax submitted properly. Transaction number: " + result);
else

// Negative returned value indicates sending failure.
// See error code definitions
System.out.println("Error sending fax!");

} catch (Exception e) {
System.out.println(e.toString());
    }
  }
}



About | Contact | Privacy | Terms | Partners | Login | System Status

© Interfax Inc