api-gateway icon indicating copy to clipboard operation
api-gateway copied to clipboard

soapProxy and WSDL with soap:address and https

Open ciis0 opened this issue 2 years ago • 2 comments

Hi,

I have a WSDL with a <soap:address location="https://svc-host/MyService" />, but membrane still tries to use http.

<soapProxy port="9011" wsdl="file:wsdl.xml" />

(Because the Service WSDL has multiple services (and I cannot ad-hoc change that), I use a locally modified WSDL xml.)

I tried 4.8.7 and 5.2.0.

15:01:13,874 DEBUG 23 Connection Acceptor '*:9011' HttpEndpointListener:123 - Accepted connection from /[0:0:0:0:0:0:0:1]:48278
15:01:13,878 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 HttpServerHandler:81 - New ServerThread created. 1
15:01:13,880 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 Message:157 - createBody
15:01:13,884 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: Rule Matching Interceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,884 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 RuleManager:226 - Host from rule: *;   Host from parameter rule key: localhost:9011
15:01:13,885 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 RuleManager:226 - Host from rule: *;   Host from parameter rule key: localhost:9011
15:01:13,885 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 RuleManager:226 - Host from rule: *;   Host from parameter rule key: localhost:9011
15:01:13,885 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 RuleManager:226 - Host from rule: *;   Host from parameter rule key: localhost:9011
15:01:13,890 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 RuleMatchingInterceptor:81 - Matching Rule found for RuleKey localhost:9011 POST /MyService?wsdl 9011 0:0:0:0:0:0:0:1
15:01:13,891 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: com.predic8.membrane.core.interceptor.LoggingContextInterceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,894 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler:   Store Interceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,898 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: Dispatching Interceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,898 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 DispatchingInterceptor:79 - destination: http://svc-host:443/MyService?wsdl
15:01:13,899 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: Reverse Proxy on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,899 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: User Feature on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,900 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: WSDL Publisher on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,900 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: Web Service Explorer on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,901 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:108 - Invoking request handler: HTTPClient on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:13,901 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 HttpClient:211 - try # 0 to http://svc-host:443/MyService?wsdl
15:01:13,901 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 ConnectionManager:118 - connection requested for svc-host:443
15:01:13,901 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 ConnectionManager:120 - Number of connections in pool: 0
15:01:13,966 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 Connection:116 - Opened connection on localPort: 41852
15:01:14,031 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:148 - Invoking abortion handler: Web Service Explorer on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:14,032 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:148 - Invoking abortion handler: WSDL Publisher on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:14,032 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:148 - Invoking abortion handler: WSDL Rewriting Interceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:14,032 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:148 - Invoking abortion handler: Reverse Proxy on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:14,033 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:148 - Invoking abortion handler:   Store Interceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:14,033 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 InterceptorFlowController:148 - Invoking abortion handler: com.predic8.membrane.core.interceptor.LoggingContextInterceptor on exchange: [time:26 Oct 2023,requestURI:/MyService?wsdl]
15:01:14,061 DEBUG 25 RouterThread /0:0:0:0:0:0:0:1:48278 HttpServerHandler:169 - No response received. Maybe increase the keep-alive timeout on the server.

I tried the recommendation from https://github.com/membrane/api-gateway/issues/160#issuecomment-1435702834, but when using "service://" in location an exception occurs:

org.springframework.context.ApplicationContextException: Failed to start bean 'router'
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:357)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:156)
        at org.springframework.context.support.DefaultLifecycleProcessor.start(DefaultLifecycleProcessor.java:104)
        at org.springframework.context.support.AbstractApplicationContext.start(AbstractApplicationContext.java:1441)
        at com.predic8.membrane.core.Router.init(Router.java:147)
        at com.predic8.membrane.core.RouterCLI.main(RouterCLI.java:39)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at com.predic8.membrane.core.Starter.main(Starter.java:47)
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Could not download the WSDL 'file:ura.wsdl.xml'.
        at com.predic8.membrane.core.Router.start(Router.java:316)
        at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:179)
        ... 12 more
Caused by: java.lang.IllegalArgumentException: Could not download the WSDL 'file:service.wsdl.xml'.
        at com.predic8.membrane.core.rules.SOAPProxy.parseWSDL(SOAPProxy.java:158)
        at com.predic8.membrane.core.rules.SOAPProxy.configure(SOAPProxy.java:205)
        at com.predic8.membrane.core.rules.SOAPProxy.init(SOAPProxy.java:278)
        at com.predic8.membrane.core.rules.AbstractProxy.init(AbstractProxy.java:163)
        at com.predic8.membrane.core.Router.initRemainingRules(Router.java:269)
        at com.predic8.membrane.core.Router.init(Router.java:263)
        at com.predic8.membrane.core.Router.start(Router.java:288)
        ... 13 more
Caused by: java.lang.IllegalArgumentException: WSDL endpoint location 'service://name/MyService' is not an URL.
        at com.predic8.membrane.core.rules.SOAPProxy.parseWSDL(SOAPProxy.java:141)
        ... 19 more
Caused by: java.net.MalformedURLException: unknown protocol: service
        at java.base/java.net.URL.<init>(URL.java:681)
        at java.base/java.net.URL.<init>(URL.java:569)
        at java.base/java.net.URL.<init>(URL.java:516)
        at com.predic8.membrane.core.rules.SOAPProxy.parseWSDL(SOAPProxy.java:114)
        ... 19 more

ciis0 avatar Oct 26 '23 14:10 ciis0

I tried with master (98bb9a21c6521b7950724c43d49a020561328732), but it still does not work.

ciis0 avatar Nov 07 '23 16:11 ciis0

I tried with master (98bb9a2), but it still does not work.

@predic8 can you please reopen?

ciis0 avatar Nov 15 '23 22:11 ciis0

@t-burch is this fixed now?

predic8 avatar May 17 '24 13:05 predic8

seems to work fine with master (74d70886bcaaac69c22dd555c2583b6409a4a500) now :)

ciis0 avatar May 17 '24 15:05 ciis0