The Request document that you would create for this order would look like this:
<ElsRequest version="ELS_1.0">
<LoanType>1</LoanType>
<Account>
<UserName>websvc</UserName>
<Contact>testing</Contact>
<ReferenceNumber><![CDATA[PR for 123
Main]]>
</ReferenceNumber>
<Branch>2</Branch>
</Account>
<Address>
<Street>123 Main</Street>
<City>Cleveland</City>
<State>OH</State>
<Zip>44111</Zip>
</Address>
<Borrower type="primary">
<FirstName>Joe</FirstName>
<LastName>Miller</LastName>
</Borrower>
<Comments><![CDATA[Sample Text Here]]></Comments>
<ElsProduct serviceCode="06"/>
</ElsRequest>
<ElsRequest version="ELS_1.0">
<LoanType>2</LoanType>
<Account>
<UserName>websvc</UserName>
<Contact>testing</Contact>
<ReferenceNumber><![CDATA[PR for 123
Main]]>
</ReferenceNumber>
<Branch>2</Branch>
</Account>
<Address>
<Street>123 Main</Street>
<City>Cleveland</City>
<State>OH</State>
<Zip>44111</Zip>
</Address>
<Borrower type="primary">
<FirstName>John</FirstName>
<LastName>Smith</LastName>
</Borrower>
<Sale>
<LoamAmount>200000</LoanAmount>
<PropertyType>Primary
Residence</PropertyType>
</Sale>
<ElsProduct serviceCode="06"/>
</ElsRequest>
<ElsRequest version="ELS_1.0">
<LoanType>3</LoanType>
<Account>
<UserName>websvc</UserName>
<Contact>testing</Contact>
<ReferenceNumber><![CDATA[PR for 123
Main]]>
</ReferenceNumber>
<Branch>2</Branch>
</Account>
<Address>
<Street>123 Main</Street>
<City>Cleveland</City>
<State>OH</State>
<Zip>44111</Zip>
</Address>
<Borrower type="primary">
<FirstName>John</FirstName>
<LastName>Smith</LastName>
</Borrower>
<Parties>
<Sellers>
<Seller>
<FirstName>John</FirstName>
<LastName>Smith</LastName>
</Seller>
</Sellers>
</Parties>
<Sale>
<LoamAmount>200000</LoanAmount>
<PropertyType>Primary
Residence</PropertyType>
</Sale>
<ElsProduct serviceCode="06"/>
</ElsRequest>
Now you would make the PlaceOrder SOAP call using the programming language of your choice. For Visual Basic®, the code would look like this:
‘ RequestDocument is a string containing the ElsRequest document
‘ Function will return the ElsResponse document as a string
Function PlaceOrder(RequestDocument As String) As String
Dim oSOAP As New MSSOAPLib.SoapClient
Dim sResponse As String
oSOAP.ClientProperty(“ServerHTTPRequest”) = True
oSOAP.mssoapinit
“http://soap.elsonline.net/webservice/ElsWebOrder.asmx?WSDL”
sResponse = oSOAP.PlaceOrder(“yourusername”, “yourpassword”,
RequestDocument)
‘ Check for SOAP error
If oSOAP.faultstring <> “” Then
MsgBox “ERROR: “ & oSOAP.faultstring
PlaceOrder = “”
Exit Function
End If
PlaceOrder = sResponse
End Function
The following XML document is the document generated by the previous call to PlaceOrder.
IMPORTANT: the Property Report shows a Status of “Work In Progress” which means that Lenders Advantage is working on completing your order and will place a notification into your order queue when it is complete.
equity Response
<?xml version="1.0" encoding="utf-8"?>
<ElsResponse version="ELS_1.0" orderState="unlocked">
<ConfirmationNumber>11110000</ConfirmationNumber>
<OrderNumber>11110000</OrderNumber>
<Account>
<UserName>demo-els</UserName>
<Contact>testing</Contact>
<CustomerNumber>1230</CustomerNumber>
<Branch>2</Branch>
<ReferenceNumber><![CDATA[PR for 123
Main]]></ReferenceNumber>
<ReferenceNumber2><![CDATA[]]></ReferenceNumber2>
</Account>
<Address>
<Street>123 Main</Street>
<UnitNumber />
<City>Cleveland</City>
<State>OH</State>
<Zip>44111</Zip>
<County />
</Address>
<Borrower type="primary">
<FirstName>John</FirstName>
<MiddleInitial />
<LastName>Smith</LastName>
<SSN />
<HomePhone />
<WorkPhone />
</Borrower>
<Sale>
<PurchApprValue />
<PurchApprDate />
<OwnerEstimatedValue />
<LoanAmount />
</Sale>
<Comments><![CDATA[]]></Comments>
<ElsProduct serviceCode="06" type="Title"
sequenceNum="0">
<Description>Property
Report</Description>
<Status>Work In Progress</Status>
<OrderDate>8/19/2002 5:44:52
PM</OrderDate>
</ElsProduct>
<ElsOrderNote>
<NoteText><![CDATA[Property Report
report (Work In Progress)]]></NoteText>
<NoteDate>08/19/2002</NoteDate>
</ElsOrderNote>
<ElsStatus>
<Message>OK</Message>
<Number>0</Number>
</ElsStatus>
</ElsResponse>
<ElsResponse version="ELS_4.0" orderState="locked">
<ConfirmationNumber>20033479</ConfirmationNumber>
<OrderNumber>20033479</OrderNumber>
<Account>
<UserName>demo-els</UserName>
<Contact>testing</Contact>
<CustomerNumber>999999</CustomerNumber>
<Branch>1</Branch>
<ReferenceNumber><![CDATA[RefiMin-3]]></ReferenceNumber>
<ReferenceNumber2><![CDATA[]]></ReferenceNumber2>
<EmailTo>developer@firstam.com</EmailTo>
</Account>
<Address>
<Street>123 Main</Street>
<UnitNumber />
<City>Cleveland</City>
<State>OH</State>
<Zip>44140</Zip>
<County>Cuyahoga</County>
</Address>
<AltAddress addrType="Initial">
<AltAddress1>123 Main St</AltAddress1>
<AltCity>Cleveland</AltCity>
<AltState>OH</AltState>
<AltZip>44140</AltZip>
</AltAddress>
<Borrower type="primary">
<FirstName>Mike</FirstName>
<LastName>Cullen</LastName>
</Borrower>
<Sale>
<PurchApprValue />
<PurchApprDate />
<OwnerEstimatedValue />
<LoanAmount>200000</LoanAmount>
<FirstMtgBalance />
<CreditScore />
<LoanToValue />
<LoanType>Conventional</LoanType>
</Sale>
<Comments><![CDATA[]]></Comments>
<ElsProduct serviceCode="06" type="Title" sequenceNum="0">
<Description>Property Report</Description>
<Status>Work In Progress</Status>
<OrderDate>12/28/2005 3:11:24 PM</OrderDate>
</ElsProduct>
<ElsStatus>
<Message>OK</Message>
<Number>0</Number>
</ElsStatus>
</ElsResponse>
Purchase Response
<ElsResponse version="ELS_4.0" orderState="locked">
<ConfirmationNumber>20033473</ConfirmationNumber>
<OrderNumber>20033473</OrderNumber>
<Account>
<UserName>demo-els</UserName>
<Contact>testing</Contact>
<CustomerNumber>999999</CustomerNumber>
<Branch>1</Branch>
<ReferenceNumber><![CDATA[minPurch-1]]></ReferenceNumber>
<ReferenceNumber2><![CDATA[]]></ReferenceNumber2>
<EmailTo>developer@firstam.com</EmailTo>
</Account>
<Address>
<Street>123 Main Rd</Street>
<UnitNumber />
<City>Cleveland</City>
<State>OH</State>
<Zip>44140</Zip>
<County>Cuyahoga</County>
</Address>
<AltAddress addrType="Initial">
<AltAddress1>123 Main</AltAddress1>
<AltZip>44140</AltZip>
</AltAddress>
<Borrower type="primary">
<FirstName>John</FirstName>
<LastName>Smith</LastName>
</Borrower>
<Parties>
<Sellers>
<Seller>
<FirstName>John</FirstName>
<LastName>Smith</LastName>
<WorkPhoneExt />
</Seller>
</Sellers>
</Parties>
<Sale>
<PurchApprValue />
<PurchApprDate />
<OwnerEstimatedValue />
<LoanAmount>200000</LoanAmount>
<FirstMtgBalance />
<CreditScore />
<LoanToValue />
<LoanType>Conventional</LoanType>
<LoanPosition>1</LoanPosition>
<ContractExpDate />
<CommissionSplit />
</Sale>
<Comments><![CDATA[]]></Comments>
<ElsProduct serviceCode="FT" type="Title" sequenceNum="0">
<Description>FACT Title Report</Description>
<Status>Completed</Status>
<OrderDate>12/28/2005 2:55:14 PM</OrderDate>
<CompleteDate>12/28/2005 2:55:16 PM</CompleteDate>
</ElsProduct>
<ElsStatus>
<Message>OK</Message>
<Number>0</Number>
</ElsStatus>
</ElsResponse>
IMPORTANT: if an error occurred while the order was being placed (e.g., you did not supply some required information, or the ElsRequest document was invalid), you will be notified. You must check for an error condition before continuing.
Every response you receive from the Advantage XML Web Service contains an element named ElsStatus which contains error status information. If the ErrorNumber is 0 and the Message is OK, then there is no error; otherwise, the error will be described so you can take appropriate action.
The following Visual Basic® code snippet provides a function for checking the ElsStatus element:
Function IsError(ElsResponse As String) As Boolean
Dim oXmlDoc As New MXSXML.DomDocument
IsError = True ‘ assume error until proven otherwise
If Not oXmlDoc.LoadXML(ElsResponse) Then
MsgBox “XML parser error: “ &
oXmlDoc.parseError.reason
Exit Function
End If
Dim nodeStatus As IXMLDomNode
Set nodeStatus = oXmlDoc.selectSingleNode(“//ElsStatus”)
If nodeStatus Is Nothing Then
MsgBox “ElsStatus element not found: INVALID XML
response”)
Exit Function
End If
Dim statusNum As Long
Dim statusMsg As String
statusNum = CLng(nodeStatus.selectSingleNode(“Number”).Text)
statusMsg = nodeStatus.selectSingleNode(“Message”).Text
If statusNum = 0 And statusMsg = “OK” Then
IsError = False ‘**** NO ERROR!
Else
MsgBox “ELS reported error: “ & statusMsg
& vbCrLf & _
“DETAILS:” & nodeStatus.selectSingleNode(“Details”).Text
End If
End Function
Assuming that there was no error (either from the SOAP communication or from Lenders Advantage via the ElsStatus element), then you have a valid response that contains a snapshot of your order as it currently exists in the Advantage system.
The key piece of data you need from the response is the ConfirmationNumber as you will need it whenever you want to reference this order again.