Я не очень опытен с SOAP API.
Я пытаюсь разработать API Travelport (GDS) для вызова службы с именем ReferenceLookupService, я могу сделать этот вызов с помощью CURL
curl --location --request POST 'https://emea.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/SystemService' \
--header "Authorization: Basic $(echo -n 'Universal API/<USERNAME>:<PASSWORD>' | base64)" \
--header 'Content-Type: application/xml' \
--data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:util="http://www.travelport.com/schema/util_v49_0" xmlns:com="http://www.travelport.com/schema/common_v49_0">
<soapenv:Header/>
<soapenv:Body>
<util:ReferenceDataRetrieveReq TraceId="doesntmatter-8176" TypeCode="City" xmlns="http://www.travelport.com/schema/util_v49_0">
<com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
<util:ReferenceDataSearchModifiers MaxResults="20" ProviderCode="1V"/>
</util:ReferenceDataRetrieveReq>
</soapenv:Body>
</soapenv:Envelope>'
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Body><sys:PingRsp TraceId="test"
Но в java у меня проблемы. Я уже использовал wsimport для импорта классов Java, и у меня есть класс ReferenceLookupService, который выглядит следующим образом:
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.9-b130926.1035
* Generated source version: 2.2
*
*/
@WebServiceClient(name = "ReferenceDataLookupService", targetNamespace = "http://www.travelport.com/service/util_v49_0", wsdlLocation = "file:/C:/Users/josem/Desktop/uAPI_WSDLschema_Release-V19.2.0.12/util_v49_0/Util.wsdl")
public class ReferenceDataLookupService
extends Service
{
private final static URL REFERENCEDATALOOKUPSERVICE_WSDL_LOCATION;
private final static WebServiceException REFERENCEDATALOOKUPSERVICE_EXCEPTION;
private final static QName REFERENCEDATALOOKUPSERVICE_QNAME = new QName("http://www.travelport.com/service/util_v49_0", "ReferenceDataLookupService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("file:/C:/Users/josem/Desktop/uAPI_WSDLschema_Release-V19.2.0.12/util_v49_0/Util.wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
REFERENCEDATALOOKUPSERVICE_WSDL_LOCATION = url;
REFERENCEDATALOOKUPSERVICE_EXCEPTION = e;
}
public ReferenceDataLookupService() {
super(__getWsdlLocation(), REFERENCEDATALOOKUPSERVICE_QNAME);
}
public ReferenceDataLookupService(WebServiceFeature... features) {
super(__getWsdlLocation(), REFERENCEDATALOOKUPSERVICE_QNAME, features);
}
public ReferenceDataLookupService(URL wsdlLocation) {
super(wsdlLocation, REFERENCEDATALOOKUPSERVICE_QNAME);
}
public ReferenceDataLookupService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, REFERENCEDATALOOKUPSERVICE_QNAME, features);
}
public ReferenceDataLookupService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public ReferenceDataLookupService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns ReferenceDataLookupPortType
*/
@WebEndpoint(name = "ReferenceDataLookupPort")
public ReferenceDataLookupPortType getReferenceDataLookupPort() {
return super.getPort(new QName("http://www.travelport.com/service/util_v49_0", "ReferenceDataLookupPort"), ReferenceDataLookupPortType.class);
}
/**
*
* @param features
* A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns ReferenceDataLookupPortType
*/
@WebEndpoint(name = "ReferenceDataLookupPort")
public ReferenceDataLookupPortType getReferenceDataLookupPort(WebServiceFeature... features) {
return super.getPort(new QName("http://www.travelport.com/service/util_v49_0", "ReferenceDataLookupPort"), ReferenceDataLookupPortType.class, features);
}
private static URL __getWsdlLocation() {
if (REFERENCEDATALOOKUPSERVICE_EXCEPTION!= null) {
throw REFERENCEDATALOOKUPSERVICE_EXCEPTION;
}
return REFERENCEDATALOOKUPSERVICE_WSDL_LOCATION;
}
}
Но я понятия не имею, как сделать вышеупомянутый вызов SOAP с помощью этой службы учебный класс. Что я могу попробовать дальше?