make cxf - wsdl2java to use SLF4J - maven

We have a maven project which generates the wsdl client through apache cxf. The main goal is, to have the service wrapper fully generated, so that only the wsdl files have to be maintained under version-control.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.7.5</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/WSAnzeigeKunde.wsdl</wsdl>
<extraargs>
<extraarg>-frontend</extraarg>
<extraarg>jaxws21</extraarg>
<extraarg>-p</extraarg>
<extraarg>http://www.die-software.com/xsd/OBS_ANZEIGE_KUNDE_ANTWORT.xsd=com.diesoftware.service.anzeigekunde</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
this works fine so far.
the resulting code looks like
public class WSAnzeigeAssetsummenService extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://www.die-software.com/xsd/OBS_ANZEIGE_ASSETSUMMEN_ANTWORT.xsd", "WSAnzeigeAssetsummenService");
public final static QName WSAnzeigeAssetsummenPort = new QName("http://www.die-software.com/xsd/OBS_ANZEIGE_ASSETSUMMEN_ANTWORT.xsd", "WSAnzeigeAssetsummenPort");
static {
URL url = null;
try {
url = new URL("file:/C:/Data/workspace-temp/WebAppPOC/src/main/resources/WSAnzeigeAssetsummen.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(WSAnzeigeAssetsummenService.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "file:/C:/Data/workspace-temp/WebAppPOC/src/main/resources/WSAnzeigeAssetsummen.wsdl");
}
WSDL_LOCATION = url;
}
I found that cxf supports SLF4J (http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-UsingLog4jInsteadofjava.util.logging) but this seems not to belong to wsdl2java.
Is there really no way to configure the wsdl2java, to use any other logger.

Not for this particular case, no. The JAX-WS spec mandates that these generated service classes be 100% usable in any JAX-WS compliant environment. That would include the one in the JDK that would not have any other logging implementation.
For CXF 3.0, we've start discussing a new "cxf" frontend for wsdl2java that would allow more use of CXF specific API's and features, but would obviously not be 100% JAX-WS compliant.

Related

Not able to link my javadocs with spring auto rest docs

I am not getting how do you use JavaDocs, with Spring Auto Rest Docs. I can generate my java-docs locally by using STS, UI option. However,i am not sure how to generate java-docs using Spring Auto Rest Docs. I tried writing some plugin in POM. But the auto-description.adoc and many other doc are still empty.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- switch on dependency-driven aggregation -->
<includeDependencySources>true</includeDependencySources>
</configuration>
</execution>
<execution>
<id>generate-javadoc-json</id>
<phase>compile</phase>
<goals>
<goal>javadoc-no-fork</goal>
</goals>
<configuration>
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
<docletArtifact>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-json-doclet</artifactId>
</docletArtifact>
<additionalparam>
-d ${project.build.directory}/site/doccheck
</additionalparam>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
<useStandardDocletOptions>false</useStandardDocletOptions>
<show>package</show>
</configuration>
</execution>
</executions>
</plugin>
Basically I am not getting how to make Spring Auto Rest Docs use Java Docs to find Path Parameters. I can use mvn javadoc:javadoc command on terminal to create Javadocs whch are created in target/site/apidocs/ folder. But I still get No parameters in my auto-path-parameters.adoc
Here is the controller, I am using GraphQL so its different:
/**
* Query Controller Class
* #author shantanu
*
*/
#RestController
#RequestMapping(value="/graphql")
public class QueryController {
#Value("classpath:/graphql/actionItm.graphqls")
private Resource schemaResource;
private GraphQL graphQL;
#Autowired
#Qualifier("graphQLDate")
private GraphQLScalarType Date;
#Autowired
private AllActionItemsDataFetcher allActionItemsDataFetcher;
#Autowired
private ActionItemDataFetcher actionItemDataFetcher;
#Autowired
private PageActionItemDataFetcher pageActionItemDataFetcher;
#PostConstruct
public void loadSchema() throws IOException {
File schemaFile = schemaResource.getFile();
TypeDefinitionRegistry typeRegistry = new SchemaParser().parse(schemaFile);
RuntimeWiring wiring = buildRuntimeWiring();
GraphQLSchema schema = new SchemaGenerator().makeExecutableSchema(typeRegistry, wiring);
graphQL = GraphQL.newGraphQL(schema).build();
}
private RuntimeWiring buildRuntimeWiring() {
return RuntimeWiring.newRuntimeWiring()
.type("Query", typeWiring -> typeWiring
.dataFetcher("findAllActionItems", allActionItemsDataFetcher)
.dataFetcher("findActionItem", actionItemDataFetcher)
.dataFetcher("pageActionItems", pageActionItemDataFetcher))
.scalar(Date)
.build();
}
/**
* This
* #param query Description
* #return ResponseEntity responseEntity
*/
#PostMapping
public ResponseEntity query(#RequestBody String query) {
ExecutionResult result = graphQL.execute(query);
return ResponseEntity.ok(result.getData());
}
}
I am not getting where I am wrong, with the path-parameters. And only the .adoc files are generated with Spring Auto Rest Docs, and no JSON files.

Spring Integration application does not define channels when executed as packaged jar

I started to use Spring Integration in a project at work. Everything was looking fine and running smoothly on my local dev environment (when executed from Eclipse).
However, when I tried to deploy to our dev/staging environment I got some issues related with the definition of the Spring Integration channels.
After a couple of hours completely clueless (blaming external dependencies, our development/staging environment setup etc etc), I came to realize that I would get exactly the same issue whenever I tried to execute my application as a packaged jar (on my local machine)
I did a small "sample" application without any other dependencies in order to reproduce this issue. Once again everything works fine from eclipse but whenever executed as a packaged jar the following exception was thrown:
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'gatewayChannel' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:89)
at org.springframework.integration.support.channel.BeanFactoryChannelResolver.resolveDestination(BeanFactoryChannelResolver.java:46)
at org.springframework.integration.gateway.MessagingGatewaySupport.getRequestChannel(MessagingGatewaySupport.java:344)
at org.springframework.integration.gateway.MessagingGatewaySupport.send(MessagingGatewaySupport.java:385)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:481)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:433)
at org.springframework.integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:424)
at org.springframework.integration.gateway.GatewayCompletableFutureProxyFactoryBean.invoke(GatewayCompletableFutureProxyFactoryBean.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy24.send(Unknown Source)
at com.test.App$RealApp.doThings(App.java:52)
at com.test.App.main(App.java:62)
Bellow you can find the code of my sample application and the pom that I used to build my packaged jar.
#ComponentScan
#EnableIntegration
#IntegrationComponentScan
#Configuration
public class App {
#MessagingGateway
public interface GatewayApp {
#Gateway(requestChannel = "gatewayChannel")
void send(String string);
}
#Bean
public IntegrationFlow inboud() {
return IntegrationFlows.from("gatewayChannel")
.handle(System.out::println)
.get();
}
#Component
public class RealApp {
#Autowired
private GatewayApp gateway;
public void doThings() {
gateway.send("yeee");
}
}
#SuppressWarnings("resource")
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(App.class);
context.refresh();
context.getBean(RealApp.class).doThings();
}
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sprint-integration</groupId>
<artifactId>integration</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>integration</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.3.14.RELEASE</spring.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<createSourcesJar>false</createSourcesJar>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>yo-service</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<!-- Spring Integration -->
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-amqp</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-java-dsl</artifactId>
<version>1.2.3.RELEASE</version>
</dependency>
</dependencies>
</project>
Note: I think this issue might have exaclty the same cause as the one reported in Spring integration bootstrap - intellij in debug works, packaged jar does not
My best guess is the shade plugin is having some effect on the order in which BeanPostProcessors are run.
Does the app work if you explicitly define the channel...
#Bean
public MessageChannel gatewayChannel() {
return new DirectChannel();
}
...?
If so, that would be a smoking gun. In that case, the next step would be to get a DEBUG log for org.springframework in both environments and compare the bean definition/creation/post processing logs.
If you can post a complete (simple) example that exhibits the problem, we can take a look.
EDIT
The problem is the shade plugin does not merge the META-INF/spring.factories files, so we lose the entry from the JAVA DSL and hence don't process any IntegrationFlows...
From the Uber jar we just have the core file...
org.springframework.integration.config.IntegrationConfigurationInitializer=\
org.springframework.integration.config.GlobalChannelInterceptorInitializer,\
org.springframework.integration.config.IntegrationConverterInitializer,\
org.springframework.integration.config.IdempotentReceiverAutoProxyCreatorInitializer
and so are missing the additional initializer from the DSL jar...
org.springframework.integration.config.IntegrationConfigurationInitializer=\
org.springframework.integration.dsl.config.DslIntegrationConfigurationInitializer
Hence it works with 5.0.1 because the DSL is now part of core.
Spring Boot solves this problem by nesting the jars instead of extracting all the classes.
EDIT2
Here's another work-around, if you can't move to Spring Integration 5. Add this bean to your application...
#Bean
public static BeanFactoryPostProcessor dslInitializer() {
return new BeanFactoryPostProcessor() {
#Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws BeansException {
new DslIntegrationConfigurationInitializer().initialize(bf);
}
};
}
(Notice static).
Adding to Gary Russell's answer: The problem is indeed that the META-INF/spring.factories files are not automatically merged by the shade plugin.
You can use the AppendingTransformer of the shade plugin to merge these files.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.my.MainClass</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.tooling</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>

