|
11 | 11 | import jakarta.xml.ws.handler.PortInfo; |
12 | 12 |
|
13 | 13 | import com.microsoft.bingads.internal.HeaderHandler; |
| 14 | +import com.microsoft.bingads.internal.IRestfulServiceFactory; |
14 | 15 | import com.microsoft.bingads.internal.MessageHandler; |
15 | 16 | import com.microsoft.bingads.internal.OAuthWithAuthorizationCode; |
16 | 17 | import com.microsoft.bingads.internal.ServiceFactory; |
17 | 18 | import com.microsoft.bingads.internal.ServiceFactoryFactory; |
| 19 | +import com.microsoft.bingads.internal.RestfulServiceFactoryFactory; |
18 | 20 | import com.microsoft.bingads.internal.ServiceUtils; |
19 | 21 | import com.microsoft.bingads.internal.utilities.Lazy; |
20 | 22 | import com.microsoft.bingads.v13.adinsight.IAdInsightService; |
@@ -47,6 +49,7 @@ public class ServiceClient<T> { |
47 | 49 |
|
48 | 50 | private final Class<T> serviceInterface; |
49 | 51 | private final ServiceFactory serviceFactory; |
| 52 | + private final IRestfulServiceFactory restfulServiceFactory; |
50 | 53 | private ApiEnvironment environment; |
51 | 54 | private final Lazy<Service> service; |
52 | 55 |
|
@@ -106,6 +109,8 @@ public ServiceClient(AuthorizationData authorizationData, ApiEnvironment environ |
106 | 109 | this.environment = environment; |
107 | 110 |
|
108 | 111 | serviceFactory = ServiceFactoryFactory.createServiceFactory(); |
| 112 | + |
| 113 | + restfulServiceFactory = RestfulServiceFactoryFactory.createServiceFactory(); |
109 | 114 |
|
110 | 115 | service = new Lazy<Service>(() -> { |
111 | 116 | Service newService = serviceFactory.createService(this.serviceInterface, this.environment); |
@@ -172,6 +177,6 @@ T createSoapPort(Map<String, String> headers) { |
172 | 177 | } |
173 | 178 |
|
174 | 179 | T createRestService(Map<String, String> headers) { |
175 | | - return RestfulServiceFactory.createServiceClient(headers, environment, serviceInterface, () -> createSoapPort(headers)); |
| 180 | + return restfulServiceFactory.createServiceClient(headers, environment, serviceInterface, () -> createSoapPort(headers)); |
176 | 181 | } |
177 | 182 | } |
0 commit comments