473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Need PHP SOAP assistance

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

Here is the WSDL URL: https://uat.fiadmin.com/scs.webservi...toService.asmx

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

Expand|Select|Wrap|Line Numbers
  1. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:scs="http://www.natinc.com/SCSAutoService/">
  2.    <soapenv:Header/>
  3.    <soapenv:Body>
  4.       <scs:GetRates>
  5.          <!--Optional:-->
  6.          <scs:objGetRatesRequest>
  7.             <!--Optional:-->
  8.             <scs:UserId>VPP</scs:UserId>
  9.             <!--Optional:-->
  10.             <scs:Password>jBH5Mspc</scs:Password>
  11.             <!--Optional:-->
  12.             <scs:TpaCode>DEMO</scs:TpaCode>
  13.             <!--Optional:-->
  14.             <scs:ErrorMessage>0</scs:ErrorMessage>
  15.             <!--Optional:-->
  16.             <scs:ErrorCode>0</scs:ErrorCode>
  17.             <!--Optional:-->
  18.             <scs:RequestGroup>0</scs:RequestGroup>
  19.             <!--Optional:-->
  20.             <scs:Trim>0</scs:Trim>
  21.             <scs:ChromeStyle>0</scs:ChromeStyle>
  22.             <!--Optional:-->
  23.             <scs:VINPattern>0</scs:VINPattern>
  24.             <!--Optional:-->
  25.             <scs:DealerNo>MENU004</scs:DealerNo>
  26.             <!--Optional:-->
  27.             <scs:NewUsed>N</scs:NewUsed>
  28.             <!--Optional:-->
  29.             <scs:VIN>1N4AL3AP1DC121302</scs:VIN>
  30.             <scs:VehicleYear>0</scs:VehicleYear>
  31.             <!--Optional:-->
  32.             <scs:VehicleMake>0</scs:VehicleMake>
  33.             <!--Optional:-->
  34.             <scs:VehicleModel>0</scs:VehicleModel>
  35.             <scs:VehiclePurchasePrice>0.00</scs:VehiclePurchasePrice>
  36.             <scs:VehicleOdometer>24001</scs:VehicleOdometer>
  37.             <!--Optional:-->
  38.             <scs:TonRating>0</scs:TonRating>
  39.             <!--Optional:-->
  40.             <scs:AspirationCode>0</scs:AspirationCode>
  41.             <!--Optional:-->
  42.             <scs:DrivingWheels>0</scs:DrivingWheels>
  43.             <!--Optional:-->
  44.             <scs:SegmentationCode>0</scs:SegmentationCode>
  45.             <!--Optional:-->
  46.             <scs:Cylinders>0</scs:Cylinders>
  47.             <scs:SaleDate>2014-03-26T00:00:00</scs:SaleDate>
  48.             <scs:FinancedAmount>0</scs:FinancedAmount>
  49.             <scs:GIPIteration>0</scs:GIPIteration>
  50.             <scs:MonthlyPayment>0</scs:MonthlyPayment>
  51.             <scs:FinanceTerm>0</scs:FinanceTerm>
  52.             <!--Optional:-->
  53.             <scs:FinanceType>0</scs:FinanceType>
  54.             <scs:InserviceDate>2014-03-26T00:00:00</scs:InserviceDate>
  55.             <scs:DOBBuyer>0001-01-01T00:00:00</scs:DOBBuyer>
  56.             <scs:DOBCoBuyer>0001-01-01T00:00:00</scs:DOBCoBuyer>
  57.             <!--Optional:-->
  58.             <scs:FuelType>0</scs:FuelType>
  59.             <scs:VehiclePurchaseDate>0001-01-01T00:00:00</scs:VehiclePurchaseDate>
  60.             <scs:FullManufWarrMonths>0</scs:FullManufWarrMonths>
  61.             <scs:FullManufWarrMiles>0</scs:FullManufWarrMiles>
  62.             <scs:PowerTrainManufWarrMonths>0</scs:PowerTrainManufWarrMonths>
  63.             <scs:PowerTrainManufWarrMiles>0</scs:PowerTrainManufWarrMiles>
  64.             <scs:FinanceApr>0</scs:FinanceApr>
  65.             <!--Optional:-->
  66.             <scs:Surcharges>0</scs:Surcharges>
  67.             <scs:MSRP>0</scs:MSRP>
  68.             <!--Optional:-->
  69.             <scs:ProductCollection>
  70.                <!--Zero or more repetitions:-->
  71.                <scs:Product>
  72.                   <!--Optional:-->
  73.                   <scs:Code>0</scs:Code>
  74.                   <!--Optional:-->
  75.                   <scs:Description>0</scs:Description>
  76.                   <scs:ExtractPosition>0</scs:ExtractPosition>
  77.                </scs:Product>
  78.             </scs:ProductCollection>
  79.             <!--Optional:-->
  80.             <scs:CultureName>0</scs:CultureName>
  81.          </scs:objGetRatesRequest>
  82.       </scs:GetRates>
  83.    </soapenv:Body>
  84. </soapenv:Envelope>
  85.  
