jboss-fuse / wsdl2rest

A tool allowing quick migration from existing JAX-WS services to REST
Apache License 2.0
25 stars 22 forks source link

When testing helloworld.wsdl, utility does not pick up the jaxws address for the generated config #72

Closed bfitzpat closed 5 years ago

bfitzpat commented 5 years ago

Unless we specify "--jaxws" as "http://localhost:3000/helloworldservice/", the generator goes with the default "http://localhost:8080/somepath" which does not run.

The CamelContextGenerator goes with the default if the jaxwsAddress isn't specified (https://github.com/jboss-fuse/wsdl2rest/blob/cb42273e7ad7ebe573d03bc5e41983316fbbd6b3/impl/src/main/java/org/jboss/fuse/wsdl2rest/impl/codegen/CamelContextGenerator.java#L78)

But I think we can probably get the soap address somehow in here while processing the WSDL: https://github.com/jboss-fuse/wsdl2rest/blob/cb42273e7ad7ebe573d03bc5e41983316fbbd6b3/impl/src/main/java/org/jboss/fuse/wsdl2rest/impl/WSDLProcessorImpl.java#L114

It seems that this would also be an issue with address.wsdl, but the tests usually specify a --jaxws address in the tool (see https://github.com/jboss-fuse/wsdl2rest/blob/cb42273e7ad7ebe573d03bc5e41983316fbbd6b3/impl/src/test/java/org/jboss/fuse/wsdl2rest/test/doclit/GenerateDocLitTest.java#L50)

bfitzpat commented 5 years ago

Helloworld.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="HelloService"
   targetNamespace="http://rpclit.test.helloworld.org/"
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns="http://rpclit.test.helloworld.org/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <wsdl:message name="SayHelloRequest">
      <wsdl:part name="firstName" type="xsd:string"/>
   </wsdl:message>

   <wsdl:message name="SayHelloResponse">
      <wsdl:part name="greeting" type="xsd:string"/>
   </wsdl:message>

   <wsdl:portType name="HelloPortType">
      <wsdl:operation name="sayHello">
         <wsdl:input message="tns:SayHelloRequest"/>
         <wsdl:output message="tns:SayHelloResponse"/>
      </wsdl:operation>
   </wsdl:portType>

   <wsdl:binding name="HelloBinding" type="tns:HelloPortType">
      <soap:binding style="rpc"
         transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="sayHello">
         <soap:operation soapAction="sayHello"/>
         <wsdl:input>
            <soap:body
               namespace="urn:examples:helloservice"
               use="literal"/>
         </wsdl:input>

         <wsdl:output>
            <soap:body
               namespace="urn:examples:helloservice"
               use="literal"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>

   <wsdl:service name="HelloService">
      <wsdl:documentation>WSDL File for HelloService</wsdl:documentation>
      <wsdl:port binding="tns:HelloBinding" name="HelloPort">
         <soap:address
            location="http://localhost:3000/helloworldservice/" />
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
bfitzpat commented 5 years ago

Created PR to handle this case - https://github.com/jboss-fuse/wsdl2rest/pull/76

bfitzpat commented 5 years ago

@tsedmik This one has been merged. Not sure when it will actually appear in a build for 7.3, but it's done.

@cunningt Can we cherry-pick this into the wsdl2rest build that's part of 7.3?

cunningt commented 5 years ago

@bfitzpat Sure - just submit a cherry-pick into wsdl2rest 0.8.x.redhat-7-x

bfitzpat commented 5 years ago

@cunningt Cool. Just cherry-picked a few things to get up to date with master. Will you let us know when you get a new build done so we can test against it and update our builds (for Fuse Tooling and our Yeoman/camel-project generator work)? We'll also need to stash that wsdl2rest 7.3 build when we get that.

Thanks Tom!!

bfitzpat commented 5 years ago

This has been fixed and it will appear in the final 7.3 build.