You need to add the soap binding dependency in your pom :

       <dependency>
           <groupId>org.apache.cxf</groupId>
           <artifactId>cxf-rt-bindings-soap</artifactId>
           <version>2.0.1-incubator</version>
       </dependency>

-Jim


exgorth wrote:
Thanx wsdl2java works fine with this flags, but i'm trying to use maven:

<?xml version="1.0"?>
<project>
    <parent>
        <artifactId>bronni-ws-client</artifactId>
        <groupId>ru.invito.ws.client.bronni</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>ru.invito.ws.client.bronni.model</groupId>
    <artifactId>bronni-model</artifactId>
    <name>bronni-model</name>
    <version>1.0-SNAPSHOT</version>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>2.0.1-incubator</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>2.0.1-incubator</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
<!-- <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
                            -->
                            <wsdlOptions>
<!-- <wsdlOption> <wsdl>http://touralliance.bronni.ru/TourMLSearch.asmx?wsdl</wsdl>
                                    </wsdlOption>
                                    <wsdlOption>
<wsdl>http://touralliance.bronni.ru/Booking.asmx?wsdl</wsdl>
                                    </wsdlOption>
                                -->
                                <wsdlOption>
<wsdl>http://touralliance.bronni.ru/Loader.asmx?wsdl</wsdl>
                                    <extraargs>
                                        <extraarg>-exsh</extraarg>
                                        <extraarg>true</extraarg>
                                        <extraarg>-verbose</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

and i'm getting the following error:

INFO: Loading <jaxb> databinding from <jaxb> plugin.
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -d C:\bronni\bronni-model\target\generated\src\main\java -exsh
true -verbose http://touralliance.bronni.ru/Loader.asmx?wsdl
wsdl2java - 2.0.1-incubator

31.08.2007 12:37:40
org.springframework.context.support.AbstractApplicationContext refresh
INFO: Refreshing [EMAIL PROTECTED]:
display name [EMAIL PROTECTED];
startup date [Fri Aug 31 1
2:37:40 MSD 2007]; root of context hierarchy
31.08.2007 12:37:41
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[META-INF/cxf/cxf.xml]
31.08.2007 12:37:41
org.springframework.context.support.AbstractApplicationContext refresh
INFO: Bean factory for application context
[EMAIL PROTECTED]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@
1de007d
31.08.2007 12:37:41
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxyin
g)
31.08.2007 12:37:41
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'cxf' is not eligible for getting processed by all
BeanPostProcessors (for example: not eligible for auto-proxying)
31.08.2007 12:37:41
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxy
ing)
31.08.2007 12:37:41
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans [cxf,org.apache.cxf.bus.spring.Jsr250Be
anPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.tr
ansport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqu
eue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.
endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,
org.apache.cxf.catalog.OASISCatalogManager]; root of factory hierarchy
31.08.2007 12:37:56
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor
processInput
WARNING: Can not find the soap binding in your classpath
  Will not generate the extra parameter.
31.08.2007 12:37:56
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor
processInput
WARNING: Can not find the soap binding in your classpath
  Will not generate the extra parameter.
31.08.2007 12:37:56
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor
processInput
WARNING: Can not find the soap binding in your classpath
  Will not generate the extra parameter.
31.08.2007 12:37:56
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor
processInput
WARNING: Can not find the soap binding in your classpath
  Will not generate the extra parameter.

WSDLToJava Error : java.lang.NullPointerException

org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:242)
        at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171)
        at
org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:186)
        at
org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:102)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.NullPointerException
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processParameter(ServiceProcessor.java:448)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processOperation(ServiceProcessor.java:386)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processPort(ServiceProcessor.java:266)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processService(ServiceProcessor.java:192)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.process(ServiceProcessor.java:98)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:90)
        at
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:59)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:198)
        at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:234)
        ... 23 more
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] ExitException: status 1

[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 minute 12 seconds
[INFO] Finished at: Fri Aug 31 12:37:56 MSD 2007
[INFO] Final Memory: 11M/28M
[INFO]
------------------------------------------------------------------------


Jim Ma-3 wrote:
Hi exgorth ,

You use the "wsdl2java -exsh true " to generate the parameter for soap header .

Regards

Jim

exgorth wrote:
The service i'm trying to access accepts the auth info in custom way -
client
must specify a soap:header with login:password pair and receive a token,
that must be included as soap:header in all further requests.

The problem that in generated code (wsdl2java) any info about that is not
present.

In XFIRE 1.2.4 the generated method was:

@WebMethod(operationName = "Search", action =
"http://tourml.ru/service/2006-03-14/Search";)
@WebResult(name = "TourML", targetNamespace =
"http://tourml.ru/products/2004-04-19";)
public TourML search(
  @WebParam(name = "request", targetNamespace =
"http://tourml.ru/query-request/2004-07-07";)
  Request request,
  @WebParam(name = "UserSessionId", targetNamespace =
"http://tourml.ru/serviceSecurity/2006-03-14/";, header = true)
  ru.tourml.servicesecurity._2006_03_14.UserSessionId UserSessionId);

but in CFX-2.0.1:

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebMethod(action = "http://tourml.ru/service/2006-03-14/Search";,
operationName = "Search")
@WebResult(targetNamespace = "http://tourml.ru/service/2006-03-14";,
partName
= "parameters", name = "SearchResponse")
public ru.tourml.service._2006_03_14.SearchResponse search(
  @WebParam(targetNamespace = "http://tourml.ru/service/2006-03-14";,
partName = "parameters", name = "Search")
  ru.tourml.service._2006_03_14.Search parameters);

the UserSessionId is not present as argument.

How can i supply the request with the required header? Why it doesn't
present in generated API?


Reply via email to