Here are the first few lines of the SOAP response that comes back in SoapUI:

Expand|Select|Wrap|Line Numbers
  1. <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">
  2.    <soap:Body>
  3.       <GetRatesResponse xmlns="http://www.natinc.com/SCSAutoService/">
  4.          <GetRatesResult>
  5.             <PlanRates>
  6.                <PlanRate>
  7.                   <Plan>
  8.                      <PlanDescriptions/>
  9.                      <ProgramDescriptions/>
  10.                      <ProductTypeCode>VSC</ProductTypeCode>
  11.                      <ProductTypeDescription>Vehicle Service Contract</ProductTypeDescription>
  12.                      <PlanCode>M6</PlanCode>
  13.                      <PlanDescription>Silver</PlanDescription>
  14.                      <ContractType>1</ContractType>
  15.                      <PlanId>860</PlanId>
  16.                      <RateBook>422</RateBook>
  17.                      <OwnershipTypeCode>A</OwnershipTypeCode>
  18.                      <ContractPlanName/>
  19.                      <ProgramDescription>Menu Integration VSC</ProgramDescription>
  20.                      <ProgramID>68</ProgramID>
  21.                      <Discountable>0</Discountable>
  22.                   </Plan>
  23.                   <RateClassMoneys>
  24.                      <RateClassMoney>
  25.                         <TermMile>
  26.                            <TermId>6</TermId>
  27.                            <Term>12</Term>
  28.                            <Mileage>12000</Mileage>
  29.                         </TermMile>
  30.                         <Deductible>
  31.                            <DeductTypeDescriptions/>
  32.                            <DeductId>1</DeductId>
  33.                            <DeductAmt>0.00</DeductAmt>
  34.                            <DeductType/>
  35.                            <ReducedAmount>0</ReducedAmount>
  36.                         </Deductible>
  37.                         <Rate>
  38.                            <BandCode/>
  39.                            <OverrideFlag>false</OverrideFlag>
  40.                            <OptionGroupId>188</OptionGroupId>
  41.                            <RateId>519461</RateId>
  42.                            <RetailRate>1145.00</RetailRate>
  43.                            <NetRate>1145.00</NetRate>
  44.                            <MaxRetailRate>0</MaxRetailRate>
  45.                            <MinRetailRate>0</MinRetailRate>
  46.                            <RegulatedRuleId>0</RegulatedRuleId>
  47.                            <PDFFormNo>VSC</PDFFormNo>
  48.                            <VehicleClass>1</VehicleClass>
  49.                            <ExpirationDate>2015-03-26T00:00:00</ExpirationDate>
  50.                            <ExpirationMileage>36001</ExpirationMileage>
  51.                            <MarkupMin>0</MarkupMin>
  52.                            <MarkupMax>0</MarkupMax>
  53.                         </Rate>
  54.  
  55.  
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!
Apr 22 '14 #1
0 1109

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rossz | last post by:
I'm trying to integrate with a product procurement system that is set up for SOAP w/WSDL. I have the portion that grabs new purchase orders working, but I am failing when it comes to the PO...
1
by: Numberwhun | last post by:
Hello everyone! I am trying to learn java and have run into kind of a snag. Here is the code that I have so far: ------ <begin_code> ---------- import javax.swing.*; import...
0
by: 45 pretoria 45 pretoria | last post by:
From:Dr.Garus Umoh Union Bank PLC. Head office: 40 Marina Lagos. Dear friend, A foreigner, late Engr. Johnson Creek, an Oil Merchant, until his death three years ago, banked with us here...
9
by: Aaron Smith | last post by:
Our company is trying to decide to go .Net or not and which language to use if we do. I have been doing a lot of research on .Net and VB.Net. I used to be a VB 6 developer till I started to work...
2
by: Ivan | last post by:
Recently i have encounter some problem with C# programming. The application of mine can't seem to run well with sql server 2000 and i think the reason for this is the connection between this two...
23
by: Bloke at the pennine puddle | last post by:
This query is for me, but I think that it'll be of use to just about everyone who participates in this news group. I learn better if I have a decent example to study, so I'm looking for publicly...
2
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I need to pass back multiple selection from an asp.net app datagrid and update a table. How should I handle this? I get the values by looping he datagrid, but, do I execute the update stored...
7
by: Rnykster | last post by:
I know a little about Access and have made several single table databases. Been struggling for about a month to do a multiple table database with no success. Help! There are two tables. First...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.