Привет, парень, мне нужно получить данные из веб-службы SOAP.Вот пример:
POST /b2b.asmx HTTP/1.1
Host: webservice.presstours.it
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<TtiPackageCosting xmlns="http://webservice.presstours.it/">
<TTI_PkgCostRQ EchoToken="string" TimeStamp="dateTime" Target="" Version="decimal" TransactionIdentifier="string" SequenceNmbr="nonNegativeInteger" TransactionStatusCode="" ReqRespVersion="string" ActionType="Book or Quote or Hold or Initiate or Ignore or Modify or Commit or Cancel or CommitOverrideEdits or VerifyPrice or Ticket" xmlns="http://www.opentravel.org/OTA/2003/05">
<POS>
<Source AgentSine="string" PseudoCityCode="string" ISOCountry="string" ISOCurrency="string" AgentDutyCode="string" AirlineVendorID="string" AirportCode="string" FirstDepartPoint="string" ERSP_UserID="string" TerminalID="string">
<RequestorID xsi:nil="true" />
<Position xsi:nil="true" />
<BookingChannel xsi:nil="true" />
</Source>
<Source AgentSine="string" PseudoCityCode="string" ISOCountry="string" ISOCurrency="string" AgentDutyCode="string" AirlineVendorID="string" AirportCode="string" FirstDepartPoint="string" ERSP_UserID="string" TerminalID="string">
<RequestorID xsi:nil="true" />
<Position xsi:nil="true" />
<BookingChannel xsi:nil="true" />
</Source>
</POS>
<ProvisionalID ExpiryDateTime="string" />
<PackageRequest ID="string" Type="string" TravelCode="string" TourCode="string" BoardCode="string" PromotionCode="string" FreeChildrenQuantity="integer" BrandCode="string" ProductCode="string" AvailabilityInfo="Available or Unavailable or OnRequest or Confirmed">
<URL ShareSynchInd="" ShareMarketInd="" Type="string" DefaultInd="boolean" />
<CompanyName CompanyShortName="string" TravelSector="string" Code="string" CodeContext="string" Division="string" Department="string" />
<DateRange Start="string" Duration="string" End="string" />
<ItineraryItems>
<ItineraryItem xsi:nil="true" />
<ItineraryItem xsi:nil="true" />
</ItineraryItems>
<Extras>
<Extra xsi:nil="true" />
<Extra xsi:nil="true" />
</Extras>
</PackageRequest>
<PassengerListItems>
<PassengerListItem RPH="string" Telephone="string" TelephoneSpecified="boolean" Email="string" EmailSpecified="boolean" InsuranceRPH="string" Gender="" Nationality="string" BirthDate="date" LeadCustomerInd="boolean" Age="integer" Code="string" CodeContext="string" URI="anyURI">
<Name xsi:nil="true" />
<SpecialNeed xsi:nil="true" />
<SpecialNeed xsi:nil="true" />
<PassportInformation xsi:nil="true" />
</PassengerListItem>
<PassengerListItem RPH="string" Telephone="string" TelephoneSpecified="boolean" Email="string" EmailSpecified="boolean" InsuranceRPH="string" Gender="" Nationality="string" BirthDate="date" LeadCustomerInd="boolean" Age="integer" Code="string" CodeContext="string" URI="anyURI">
<Name xsi:nil="true" />
<SpecialNeed xsi:nil="true" />
<SpecialNeed xsi:nil="true" />
<PassportInformation xsi:nil="true" />
</PassengerListItem>
</PassengerListItems>
<Extras>
<Extra />
<Extra />
</Extras>
<TPA_Extensions>xml</TPA_Extensions>
</TTI_PkgCostRQ>
</TtiPackageCosting>
</soap12:Body>
</soap12:Envelope>
Я пытаюсь сделать этот вызов в Laravel, используя пакет laravel-soap, но я также не могу сделать запрос.Может кто-нибудь сказать мне метод, чтобы сделать запрос?На самом деле я использую этот код, чтобы попытаться отразить результаты, но я получил ошибку «Серверу не удалось обработать запрос. ---> Ссылка на объект не установлена на экземпляр объекта».
function show()
{
$wrapper = new \Artisaninweb\SoapWrapper\SoapWrapper();
$service = $wrapper->add('Presstours', function ($service) {
$service->wsdl('http://webservice.presstours.it/b2b.asmx?WSDL')
->cache(WSDL_CACHE_NONE)
->trace(true);
});
$data =
[
"TTI_PkgCostRQ"=>[
"POS" => [
"Source" => [
"RequestorID" => [
"ID" => "ZZZZZZZZZZ",
"MessagePassword" => "ZZZZZZZ"
]
]
],
"PackageRequest" =>
[
"ID" => "82346255"
],
"ItineraryItems" =>
[
"ItineraryItem" =>
[
"Accommodation" =>
[
"DateRange Start" => "1/07/2011",
"Duration" => "P10N",
"End" => "11/07/2011",
"RoomProfiles" =>
[
"RoomProfile"=>
[
"RoomType" => "DBL",
"RoomTypeCode" => "DBA4",
"Quantity" => "1",
"PassengerRPHs" =>
[
"ListOfPassengerRPH" => "1 2",
]
]
],
"MealPlans" =>
[
"MealPlan Plan" => "AI",
]
]
]
],
"PassengerListItems" =>
[
"PassengerListItem" =>
[
"RPH" =>"1",
"Code" => "10",
],
"PassengerListItem" =>
[
"RPH" => "2",
"Code" => "10"
]
]
]
];
$response = $service->call('Presstours.TtiPackageCosting', $data);
return response()->json($response);
}
}