You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by imiten <im...@yahoo.com> on 2012/04/21 10:13:29 UTC

generate wsdl and client (Dispatch) for jax-ws Provider

Hi,

I have written jax-ws webservice using Provider<SOAPMessage>.  Using maven
now I suppose next steps are to generate wsdl and then client.  can one
point me to example/article.

I have wsdl and client in this 
http://cxf.547215.n5.nabble.com/webservice-client-marshal-exception-tp5654848p5654848.html
post  generated using pom snippet:
<plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-java2ws-plugin</artifactId>
        <version>${cxf.version}</version>
        <executions>
           <execution>
	        
            <id>process-classes</id>
            <phase>process-classes</phase>
            <configuration>
              <className>com.mkyong.webservice.ProductWebService</className>
              <genWsdl>true</genWsdl>
	      
	     
<outputFile>${project.build.directory}/${project.build.finalName}/wsdl/ProductWebService.wsdl</outputFile>
	      
              <genServer>true</genServer>
	      
	      <verbose>true</verbose>
            </configuration>
            <goals>
              <goal>java2ws</goal>
            </goals>
          </execution>
        </executions>
   </plugin>  

The doubt if this is right as the client is supposed to be Dispatch API
based.  If I use eclipse m2e plugin it generates client correctly.  Please
guide how to get going with maven.

Regards,

Miten.

--
View this message in context: http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax-ws-Provider-tp5655967p5655967.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: generate wsdl and client (Dispatch) for jax-ws Provider

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday, April 24, 2012 07:17:54 AM imiten wrote:
> Hi,
> 
>  <wsdl:service name="ProductWebServiceService">
>     <wsdl:port name="ProductWebServicePort"
> binding="tns:ProductWebServiceServiceSoapBinding">
>       <soap:address
> location="http://localhost:8080/mkyong_webapp/services/ProductWebServicePo
> rt"/> </wsdl:port>
>   </wsdl:service>
> 
> I have above in wsdl so probably service address is soap:address ?

Yep.  

Dan


> 
> Regards,
> 
> Miten.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax
> -ws-Provider-tp5655967p5662159.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: generate wsdl and client (Dispatch) for jax-ws Provider

Posted by imiten <im...@yahoo.com>.
Hi,

 <wsdl:service name="ProductWebServiceService">
    <wsdl:port name="ProductWebServicePort"
binding="tns:ProductWebServiceServiceSoapBinding">
      <soap:address
location="http://localhost:8080/mkyong_webapp/services/ProductWebServicePort"/>
    </wsdl:port>
  </wsdl:service>

I have above in wsdl so probably service address is soap:address ?

Regards,

Miten.

--
View this message in context: http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax-ws-Provider-tp5655967p5662159.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: generate wsdl and client (Dispatch) for jax-ws Provider

Posted by imiten <im...@yahoo.com>.
Hi,

What is serviceAddress ? is it some thing in wsdl ?

Regards,

Miten.

--
View this message in context: http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax-ws-Provider-tp5655967p5662149.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: generate wsdl and client (Dispatch) for jax-ws Provider

Posted by Daniel Kulp <dk...@apache.org>.
Should be something like:


Service service = Service.create(serviceName);
service.addPort(portName, 
             SOAPBinding.SOAP11HTTP_BINDING,
             "http://localhost:8080/mkyong_webapp/serviceAddress");
Dispatch<SOAPMessage> dispatch = service.createDispatch(portName,
              SOAPMessage.class, Service.Mode.MESSAGE);;

No wsdl involved.


Dan


On Tuesday, April 24, 2012 04:10:32 AM imiten wrote:
> Hi,
> 
> I am not sure about exact code but if you could help remediate it will
> help. Here is existing code that works.
> 
> QName serviceName = new QName("http://webservice.mkyong.com/",
> "ProductWebServiceService");
>         QName portName = new QName("http://webservice.mkyong.com/",
> "ProductWebServicePort");
> 
>         Service service = Service.create(new
> URL("http://localhost:8080/mkyong_webapp/wsdl/ProductWebService.wsdl"),
> serviceName);
> 
>         Dispatch<SOAPMessage> dispatch = service.createDispatch(portName,
> SOAPMessage.class, Service.Mode.MESSAGE);
> 
> 
> Regards,
> 
> Miten.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax
> -ws-Provider-tp5655967p5661676.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: generate wsdl and client (Dispatch) for jax-ws Provider

Posted by imiten <im...@yahoo.com>.
Hi,

I am not sure about exact code but if you could help remediate it will help. 
Here is existing code that works.

QName serviceName = new QName("http://webservice.mkyong.com/",
"ProductWebServiceService");
        QName portName = new QName("http://webservice.mkyong.com/",
"ProductWebServicePort");

        Service service = Service.create(new
URL("http://localhost:8080/mkyong_webapp/wsdl/ProductWebService.wsdl"),
serviceName);
        
        Dispatch<SOAPMessage> dispatch = service.createDispatch(portName,
SOAPMessage.class, Service.Mode.MESSAGE);


Regards,

Miten.

--
View this message in context: http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax-ws-Provider-tp5655967p5661676.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: generate wsdl and client (Dispatch) for jax-ws Provider

Posted by Daniel Kulp <dk...@apache.org>.
On Saturday, April 21, 2012 01:13:29 AM imiten wrote:
> Hi,
> 
> I have written jax-ws webservice using Provider<SOAPMessage>.  Using maven
> now I suppose next steps are to generate wsdl and then client.  can one
> point me to example/article.

If using a Provider, there really is no point in generating a WSDL.   It 
would be extremely generic and really provide very little value as it's just 
an "invoke" method that would take anything.  

If you are going to use the Dispatch API's there really isn't a need for the 
WSDL.   Create the Service object, add the port (addPort(....)), and then 
createDispatch(...)

Dan



> I have wsdl and client in this
> http://cxf.547215.n5.nabble.com/webservice-client-marshal-exception-tp5654
> 848p5654848.html post  generated using pom snippet:
> <plugin>
>         <groupId>org.apache.cxf</groupId>
>         <artifactId>cxf-java2ws-plugin</artifactId>
>         <version>${cxf.version}</version>
>         <executions>
>            <execution>
> 
>             <id>process-classes</id>
>             <phase>process-classes</phase>
>             <configuration>
>              
> <className>com.mkyong.webservice.ProductWebService</className>
> <genWsdl>true</genWsdl>
> 
> 
> <outputFile>${project.build.directory}/${project.build.finalName}/wsdl/Pro
> ductWebService.wsdl</outputFile>
> 
>               <genServer>true</genServer>
> 
> 	      <verbose>true</verbose>
>             </configuration>
>             <goals>
>               <goal>java2ws</goal>
>             </goals>
>           </execution>
>         </executions>
>    </plugin>
> 
> The doubt if this is right as the client is supposed to be Dispatch API
> based.  If I use eclipse m2e plugin it generates client correctly.  Please
> guide how to get going with maven.
> 
> Regards,
> 
> Miten.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/generate-wsdl-and-client-Dispatch-for-jax
> -ws-Provider-tp5655967p5655967.html Sent from the cxf-user mailing list
> archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com