shall be possible to implement a soap webservice in Spring using #Endpoint annotation and route all message that are sent to a specific endpoint path to the same method?
I need the "behavior" already in place with #PayloadRoot or #SoapAction but "based" on endpoint path of the request.
Thanks in advance for support.
Related
Existing #RequestMapping annotation can only delegate request path to different controllers & methods but not checking request domain itself.
Is it possible to set spring boot to handle request from "www.domainA.com" & "www.domainB.com" to respond differently by using the different controller?
Thanks.
Browsers send the Domain in the HTTP Header "Host".
#RequestMapping.headers can be used to match only requests for a specific domain.
Can a WSDL exist without an Endpoint defined in it? I received an WSDL from client which dont have have endpoint defined.
Just want to know what are the possibilities if it exist somewhere else or in some other relative location etc since I don't have expertise in SOAP services.
To make clear further the WSDL dont have soap:address neither service tag.
It sure can. The same WSDL can be defined for multiple endpoints. You need to ask the client which address(es) to use with that.
You can bind the end point at runtime dynamically even if it has not been defined in the WSDL. Below is the example of javax.xml.ws.BindingProvider. You can configure your end point in DB or configuration file thus it can be changed as per the environment.
((BindingProvider)port).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPoint);
I have to change the namespace of the incoming messages to our webservice.
The consumer route looks like the following:
from("cxf:/myservice?serviceClass=myServiceClass")...
I've tried to add somehow an interceptor to this(parameter properties.in, properties.inInterceptors?), but I don't get it how to configure it to my route.
We are not configuring our cxf endpoints in spring so I have to solve it with additional parameters to the route.
I think an interceptor with the transformation feature mentioned in the cxf documentation is the right solution, but I was not able to configure it correctly.
How can I add an interceptor to the route?
Or is there another way to change the namespace of the incoming message?
kind regards,
soilworker
I've found a solution:
It is possible to say something like from(endpoint), so I've created an instance of CxfEndpoint and there I can set the cxfEndpointConfigurer.
In this configurer I can add an interceptor which removes the namespace(see transformation feature of cxf).
Maybe it also works somehow with the from(uri) syntax, but I don't know how.
I am using Spring with Jersey REST API for REST webservices.
I want print the inbound and outbound Payloads (XML Requests Data) to log file/console.
Is there any way todo this.
Thanks
LoggingFilter can help you with that. You need to provide an instance of this filter to JAX-RS runtime - by default the entity is not printed. See code samples is Registering Resources and Providers in Jersey 2 to see how to register your logger (I am using LoggingFilter in these samples).
I need to set a custom soap header attribute on a jax-ws generated webservice client. I my case all webservice calls must go through a proxy server requiring a specific token (recieved from the web request header) to be present in the soap request header. E.g.:
1 CarServiceService service = null;
2 service = new CarServiceService(new URL(url), new QName(qname);
3 CarServiceEndpoint port = service.getCarServicePort();
It seems that in line 3 the wsdl is retrieved and my call fails due to the missing security token. Could any one point to direction on how this is done?
A detailed example has been mentioned here:
Creating and Deploying JAX-WS web service on Tomcat 6
This article shows how to create and use security token.
I was able to resolve my issue from this blog post: http://tugdualgrall.blogspot.dk/2009/02/jax-ws-how-to-configure-service-end_17.html
Basically I needed to set the webservice endpoint manually instead of the framework trying to extract the endpoint from the requested wsdl - which failed.