function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dev TNOPPV5Dev TNOPPV5 

Convert into proper xml format

Hello guys,

I am getting following xml format in response:

GetTaxRequest:[Addresses=ArrayOfBaseAddress:[BaseAddress=(BaseAddress:[AddressCode=O, AddressCode_type_info=(AddressCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), City=BAINBRIDGE ISLAND, City_type_info=(City, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Country=US, Country_type_info=(Country, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Latitude=null, Latitude_type_info=(Latitude, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Line1=900 WINSLOW WAY E, Line1_type_info=(Line1,http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Line2=null, Line2_type_info=(Line2, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Line3=null, Line3_type_info=(Line3, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Longitude=null, Longitude_type_info=(Longitude, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), PostalCode=98110-2450, PostalCode_type_info=(PostalCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Region=WA, Region_type_info=(Region, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), TaxRegionId=0, TaxRegionId_type_info=(TaxRegionId, http://www.w3.org/2001/XMLSchema, int, 1, 1, false), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(AddressCode, Line1, Line2, Line3, City, Region, PostalCode, Country, TaxRegionId)], BaseAddress:[AddressCode=D, AddressCode_type_info=(AddressCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), City=BAINBRIDGE ISLAND, City_type_info=(City, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Country=US, Country_type_info=(Country, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Latitude=null, Latitude_type_info=(Latitude, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Line1=900 WINSLOW WAY E, Line1_type_info=(Line1, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Line2=null, Line2_type_info=(Line2, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Line3=null, Line3_type_info=(Line3, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Longitude=null, Longitude_type_info=(Longitude, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), PostalCode=98110-2450, PostalCode_type_info=(PostalCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Region=WA, Region_type_info=(Region, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), TaxRegionId=0, TaxRegionId_type_info=(TaxRegionId, http://www.w3.org/2001/XMLSchema, int, 1, 1, false), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(AddressCode, Line1, Line2, Line3, City, Region, PostalCode, Country, TaxRegionId)]), BaseAddress_type_info=(BaseAddress, http://avatax.avalara.com/services, BaseAddress, 0, -1, true), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(BaseAddress)], Addresses_type_info=(Addresses, http://avatax.avalara.com/services, ArrayOfBaseAddress, 0, 1, false), BatchCode=null, BatchCode_type_info=(BatchCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), BusinessIdentificationNo=null, BusinessIdentificationNo_type_info=(BusinessIdentificationNo, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Commit_x=false, Commit_x_type_info=(Commit, http://www.w3.org/2001/XMLSchema, boolean, 1, 1, false), CompanyCode=ITS, CompanyCode_type_info=(CompanyCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), CurrencyCode=null, CurrencyCode_type_info=(CurrencyCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), CustomerCode=Burlington Textiles Corp of America, CustomerCode_type_info=(CustomerCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), CustomerUsageType=, CustomerUsageType_type_info=(CustomerUsageType, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), DestinationCode=D, DestinationCode_type_info=(DestinationCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), DetailLevel=Tax, DetailLevel_type_info=(DetailLevel, http://avatax.avalara.com/services, DetailLevel, 1, 1, false), Discount=0.0, Discount_type_info=(Discount, http://www.w3.org/2001/XMLSchema, decimal, 1, 1, false), DocCode=006i000000XaBVoAAN, DocCode_type_info=(DocCode,http://www.w3.org/2001/XMLSchema, string, 0, 1, false), DocDate=2015-06-19 00:00:00, DocDate_type_info=(DocDate, http://www.w3.org/2001/XMLSchema, date, 1, 1, false), DocType=SalesInvoice, DocType_type_info=(DocType, http://avatax.avalara.com/services, DocumentType, 1, 1, false), ExchangeRate=1.0, ExchangeRateEffDate=2015-11-23 00:00:00, ExchangeRateEffDate_type_info=(ExchangeRateEffDate, http://www.w3.org/2001/XMLSchema, date, 1, 1, false), ExchangeRate_type_info=(ExchangeRate, http://www.w3.org/2001/XMLSchema, decimal, 1, 1, false), ExemptionNo=null, ExemptionNo_type_info=(ExemptionNo, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), HashCode=null, HashCode_type_info=(HashCode, http://www.w3.org/2001/XMLSchema, int, 1, 1, false), Lines=ArrayOfLine:[Line=(Line:[Amount=2000.00, Amount_type_info=(Amount, http://www.w3.org/2001/XMLSchema, decimal, 1, 1, false), BusinessIdentificationNo=null, BusinessIdentificationNo_type_info=(BusinessIdentificationNo, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), CustomerUsageType=null, CustomerUsageType_type_info=(CustomerUsageType, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Description=null, Description_type_info=(Description, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), DestinationCode=null, DestinationCode_type_info=(DestinationCode,http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Discounted=false, Discounted_type_info=(Discounted, http://www.w3.org/2001/XMLSchema, boolean, 1, 1, false), ExemptionNo=null, ExemptionNo_type_info=(ExemptionNo, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), ItemCode=, ItemCode_type_info=(ItemCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), No=0, No_type_info=(No, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), OriginCode=null, OriginCode_type_info=(OriginCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Qty=2.00, Qty_type_info=(Qty, http://www.w3.org/2001/XMLSchema, decimal, 1, 1, false), Ref1=null, Ref1_type_info=(Ref1, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), Ref2=null, Ref2_type_info=(Ref2, http://www.w3.org/2001/XMLSchema,  string, 0, 1, false), RevAcct=null, RevAcct_type_info=(RevAcct, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), TaxCode=null, TaxCode_type_info=(TaxCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), TaxIncluded=null, TaxIncluded_type_info=(TaxIncluded,http://www.w3.org/2001/XMLSchema, boolean, 0, 1, false), TaxOverride=TaxOverride:[Reason=Tax Amount, Reason_type_info=(Reason, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), TaxAmount=260.00, TaxAmount_type_info=(TaxAmount, http://www.w3.org/2001/XMLSchema, decimal, 1, 1, false), TaxDate=2015-06-19 00:00:00, TaxDate_type_info=(TaxDate, http://www.w3.org/2001/XMLSchema, date, 1, 1, false), TaxOverrideType=TaxAmount, TaxOverrideType_type_info=(TaxOverrideType, http://avatax.avalara.com/services, TaxOverrideType, 1, 1, false), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(TaxOverrideType, TaxAmount, TaxDate, Reason)], TaxOverride_type_info=(TaxOverride, http://avatax.avalara.com/services, TaxOverride, 0, 1, false), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(No, OriginCode, BusinessIdentificationNo, DestinationCode, ItemCode, TaxCode, Qty, Amount, Discounted, RevAcct, ...)]), Line_type_info=(Line, http://avatax.avalara.com/services, Line, 0, -1, true), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(Line)], Lines_type_info=(Lines, http://avatax.avalara.com/services, ArrayOfLine, 0, 1, false), LocationCode=null, LocationCode_type_info=(LocationCode,http://www.w3.org/2001/XMLSchema, string, 0, 1, false), OriginCode=O, OriginCode_type_info=(OriginCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), PaymentDate=2015-11-23 00:00:00, PaymentDate_type_info=(PaymentDate, http://www.w3.org/2001/XMLSchema, date, 1, 1, false), PurchaseOrderNo=null, PurchaseOrderNo_type_info=(PurchaseOrderNo, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), ReferenceCode=null, ReferenceCode_type_info=(ReferenceCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), SalespersonCode=null, SalespersonCode_type_info=(SalespersonCode, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), ServiceMode=Automatic, ServiceMode_type_info=(ServiceMode, http://avatax.avalara.com/services, ServiceMode, 1, 1, false), TaxOverride=null, TaxOverride_type_info=(TaxOverride, http://avatax.avalara.com/services, TaxOverride, 0, 1, false), apex_schema_type_info=(http://avatax.avalara.com/services, true, false), field_order_type_info=(CompanyCode, DocType, DocCode, DocDate, SalespersonCode, CustomerCode, CustomerUsageType, Discount, PurchaseOrderNo, ExemptionNo, …)]

I want convert this xml into proper xml. Can i do that?
 
ManojjenaManojjena
Hi Dev TNOPPV5,
Check with your webservice vendor ,some issue in responce they are sending .Contact them and send them the format of responce it has some issue from their webservice .
Thanks
Manoj
 
Dev TNOPPV5Dev TNOPPV5
Hello Manoj,

I created Apex class from "Generate from WSDL". Is there any way to create proper XML fromat ?

Thanks,
Bhavesh