Need assistance in using PHP to connect to webservice using SoapClient (I am kinda new to SOAP)

Here is the WSDL URL: https://uat.fiadmin.com/scs.webservice/ScsAutoService.asmx

Here is the SOAP request from SoapUI with correct data in the fields:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:scs="http://www.natinc.com/SCSAutoService/">
   <soapenv:Header/>
   <soapenv:Body>
      <scs:GetRates>
         <scs:objGetRatesRequest>
            <scs:UserId>VPP</scs:UserId>
            <scs:Password>jBH5Mspc</scs:Password>
            <scs:TpaCode>DEMO</scs:TpaCode>
            <scs:ErrorMessage>0</scs:ErrorMessage>
            <scs:ErrorCode>0</scs:ErrorCode>
            <scs:RequestGroup>0</scs:RequestGroup>
            <scs:Trim>0</scs:Trim>
            <scs:ChromeStyle>0</scs:ChromeStyle>
            <scs:VINPattern>0</scs:VINPattern>
            <scs:DealerNo>MENU004</scs:DealerNo>
            <scs:NewUsed>N</scs:NewUsed>
            <scs:VIN>1N4AL3AP1DC121302</scs:VIN>
            <scs:VehicleYear>0</scs:VehicleYear>
            <scs:VehicleMake>0</scs:VehicleMake>
            <scs:VehicleModel>0</scs:VehicleModel>
            <scs:VehiclePurchasePrice>0.00</scs:VehiclePurchasePrice>
            <scs:VehicleOdometer>24001</scs:VehicleOdometer>
            <scs:TonRating>0</scs:TonRating>
            <scs:AspirationCode>0</scs:AspirationCode>
            <scs:DrivingWheels>0</scs:DrivingWheels>
            <scs:SegmentationCode>0</scs:SegmentationCode>
            <scs:Cylinders>0</scs:Cylinders>
            <scs:SaleDate>2014-03-26T00:00:00</scs:SaleDate>
            <scs:FinancedAmount>0</scs:FinancedAmount>
            <scs:GIPIteration>0</scs:GIPIteration>
            <scs:MonthlyPayment>0</scs:MonthlyPayment>
            <scs:FinanceTerm>0</scs:FinanceTerm>
            <scs:FinanceType>0</scs:FinanceType>
            <scs:InserviceDate>2014-03-26T00:00:00</scs:InserviceDate>
            <scs:DOBBuyer>0001-01-01T00:00:00</scs:DOBBuyer>
            <scs:DOBCoBuyer>0001-01-01T00:00:00</scs:DOBCoBuyer>
            <scs:FuelType>0</scs:FuelType>
            <scs:VehiclePurchaseDate>0001-01-01T00:00:00</scs:VehiclePurchaseDate>
            <scs:FullManufWarrMonths>0</scs:FullManufWarrMonths>
            <scs:FullManufWarrMiles>0</scs:FullManufWarrMiles>
            <scs:PowerTrainManufWarrMonths>0</scs:PowerTrainManufWarrMonths>
            <scs:PowerTrainManufWarrMiles>0</scs:PowerTrainManufWarrMiles>
            <scs:FinanceApr>0</scs:FinanceApr>
            <scs:Surcharges>0</scs:Surcharges>
            <scs:MSRP>0</scs:MSRP>
            <scs:ProductCollection>
               <scs:Product>
                  <scs:Code>0</scs:Code>
                  <scs:Description>0</scs:Description>
                  <scs:ExtractPosition>0</scs:ExtractPosition>
               </scs:Product>
            </scs:ProductCollection>
            <scs:CultureName>0</scs:CultureName>
         </scs:objGetRatesRequest>
      </scs:GetRates>
   </soapenv:Body>
</soapenv:Envelope>

Here is the first few lines of the SOAP response that comes back in SoapUI:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <GetRatesResponse xmlns="http://www.natinc.com/SCSAutoService/">
         <GetRatesResult>
            <PlanRates>
               <PlanRate>
                  <Plan>
                     <PlanDescriptions/>
                     <ProgramDescriptions/>
                     <ProductTypeCode>VSC</ProductTypeCode>
                     <ProductTypeDescription>Vehicle Service Contract</ProductTypeDescription>
                     <PlanCode>M6</PlanCode>
                     <PlanDescription>Silver</PlanDescription>
                     <ContractType>1</ContractType>
                     <PlanId>860</PlanId>
                     <RateBook>422</RateBook>
                     <OwnershipTypeCode>A</OwnershipTypeCode>
                     <ContractPlanName/>
                     <ProgramDescription>Menu Integration VSC</ProgramDescription>
                     <ProgramID>68</ProgramID>
                     <Discountable>0</Discountable>
                  </Plan>
                  <RateClassMoneys>
                     <RateClassMoney>
                        <TermMile>
                           <TermId>6</TermId>
                           <Term>12</Term>
                           <Mileage>12000</Mileage>
                        </TermMile>
                        <Deductible>
                           <DeductTypeDescriptions/>
                           <DeductId>1</DeductId>
                           <DeductAmt>0.00</DeductAmt>
                           <DeductType/>
                           <ReducedAmount>0</ReducedAmount>
                        </Deductible>
                        <Rate>
                           <BandCode/>
                           <OverrideFlag>false</OverrideFlag>
                           <OptionGroupId>188</OptionGroupId>
                           <RateId>519461</RateId>
                           <RetailRate>1145.00</RetailRate>
                           <NetRate>1145.00</NetRate>
                           <MaxRetailRate>0</MaxRetailRate>
                           <MinRetailRate>0</MinRetailRate>
                           <RegulatedRuleId>0</RegulatedRuleId>
                           <PDFFormNo>VSC</PDFFormNo>
                           <VehicleClass>1</VehicleClass>
                           <ExpirationDate>2015-03-26T00:00:00</ExpirationDate>
                           <ExpirationMileage>36001</ExpirationMileage>
                           <MarkupMin>0</MarkupMin>
                           <MarkupMax>0</MarkupMax>
                        </Rate>

Can you show me the PHP code using SoapClient to connect to the webservice, send the data in the request and bring back the response fields. I need to see how to write any of the fields that are returned back onto my site or store them in a PHP variable for use later.

The main field I want to bring back to my website is: <netrate>1145.00</netrate> but would also like to know how to capture all the fields into PHP variables if necessary.

I do have a basic understanding of SOAP and PHP but i havent been able to make this to work all the way yet!

Thanks for your help!

Perhaps this thread will get you started.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.