The pom entry is:
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.0.1-incubator</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>2.0.1-incubator</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<wsdlOptions>
<wsdlOption>
<wsdl>http://touralliance.bronni.ru/Loader.asmx?wsdl</wsdl>
<extraargs>
<extraarg>-exsh</extraarg>
<extraarg>true</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-all</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
And all "impls" are generated, but still getting:
INFO: Creating Service {http://tourml.ru/service/2006-03-14}Loader from
WSDL: http://touralliance.bronni.ru/Loader.asmx?wsdl
Exception in thread "main" javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Could not find
a message part matching name
{http://tourml.ru/serviceSecurity/2006-03-14/}UserSessionId. Possible
values are [{http://tourml.ru/service/2006-03-14}UserSessionId].
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:243)
at javax.xml.ws.Service.getPort(Service.java:94)
at ru.tourml.service._2006_03_14.Loader.getLoaderSoap(Loader.java:51)
at ru.invito.ws.client.bronni.App.main(App.java:41)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find a message part matching name
{http://tourml.ru/serviceSecurity/2006-03-14/}UserSessionId. Possible
values are [{http://tourml.ru/service/2006-03-14}UserSessionId].
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:391)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(JaxWsServiceFactoryBean.java:358)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:173)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:319)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:182)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:211)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:262)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:143)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:89)
at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:81)
at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)
at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)
at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:336)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:241)
... 3 more
Also a question: in tcpmon log a see a 3 equal requests each time i start an
app:
GET http://touralliance.bronni.ru/Loader.asmx?wsdl HTTP/1.1
User-Agent: Java/1.5.0_12
Host: touralliance.bronni.ru
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Proxy-Connection: keep-alive
I'm starting:
Loader ss = new Loader();
LoaderSoap port = ss.getLoaderSoap();
System.out.println("Invoking login...");
java.lang.String _login_login = "";
java.lang.String _login_password = "";
javax.xml.ws.Holder<ru.tourml.servicesecurity._2006_03_14.UserSessionId>
_login_userSessionId = new
javax.xml.ws.Holder<ru.tourml.servicesecurity._2006_03_14.UserSessionId>();
port.login(_login_login, _login_password, _login_userSessionId);
System.out.println("login._login_userSessionId=" +
_login_userSessionId.value);
the same code is present in generated client
LoaderSoap_LoaderSoap_Client.java
Why do it need these 3 requests?
Jim Ma-3 wrote:
>
> Did you regenerate the server side code ? From the stack trace , I think
> the server did not use the implementor class which contains soap header
> parameter ?
> Could you check it ?
>
> -Jim
>
> exgorth wrote:
>> One more..
>>
>> I've generated stubs with:
>> wsdl2java -d .\generated -exsh true -client
>> http://touralliance.bronni.ru/Loader.asmx?wsdl
>>
>>
>> And whee invoking generated client i'm getting:
>>
>> INFO: Creating Service {http://tourml.ru/service/2006-03-14}Loader from
>> WSDL: http://touralliance.bronni.ru/Loader.asmx?wsdl
>> Exception in thread "main" javax.xml.ws.WebServiceException:
>> org.apache.cxf.service.factory.ServiceConstructionException: Could not
>> find
>> a message part matching name
>> {http://tourml.ru/serviceSecurity/2006-03-14/}UserSessionId. Possible
>> values are [{http://tourml.ru/service/2006-03-14}UserSessionId].
>> at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:243)
>> at javax.xml.ws.Service.getPort(Service.java:94)
>> at ru.tourml.service._2006_03_14.Loader.getLoaderSoap(Loader.java:51)
>> at ru.invito.ws.client.bronni.App.main(App.java:49)
>> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
>> Could not find a message part matching name
>> {http://tourml.ru/serviceSecurity/2006-03-14/}UserSessionId. Possible
>> values are [{http://tourml.ru/service/2006-03-14}UserSessionId].
>> at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(JaxWsServiceFactoryBean.java:391)
>> at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(JaxWsServiceFactoryBean.java:358)
>> at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:173)
>> at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:319)
>> at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:182)
>> at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:211)
>> at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:262)
>> at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:143)
>> at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:89)
>> at
>> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:81)
>> at
>> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)
>> at
>> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)
>> at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:336)
>> at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:241)
>> ... 3 more
>>
>>
>>
>>
>> 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?
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/wsdl2java---soap%3Aheader-handling-generation-tf4358725.html#a12423851
Sent from the cxf-user mailing list archive at Nabble.com.