ProGuard + Spring Boot + Maven Plugin

Guys, I'm trying to obfuscate a .jar application using the proguard-maven-plugin.
When I try to perform the obfuscate process, I get error messages stating that there are unexpected classes.
I'm using the Spring Boot 1.4.1.RELEASE and Proguard Maven Plugin 2.0.13.
This is my proguard.conf
-injars /workspace/base/target/test-1.0.0.jar
-libraryjars /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/rt.jar
-dontshrink
-dontoptimize
-dontobfuscate
-dontusemixedcaseclassnames
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
-adaptresourcefilenames **.properties
-adaptresourcefilecontents **.properties,META-INF/MANIFEST.MF
-dontpreverify
-verbose
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * extends java.beans.BeanInfo
-keep class * {
void set*(***);
void set*(int,***);
boolean is*();
boolean is*(int);
*** get*();
*** get*(int);
}
-assumenosideeffects public class java.lang.System {
public static long currentTimeMillis();
static java.lang.Class getCallerClass();
public static int identityHashCode(java.lang.Object);
public static java.lang.SecurityManager getSecurityManager();
public static java.util.Properties getProperties();
public static java.lang.String getProperty(java.lang.String);
public static java.lang.String getenv(java.lang.String);
public static java.lang.String mapLibraryName(java.lang.String);
public static java.lang.String getProperty(java.lang.String,java.lang.String);
}
The pom.xml file. I am only informing the configuration by the plugin.
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<version>2.0.13</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<obfuscate>false</obfuscate>
<outFilter>**/BOOT-INF/classes/ **.class</outFilter>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<outputDirectory>${project.build.directory}</outputDirectory>
<injar>${project.build.finalName}.jar</injar>
<outjar>${project.build.finalName}-min.jar</outjar>
</configuration>
</plugin>
However, during the execution process I get the following return for all classes in my application.
Warning: class [BOOT-INF/classes/br/com/base/BaseApplication.class] unexpectedly contains class [br.com.base.BaseApplication]
Warning: class [BOOT-INF/classes/br/com/base/controller/CaixaController.class] unexpectedly contains class [br.com.base.controller.CaixaController]
[...]
And the final output of ProGuard. PS: All classes are in the BOOT-INF/classes directory
Warning: there were 97 classes in incorrectly named files.
You should make sure all file names correspond to their class names.
The directory hierarchies must correspond to the package hierarchies.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unexpectedclass)
If you don't mind the mentioned classes not being written out,
you could try your luck using the '-ignorewarnings' option.
Please correct the above warnings first.
Can anyone imagine any alternatives I can try?
Thanks.
In order to fix this, I made sure to change the order of the plugins in the pom. The proguard plugin should go first, followed by the spring boot plugin.
Additionally, make sure you have the <goal>repackage</goal> specified in the spring boot configuration. With the correct order and the repackage goal specified, the proguard obfuscation/optimization/whatever you have configured will take place and produce a jar. Then the spring boot plugin will repackage that jar as an executable and everything should work.
My plugin configuration from pom.xml:
<project ...>
....
<plugin>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>proguard</goal>
</goals>
</execution>
</executions>
<configuration>
<proguardInclude>${basedir}/proguard.conf</proguardInclude>
<libs>
<lib>${java.home}/lib/rt.jar</lib>
<lib>${java.home}/lib/jce.jar</lib>
</libs>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<start-class>org.springframework.boot.loader.JarLauncher</start-class>
</configuration>
</execution>
</executions>
</plugin>
...

