Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXF generates different WSDL files with JVM/Native modes #4746

Closed
llowinge opened this issue Apr 5, 2023 · 4 comments · Fixed by #4803
Closed

CXF generates different WSDL files with JVM/Native modes #4746

llowinge opened this issue Apr 5, 2023 · 4 comments · Fixed by #4803
Assignees
Milestone

Comments

@llowinge
Copy link
Contributor

llowinge commented Apr 5, 2023

Reproducer https://github.com/llowinge/camel-quarkus-examples/tree/cxf-soap-example/cxf-soap.

With JVM mode it generates correct WSDL at curl http://0.0.0.0:8081/cxf/services/contact\?wsdl, but with Native it generates

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.soap.cxf.acme.org/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/" name="ContactService" targetNamespace="http://service.soap.cxf.acme.org/">
  <wsdl:portType name="ContactServicePortType">
  </wsdl:portType>
  <wsdl:binding name="ContactServiceSoapBinding" type="tns:ContactServicePortType">
    <ns1:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  </wsdl:binding>
  <wsdl:service name="ContactService">
    <wsdl:port binding="tns:ContactServiceSoapBinding" name="ContactServicePort">
      <ns1:address location="http://0.0.0.0:8081/cxf/services/contact"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

When i've added @WebService (which should be mandatory - but works in JVM without it) annotation, the WSDL got changed, but still the test didn't pass (but passed in JVM).

@ppalaga ppalaga self-assigned this Apr 14, 2023
@ppalaga
Copy link
Contributor

ppalaga commented Apr 14, 2023

I am not finding any WSDL test in https://github.com/llowinge/camel-quarkus-examples/tree/cxf-soap-example/cxf-soap
Could you please add it there or even better directly in CQ under integration-test-groups/cxf-soap/cxf-soap-server?

Along reviewing and polishing the java2ws PR in QCXF I wrote this test that compares the WSDL produced by java2ws with the served one.
I can confirm that the two WSDLs were not equal unless I added @WebService(name = "HelloService", serviceName = "HelloService") to the service interface. I'd say this is expected. That's for JVM mode. I also had to remove the <soap:address location=""> node because the URL was set to some default :9090 one in the java2ws document. That's also expected.

For native mode, I am seeing a correct document being served, but it is indeed slightly different than with JVM mode. The difference is in namespace prefixes. Where JVM has

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

native has

xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/"

Then all occurrences of those prefixes also differ - e.g.

<soap:binding .../>

vs.

<ns1:binding .../>

This should not happen, but I would not say it is a serious bug. The native WSDL correct and mutatis mutandis also equal with the JVM one.

Is this what you also see in the quickstart?

@llowinge
Copy link
Contributor Author

@ppalaga No, i see much bigger difference (you can easily try it - just run the app in JVM and in Native, then access curl http://0.0.0.0:8080/cxf/services/contact\?wsdl and compare it).

I'm attaching the diffchecker (JVM WSDL vs Native WDSL) without @WebService - https://www.diffchecker.com/33AqNeTQ/

@ppalaga
Copy link
Contributor

ppalaga commented Apr 19, 2023

The main issue in https://github.com/llowinge/camel-quarkus-examples/tree/cxf-soap-example/cxf-soap was that the Service interface was not annotated with @WebService. Without that, quarkus-cxf does not generate necessary helper classes. Adding it revealed two other small issues in quarkus-cxf:

Both have fixes now. I am keeping this issue open while the releases 2.0.0 and 1.5.12 of quarkus-cxf reach Camel Quarkus

@ppalaga
Copy link
Contributor

ppalaga commented Apr 19, 2023

I should also add a test ensuring that the WSDLs served by JVM and native endpoints are the same.

ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 19, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 19, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 20, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 20, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 20, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 20, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Apr 21, 2023
zbendhiba pushed a commit to jboss-fuse/camel-quarkus that referenced this issue Apr 27, 2023
ppalaga added a commit to jboss-fuse/camel-quarkus that referenced this issue Apr 28, 2023
@ppalaga ppalaga added this to the 3.0.0-M2 milestone May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants