views:

289

answers:

1

Hi

Trying to create some sample prgms using jax-ws. I am able to successfully generate the required artifacts(java files) and the wsdl file using wsgen. and finally a .war file is generated by maven. Deployed this .war file in weblogic 9.2 and tried to access the wsdl using the IE browser.But it did not work. I observed two things

  1. The java and complied class files are generated and are bundled inside the .war file.But the wsdl file is generated outside and not a part of .war.
  2. Generally wsgen itself will provide the wsdl url.

My queries are:

  1. In order to get the wsdl in IE browser what changes I need to do in POM.
  2. wsdl file should be part of .war.If yes then where should I keep the file.
  3. what changes I need to do to get the soap location url in the wsdl file.
A: 

How are you triggering wsgen? It needs to be invoked during the build lifecycle before the war is packaged by Maven. The configuration below will bind the wsgen execution to the process-resources phase, this should mean the wsdl is output below target/classes and included in the war.

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>jaxws-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>wsgen</id>
      <phase>process-resources</phase>
      <goals>
        <goal>wsgen</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
  ...

As far as part 3 of your question, I'm no expert on these things and don't see a means in the plugin to change it. I did find a post that shows how it can be changed programmatically, which may help.

Rich Seller