Generate *PortProxy.java with wsimport

i am trying to generate the JAXWS client with Maven. For this i use the "org.jvnet.jax-ws-commons:jaxws-maven-plugin". The plugin generates all necessary files but not the *PortProxy.java.
I've tried to generate the client with the command line version of wsimport. I've used different versions of wsimport from JDK1.7.0_55 (x64), JDK1.7.0_65 (x86) and from IBM WebSphere Application Server Version 8.
The only working way to generate the *PortProxy.java file is using the Eclipse wizard. (Right click on the WSDL --> Generate --> Client --> Set the client project --> Finish.). What are the differences between the wizard and the CLI?
Thanks for your help.
I think you are looking for the wrong generated client class.
It should be something like *Service.java .
If you can't find a class like that, look for a class with something similar to this in:
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("http://localhost:8080/ws/countries.wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
WORKFLOWAPIPORTSERVICE_WSDL_LOCATION = url;
WORKFLOWAPIPORTSERVICE_EXCEPTION = e;
}
Plugin :
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlFiles>
<wsdlFile>localhost_8080/ws/countries.wsdl</wsdlFile>
</wsdlFiles>
<packageName>xxx</packageName>
<wsdlLocation>http://localhost:8080/ws/countries.wsdl</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/stale/countries.stale</staleFile>
</configuration>
<id>wsimport-generate-countries</id>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
</plugin>

