Creating client using Ws import not generating service and port class
Asked Answered
V

1

7

I generated wsdl using Ws gen in my application. For that wsdl I tried to generate client so used Ws import with Maven. Client generation is successful but only request, response, exception, object factory and package classes are created.

There is no class for the service reference. What is the issue?

If service class not needed how to call the service from my client file

Thanks

Valerlan answered 4/8, 2018 at 17:20 Comment(1)
Hi, welcome to StackOverflow. Could you edit your question please to provide more information concerning the context: what development tool are you using to generate the WSDL and what options are you taking? Thanks.Bondstone
U
9

I have once seen this problem with Java SE 'wsimport' command. In my case service publisher's 'wsdl' SOAP port uses non-standard SOAP 1.2 binding. Also, it's Service does not contain any usable ports.
It might show you some warning messages like this:

[WARNING] Ignoring SOAP port "XXXSoap12HttpPort":
it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.
...
[WARNING] Service "XXXService" does not contain any usable ports.
try running wsimport with -extension switch.
...

Adding -extension switch to the 'wsimport' command did the magic in this case.

wsimport -keep -p com.samlpe.jaxws.client -extension <WSDL URL>
Untread answered 10/6, 2019 at 5:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.