Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » calling the web service directly from the client module
calling the web service directly from the client module [message #1816373] Mon, 28 October 2019 14:48 Go to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 26
Registered: April 2019
Junior Member
Hi,
In my application I would like to use the web service consumer. For this purpose, I used the built-in wizard (File -> New -> Scout -> Scout Web Service) and generated a new server.ws module from wsdl file. By default, it was associated via pom.xml with the server module.

Is it possible to call these web services directly from the client module without using the server module?

[Updated on: Mon, 28 October 2019 15:15]

Report message to a moderator

Re: calling the web service directly from the client module [message #1816502 is a reply to message #1816373] Wed, 30 October 2019 09:37 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 153
Registered: September 2011
Senior Member
Hi Krzysztof

I would not recommend calling the web Service from the Client module.

The jaxws module requires a server environment (e.g. uses IServerSession and ServerRunContext). Therefore, it includes a dependency to the Scout server module.

If you want to call it from the client, this would mean that you introduce server dependencies in the client, which brings a lot of challenges.
It would be necessary to bridge from the client environment to a server environment for the jaxws call. This might be possible using the Server Bridge module, but we have never tested it and it might have other drawbacks.

I would strongly recommend calling the webservice from the backend and use a normal backend service to publish it to the client using the service tunnel. This has the advantage that you have like a service facade in front of the webservice which gives you the possibility to adapt the API of the webservice to your needs and allows you to apply e.g. permissions checks centrally.

Do you have any issues with calling the webservice from the backend or why do you want to move it to the client?

Hope this helps

Regards
Mat
Re: calling the web service directly from the client module [message #1816651 is a reply to message #1816502] Mon, 04 November 2019 08:42 Go to previous messageGo to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 26
Registered: April 2019
Junior Member
Hi,
Thanks for the detailed explanation.

Do you have any issues with calling the webservice from the backend or why do you want to move it to the client?


I have to use a passive web service to download information directly to the form . I don't need to do additional business logic or write results to the database here. Thus, the use of the server module forces unnecessary overhead of communication and conversion/copying of data, because web service data structures are not stored in the shared module but in server.ws module. If the web service in the scout platform are so strongly associated with the server module, then I will go in this direction.


By the way, I will ask about one more problem encountered:
I am trying to generate the server.ws module using the Eclipse Scout wizard, where I need to load WSDL using SOAP version 1.2 tags: "soap12:"
When I point to the WSDL file in the "Create new Web Service Consumer" -> "WSDL URL" field, I get this error message:
Either this Web Service uses SOAP encoding (use=encoded) or contains no operations. Ensure the Web Service uses literal encoding.
The web service schema is correct: it contains operations and use = "literal". When I replace the tags "soap12:" with "soap" in WSDL file, then the error message disappears and I can load it without any problems.

Does the Eclipse Scout web service wizard support "soap12:" tags?

[Updated on: Mon, 04 November 2019 08:44]

Report message to a moderator

Re: calling the web service directly from the client module [message #1816753 is a reply to message #1816651] Wed, 06 November 2019 10:54 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 153
Registered: September 2011
Senior Member
Hi Krzysztof

Do you have a sample WSDL that is causing this error which you can share?
Then we could have a look at what the wizard is complaining about.

Thanks
Mat
Re: calling the web service directly from the client module [message #1816759 is a reply to message #1816753] Wed, 06 November 2019 12:18 Go to previous messageGo to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 26
Registered: April 2019
Junior Member
This is the WSDL, which I mentioned earlier:
https://wyszukiwarkaregon.stat.gov.pl/wsBIR/wsdl/UslugaBIRzewnPubl-ver11-prod.wsdl

In addition, I clarify that the above workaround, consisting of changing the "Soap12:" to "Soap" tags, only allows the wizard to go through. However, when running the web service later, the server responds with an error:
com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 415: Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'multipart/related; type="application/xop+xml"'.


Here, it helps to upload the original WSDL to the src/main/resources/WEB-INF/wsdl directory in the server.ws module.

Re: calling the web service directly from the client module [message #1816775 is a reply to message #1816759] Wed, 06 November 2019 16:47 Go to previous message
Matthias Villiger is currently offline Matthias VilligerFriend
Messages: 153
Registered: September 2011
Senior Member
Hi Krzysztof

This is a bug in the wizard.
It has been fixed with commit 5a668e471096dad43733035cd5bb30217b72083c and will be part of the December release of Eclipse.

Thanks a lot

Regards
Mat
Previous Topic:How to block a specific Job
Next Topic:Database Connection Pool causing JUnit tests to timeout
Goto Forum:
  


Current Time: Fri Dec 06 10:13:26 GMT 2019

Powered by FUDForum. Page generated in 0.01930 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top