Programming Test
For the programming test, you will be using DuoShare's integration capabilities.
Objective
Write a simple application that uses both the HTTP and Web Services interfaces then compare and contrast the two methods.
Sample - HTTP
This is a sample of a call to DuoShare's HTTP interface that could go in a web form.
<form method="post" action="http://duoshare.com/ds/App/AddressValidate? task=BeginInteractive &name=Programmer&firmOrRecipientInput=DuoShare& deliveryAddressLine1Input=10401 Miller Rd Ste 150&city=Dallas&state=TX& zipCode=75238&foreignID=3103 &originatingCallBackURL=YourReturnURLgoesHere"> </form>
Enter the originating URL for "YourReturnURLgoesHere" following originatingCallBackURL=.
The first validation request call will require user authentication to interface with DuoShare. After authentication, the user can continue to call until their session expires or until the browser is closed.
Upon submitting the form, the address is sent and the user is taken through one or more web forms until the address is saved or the validation is cancelled. The answer is posted back to the originating URL's web server. This is an example of the form data returned to your web server or application when a user saves an address correction and is returned to your website:
<form method="post" action="yourReturnURL">
<table>
<tbody>
<tr>
<td>
<input type="hidden" name="listDetailPK" id="listDetailPK" value="106871181"/>
<input type="hidden" name="foreignID" id="foreignID" value="&foreignID=3103"/>
<input type="hidden" name="firmOrRecipientInput" id="firmOrRecipientInput" value="City Hall"/>
<input type="hidden" name="urbanization" id="urbanization" value=""/>
<input type="hidden" name="addressPrimaryNumber" id="addressPrimaryNumber" value="411"/>
<input type="hidden" name="addressSecondaryAbbr" id="addressSecondaryAbbr" value=""/>
<input type="hidden" name="addressSecondaryNumber" id="addressSecondaryNumber" value=""/>
<input type="hidden" name="carrierRouteID" id="carrierRouteID" value="C004"/>
<input type="hidden" name="city" id="city" value="ODESSA"/>
<input type="hidden" name="congressionalDistrictNum" id="congressionalDistrictNum" value="11"/>
<input type="hidden" name="dpc" id="dpc" value="11"/>
<input type="hidden" name="name" id="name" value=""/>
<input type="hidden" name="state" id="state" value="TX"/>
<input type="hidden" name="streetName" id="streetName" value="8TH"/>
<input type="hidden" name="streetPostDirectionalAbbr" id="streetPostDirectionalAbbr" value=""/>
<input type="hidden" name="streetPreDirectionalAbbr" id="streetPreDirectionalAbbr" value="W"/>
<input type="hidden" name="streetSuffixAbbr" id="streetSuffixAbbr" value="ST"/>
<input type="hidden" name="zipCode" id="zipCode" value="79761"/>
<input type="hidden" name="zipSector" id="zipSector" value="44"/>
<input type="hidden" name="zipSegment" id="zipSegment" value="99"/>
<input type="hidden" name="elotAscDes" id="elotAscDes" value="A"/>
<input type="hidden" name="elotSeqNum" id="elotSeqNum" value="0081"/>
<input type="hidden" name="foreignCountry" id="foreignCountry" value=""/>
<input type="hidden" name="foreignPostalCode" id="foreignPostalCode" value=""/>
<input type="hidden" name="deliveryLine1" id="deliveryLine1" value="411 W 8TH ST"/>
<input type="hidden" name="recordType" id="recordType" value="F"/>
<input type="hidden" name="validationStatus" id="validationStatus" value="validated" />
<input type="hidden" name="originatingCallBackURL" id="originatingCallBackURL" value="yourReturnURL"/>
<input type="hidden" name="deliveryAddressLine1Input" id="deliveryAddressLine1Input" value="411 W 8th St"/>
<input type="hidden" name="lastLineInput" id="lastLineInput" value="Odessa TX 79761-4499"/>
<input type="submit" name="Submit" id="Submit" value="Save Address" />
</td>
</tr>
</tbody>
</table>
</form>
The originating CallBack URL will be displayed in place of "yourReturnURL" in <form method="post" action="yourReturnURL"> in the source code.
To login programmatically on the first call to our server, try calling http://duoshare.com/ds/App/Main?task=LoginUser with this form data:
<input type="hidden" name="j_username" value="youruserid" />
<input type="hidden" name="j_password" value="yourpassword" />
(You can copy our login form from http://duoshare.com/ds/login.html . We will give you real userids/passwords in production, but you can use the above for development.)
If you're not currently logged in, you will be redirected to http://duoshare.com/ds/App/Main?task=LoginUser regardless of what URL you request because we have some housekeeping code that needs to run at login. You should be given one or more session cookies in the form of "LtpaToken" and "JSESSIONID" and your communication will be switched from http://duoshare.com to https://duoshare.com. Just return those cookies on subsequent calls and use the secure port. After the login, you should be able to call the address validation URL. All of our output is XHTML 1.1 compliant, so you shouuld be able to programmatically parse our output easily.
Sample - Web Services
http://duoshare.com/PostML.wsdl is a web services description language file that describes our web service. See if you can write a simple program to connect and use our web service, passing one or more input addresses and getting answers.
Summary
If what you are supposed to do and the steps you are supposed to take are not clear based upon reading the website and the application help, we'd like to know where we can fill in the gaps to take you from your current knowledge point all the way to being a happy end user and knowing what the heck you're supposed to be doing. While we are polishing the application, we still have knowledge gaps we need to bridge to take an end user through the process. So, feel free to email DuoShare with any questions along the way.
Thanks for your time and interest in pursuing your career with DuoShare!
