by lisag
1 replies
I'm having a hard time getting my head around doing something in PHP5 with SOAP. I don't know how to translate the ASP examples I have to PHP.

"To register a debtor through the agency API, an XML document must be created following the below schema and passed to the CreateDebtor method as a parameter. Upon a successful debtor registration, the CreateDebtor method will return an XML document containing the newly created debtor’s debtor ID. This debtor ID is to be used for the course ordering process."


Code:
Dim registerXmlString As String = ""
Dim agencyAPI As New AgencyUtilities
Dim registerXmlDoc As New System.Xml.XmlDocument
Dim registerResponseXmlDoc As System.Xml.XmlDocument
'Fill registrationXmlString with XML
registerXmlDoc.LoadXml(registerXmlString)
'Get the response
registerResponseXmlDoc = agencyAPI.RegisterDebtor(
'Parse through the XML in registerResponseXmlDoc
Code:
<?xml version="1.0" encoding="utf-8" ?>
<CreateDebtor xmlns="http://www.xxxy.com/api" username="abc123" password="abc123">
<Debtor>
<CinID></CinID>
<FirstName>John</FirstName>
<LastName>Doe</LastName>
<SSN>111-11-1111</SSN>
<DOB>04/08/2008</DOB>
<MaritalStatus>Single</MaritalStatus>
<SpouseFirstName></SpouseFirstName>
<SpouseLastName></SpouseLastName>
<SpouseSSN></SpouseSSN>
<SpouseDOB></SpouseDOB>
<Email>someone@startfreshtoday.com</Email>
<OwnsRealEstate>true</OwnsRealEstate>
<NumberOfVehiclesOwned>1</NumberOfVehiclesOwned>
<Address>
<Address1>25 E. Washington</Address1>
<Address2>Suite 510</Address2>
<City>Chicago</City>
<Zip>60602</Zip>
</Address>
<HomePhone>
<Areacode>111</Areacode>
<Prefix>111</Prefix>
<Suffix>1111</Suffix>
</HomePhone>
<WorkPhone>
<Areacode>111</Areacode>
<Prefix>111</Prefix>
<Suffix>1111</Suffix>
<Extension></Extension>
</WorkPhone>

<AlternativePhone>
<Areacode>111</Areacode>
<Prefix>111</Prefix>
<Suffix>1111</Suffix>
</AlternativePhone>
</Debtor>
<FirmClientCode></FirmClientCode>
<Credentials>
<Username>johndoe</Username>
<Password>johndoe</Password>
</Credentials>
</CreateDebtor>
Can someone point me to how to I get this done in PHP5? I've Googled it to death. I think I just don't understand what I'm reading.
#asp&gtphp5 #asp>php5 #soap
  • Profile picture of the author Daniel44
    Hi There,

    You would be better off using CURL to call and submit your xml documents to the API.

    If you google "Curl" and "API" you are bound to find some examples

    Daniel
    {{ DiscussionBoard.errors[2410869].message }}

Trending Topics