[jboss-jira] [JBoss JIRA] (WFLY-4444) Ability to set WSDL URL

Alessio Soldano (JIRA) issues at jboss.org
Wed Mar 25 18:15:21 EDT 2015


    [ https://issues.jboss.org/browse/WFLY-4444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053488#comment-13053488 ] 

Alessio Soldano commented on WFLY-4444:
---------------------------------------

So, I've tried your app and found a bunch of issues.
First issue is about properly declaring a contract-first endpoint, that is an endpoint whose published contract is provided in a wsdl file in the deployment. You're not specifying the "serviceName" in @WebService, hence the ws stack is not using your wsdl and it's generating a new one from the code instead. While this is an error on user side, it's still something that the stack should notify the user about, so I've created https://issues.jboss.org/browse/JBWS-3899 . If you're wondering how I spotted this issue, I was looking at the log during deployment and noticed the "annotationWsdlLocation" was null:
{noformat}
22:24:08,349 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-1) JBWS024061: Adding service endpoint metadata: id=SimpleEcho
 address=http://localhost:8080/simple-ws-1.0-SNAPSHOT/SimpleEcho
 implementor=com.tad.ws.SimpleEcho
 serviceName={http://ws.tad.com/}SimpleEchoService
 portName={http://ws.tad.com/}SimpleEchoPort
 annotationWsdlLocation=null
 wsdlLocationOverride=null
 mtomEnabled=false
{noformat}

Another issue is that you're not placing the wsdl file in the proper location within the deployment archive. Even if you have a war deployment, you're using an EJB3 based WS endpoints, as a consequence the the root for looking up ws endpoint resources is the actual war root, not WEB-INF/classes within it. In particular, the "META-INF/wsdl/Echo.wsdl" reference in your @WebService annotation is not resolved, as you actually have WEB-INF/classes/META-INF/wsdl/Echo.wsdl in the war. I manually moved the wsdl dir in the META-INF dir under the root and that fixed the issue; I'm leaving to you to figure out how to tune your pom for building the proper archive (how about a jar deployment?).
Btw, you could have noticed a debug message from jbossws (need to enable debug logging in standalone.xml) saying:
{noformat}
2015-03-25 22:45:02,984 DEBUG [org.jboss.ws.cxf.metadata] (MSC service thread 1-8) JBWS024091: Could not get WSDL from META-INF/wsdl/Echo.wsdl, aborting soap:address rewrite.
{noformat}
Moreover, if you manually modified the provided wsdl (e.g. by adding a useless wsdl:message), you would have noticed it was not there after deployment in the published contract (meaning the contract was actually a generated one).

Once you've fixed the 2 things above and disabled automatic wsdl soap:address rewite (by adding <modify-wsdl-address>false</modify-wsdl-address> in the webservices susbsystem of standalone.xml), you should see what follows in the logs:
{noformat}
22:47:13,896 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-4) JBWS024061: Adding service endpoint metadata: id=SimpleEcho
 address=http://localhost:8080/simple-ws-1.0-SNAPSHOT/SimpleEchoService/SimpleEcho
 implementor=com.tad.ws.SimpleEcho
 serviceName={http://ws.tad.com/}SimpleEchoService
 portName={http://ws.tad.com/}SimpleEchoPort
 annotationWsdlLocation=META-INF/wsdl/Echo.wsdl
 wsdlLocationOverride=null
 mtomEnabled=false
 publishedEndpointUrl=http://spartalnx:8080/simple-ws-1.0-SNAPSHOT/SimpleEcho
 invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker
 properties=[org.jboss.as.webservices.metadata.modelComponentViewName -> service jboss.deployment.unit."simple-ws-1.0-SNAPSHOT.war".component.SimpleEcho.VIEW."com.tad.ws.SimpleEcho".SERVICE_ENDPOINT]
[....]
2015-03-25 22:47:13,896 DEBUG [org.jboss.ws.cxf.endpointAddressRewrite] (MSC service thread 1-4) JBWS024036: WSDL service endpoint address rewrite not required: http://spartalnx:8080/simple-ws-1.0-SNAPSHOT/SimpleEcho
{noformat}
... and the wsdl visible at "http://localhost:8080/simple-ws-1.0-SNAPSHOT/SimpleEchoService/SimpleEcho?wsdl" (beware the different default URL because of the endpoint being a contract first) has your provided and unchanged address "http://spartalnx:8080/simple-ws-1.0-SNAPSHOT/SimpleEcho" (which you would want to change to match the correct context-root & path, or you might want to tune the deployment).
So, besides for the warning issue, I believe there's no issue here and this jira can be closed.

> Ability to set WSDL URL
> -----------------------
>
>                 Key: WFLY-4444
>                 URL: https://issues.jboss.org/browse/WFLY-4444
>             Project: WildFly
>          Issue Type: Feature Request
>          Components: Web Services
>    Affects Versions: 8.2.0.Final
>            Reporter: John Ament
>            Assignee: Alessio Soldano
>
> There's no way to correctly set a WSDL URL.  The properties are:
> {code}
>             <modify-wsdl-address>true</modify-wsdl-address>
>             <wsdl-host>${public.app.host:localhost}</wsdl-host>
>             <wsdl-port>${public.http.port:80}</wsdl-port>
>             <wsdl-secure-port>${public.https.port:443}</wsdl-secure-port>
> {code}
> We need a way to set the WSDL URL, regardless of the protocol used.  The issue being that our app servers run on HTTP, but the incoming request to the first load balancer is over HTTPS.  The result is that the WSDL generated includes http://public-host:80/ instead of https://public-host:443/



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list