Hi,
I am trying to send fax using JobSubmit wsdl. I have gone through the manuals and created a sample xml. How to invoke this wsdl using php soapclient.
Regards,
Abhijith.S
To submit a SOAP request to the API, you just need to send your XML to the correct URL.
The submission URL for the test system is https://test2messaging.easylink.com/soap/sync, and the one for production is https://messaging.easylink.com/soap/sync .
Do you already have login credentials that you can use?
Thanks for the reply. I have the login credentials.
I am using https://test2messaging.easylink.com/soap/sync as the ReceiverKey in the xml.
This is the code i am using to invoke the wsdl
$client = new SoapClient('http://ws.easylink.com/JobSubmit/2011/01?WSDL');
$res = $client->JobSubmit($jobSubmitXml);
But its not working.
Thanks,
Because there are multiple different URL's that the API requests can be submitted to, the WSDL does not contain a valid submission URL. So once you have created your SoapClient object, you need to override the submission URL to to the correct URL (https://test2messaging.easylink.com/soap/sync).
I haven't used this software myself, but from a look at the online manual I think this could be accomplished as follows:
$client->__setLocation('https://test2messaging.easylink.com/soap/sync');
I have made the changes as you mentioned. now it is showing another error "Fatal error: Uncaught SoapFault exception: [soapenv:Client] Error in parsing"
This is the xml I am using
<?xml version="1.0"?>
<tns:Envelope
xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns:Header>
<Request xmlns="http://ws.easylink.com/RequestResponse/2011/01">
<ReceiverKey>https://test2messaging.easylink.com/soap/sync</ReceiverKey>
<Authentication>
<XDDSAuth>
<RequesterID>'.$userId.'</ns1:RequesterID>
<Password>'.$password.'</ns1:Password>
</XDDSAuth>
</Authentication>
</Request>
</tns:Header>
<tns:Body>
<JobSubmitRequest xmlns="http://ws.easylink.com/JobSubmit/2011/01">
<Message>
<JobOptions>
<Delivery>
<Schedule>express</Schedule>
</Delivery>
<FaxOptions>
<FaxCoversheet>
<UseCoversheet>no</UseCoversheet>
</FaxCoversheet>
<BannerFX>
<UseBannerFx>no</UseBannerFx>
</BannerFX>
<FaxMode>standard</FaxMode>
<DeliveryRetryPattern>1</DeliveryRetryPattern>
</FaxOptions>
</JobOptions>
<Destinations>
<Fax>
<Phone>'.$number.'</Phone>
</Fax>
</Destinations>
<Reports>
<DeliveryReport>
<DeliveryReportType>detail</DeliveryReportType>
</DeliveryReport>
</Reports>
<Contents>
<Part>
<Document>
<DocType>text</DocType>
<Filename>test.txt</Filename>
<DocUrl>http://localhost/EasyLink/test.txt</DocUrl>
<CharacterSet>UTF-8</CharacterSet>
</Document>
</Part>
</Contents>
</Message>
</JobSubmitRequest>
</tns:Body>
</tns:Envelope>
Please help.
Your XML looks pretty close, but there are a few issues:
In the <XDDSAuth> element, the end tags show "/ns1:", but that's not how you've defined your namespace for that portion of the content. So you'll want to use </RequesterID> instead of </ns1:RequesterID> (and the same for Password). That's probably the source of the initial SOAP fault.
That seems to be the only syntactic problem. There are a few issues with the content:
That should take care of most of the issues.
Thanks for the reply. I have made the modifications that you have mentioned, but its still not working. Its showing this error "Fatal error: Uncaught SoapFault exception: [soapenv:Client] Error in parsing in C:\wamp\www\EasyLink\sample.php:59Stack trace:#0 C:\wamp\www\EasyLink\sample.php(59): SoapClient->__call('JobSubmit', Array)#1 C:\wamp\www\EasyLink\sample.php(59): SoapClient->JobSubmit('<?xml version="...')#2 {main} thrown in C:\wamp\www\EasyLink\sample.php on line 59"
The userId and password that i am using is the same as that one I used to signin to this forum. Am I doing anything wrong?
This is my code
<?php
$userId = '****';
$password = '****';
$faxNumber = '7042303221';
$file = 'C:\wamp\www\EasyLink\test.txt';
$fileContentString = join("", file($file));
$jobSubmitXml = '<?xml version="1.0"?>
<RequesterID>'.$userId.'</RequesterID>
<Password>'.$password.'</Password>
<Phone>'.$faxNumber.'</Phone>
<DocData format="base64">'.base64_encode($fileContentString).'</DocData>
';
echo "<pre>";
print_r($res);
?>
I can't tell exactly what's wrong, but one issue for sure is that the user ID you use for this forum is *not* the one you should be using for your API requests.
You will need a switch account set up which is independent of the apiforums login.
Please be in touch with your sales team to determine the correct credentials to use.
Once you've done that, please attach your XML again and we'll see what's wrong with it...
I have contacted the sales team and got a test account. They told me to use it when trying to send test messages.
It includes Created By, User Id, UAN, CAN, Password, Contact Name, Contact Phone, Contact Email, Contact Address, Time Zone and Country Code
I have used the User Id and Password as <RequesterID> and <Password> in my xml. But its still showing the "parsing error"
Do we have a UI to test whether the test account is working or not? Please help
A parsing error is not the same as an authentication error.
Please provide a copy of your XML so we can see what the problem is.