JAX-WS wsimport use local wsdl a xsd file

i have soap client with generated sources with wsimport.
I use following settings in my pom.xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlFiles>
<wsdlFile>example.com_8080/services/test.wsdl</wsdlFile>
</wsdlFiles>
<wsdlLocation>http://example.com:8080/services/test?wsdl</wsdlLocation>
<staleFile>${project.build.directory}/jaxws/stale/test.stale</staleFile>
</configuration>
<id>wsimport-generate-test</id>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
</plugin>
And i'm looking for the best way howto don't do request on wsdl/xsd from remote server(http://example.com:8080/services/test?wsdl) every time.
So, i want to use local wsdl/xsd file. Is it possible to do it?genra
Had similar problem. wsimport should generate a .java file called your_ws_nameService.java. In this file you should have section that looks something like this:
static {
URL url = null;
try {
URL baseUrl;
baseUrl = com.oracle.xmlns.orawsv.ORAWSVService.class.getResource(".");
url = new URL(baseUrl, "http://127.0.0.1:7101/test/test?WSDL");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'http://127.0.0.1:7101/test/test?WSDL', retrying as a local file");
logger.warning(e.getMessage());
}
ORAWSVSERVICE_WSDL_LOCATION = url;
}
Change this section to something like this:
static {
URL url = null;
try {
URL baseUrl;
baseUrl = mypackage.my_ws_client.my_ws_clientService.class.getResource("my_ws.wsdl");
url = new URL(baseUrl,"");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the local wsdl file.");
logger.warning(e.getMessage());
}
SENDINFOSERVICE_WSDL_LOCATION = url;
}
This will read the WSDL file that is located inside your client. Of course you need to first have it there, which, like kolossus suggested, you can just download from the browser.

Resources