You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by exgorth <ex...@gmail.com> on 2007/09/03 12:04:56 UTC

Re: CXF Client not working

Hello, thanx.

How could one access that fix? What version i shall put in dependencies?


dkulp wrote:
> 
> 
> Just to let you know.   I can reproduce this issue.   I have a fix that 
> I'm testing now and hope to have committed to SVN shortly.
> 
> Dan
> 
> 
> 
> On Friday 31 August 2007, exgorth wrote:
>> Hello, I've generated the client for the 3rd party service:
>> http://touralliance.bronni.ru/Loader.asmx?wsdl
>>
>> with the following:
>>
>> <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/maven-v4_0_0.xsd">
>>     <modelVersion>4.0.0</modelVersion>
>>     <groupId>ru.invito.ws.client.bronni</groupId>
>>     <artifactId>spyglass-ws-client-bronni</artifactId>
>>     <packaging>jar</packaging>
>>     <version>1.0-SNAPSHOT</version>
>>     <name>spyglass-ws-client-bronni</name>
>>     <url>http://maven.apache.org</url>
>>     <build>
>>         <plugins>
>>             <plugin>
>>                 <groupId>org.apache.cxf</groupId>
>>                 <artifactId>cxf-codegen-plugin</artifactId>
>>                 <version>2.1-incubator-SNAPSHOT</version>
>>                 <dependencies>
>>                     <dependency>
>>                         <groupId>org.apache.cxf</groupId>
>>                         <artifactId>cxf-rt-bindings-soap</artifactId>
>>                         <version>2.1-incubator-SNAPSHOT</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>
>>             <plugin>
>>                 <groupId>org.apache.maven.plugins</groupId>
>>                 <artifactId>maven-compiler-plugin</artifactId>
>>                 <configuration>
>>                     <source>1.5</source>
>>                     <target>1.5</target>
>>                 </configuration>
>>             </plugin>
>>             <plugin>
>>                 <groupId>org.codehaus.mojo</groupId>
>>                 <artifactId>exec-maven-plugin</artifactId>
>>                 <executions>
>>                     <execution>
>>                         <goals>
>>                             <goal>java</goal>
>>                         </goals>
>>                     </execution>
>>                 </executions>
>>                 <configuration>
>>
>> <includeProjectDependencies>true</includeProjectDependencies>
>>                    
>> <mainClass>ru.invito.ws.client.bronni.App</mainClass> </configuration>
>>             </plugin>
>>         </plugins>
>>     </build>
>>     <dependencies>
>>         <dependency>
>>             <groupId>org.apache.cxf</groupId>
>>             <artifactId>cxf-rt-frontend-jaxws</artifactId>
>>             <version>2.1-incubator-SNAPSHOT</version>
>>         </dependency>
>>         <dependency>
>>             <groupId>org.apache.cxf</groupId>
>>             <artifactId>cxf-rt-transports-http</artifactId>
>>             <version>2.1-incubator-SNAPSHOT</version>
>>         </dependency>
>>         <dependency>
>>             <groupId>junit</groupId>
>>             <artifactId>junit</artifactId>
>>             <version>4.1</version>
>>             <scope>test</scope>
>>         </dependency>
>>     </dependencies>
>>     <repositories>
>>         <repository>
>>             <id>apache-snapshots</id>
>>             <name>Apache SNAPSHOT Repository</name>
>>            
>> <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
>> <snapshots>
>>                 <enabled>true</enabled>
>>             </snapshots>
>>         </repository>
>>         <repository>
>>             <id>apache-incubating</id>
>>             <name>Apache Incubating Repository</name>
>>
>> <url>http://people.apache.org/repo/m2-incubating-repository/</url>
>>         </repository>
>>     </repositories>
>>     <pluginRepositories>
>>         <pluginRepository>
>>             <id>apache-plugin-snapshots</id>
>>             <name>Apache Maven Plugin Snapshots</name>
>>            
>> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
>> <releases>
>>                 <enabled>false</enabled>
>>             </releases>
>>             <snapshots>
>>                 <enabled>true</enabled>
>>             </snapshots>
>>         </pluginRepository>
>>     </pluginRepositories>
>> </project>
>>
>>
>> And when i invoke the generated with the code:
>>
>> Loader ss = new Loader();
>> LoaderSoap client = ss.getLoaderSoap();
>> System.out.println("Invoking login...");
>> String login = "";
>> String password = "";
>> Holder<UserSessionId> userSessionId = new Holder<UserSessionId>();
>> client.login(login, password, userSessionId);
>> System.out.println("login._login_userSessionId=" +
>> userSessionId.value);
>>
>> i'm getting error:
>>
>> 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:23)
>> 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.initializeParamet
>>er(JaxWsServiceFactoryBean.java:391) at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassIn
>>fo(JaxWsServiceFactoryBean.java:358) at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOpe
>>ration(JaxWsServiceFactoryBean.java:173) at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
>>WSDLOperations(ReflectionServiceFactoryBean.java:319) at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOpe
>>rations(JaxWsServiceFactoryBean.java:182) at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi
>>ceFromWSDL(ReflectionServiceFactoryBean.java:211) at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
>>ServiceModel(ReflectionServiceFactoryBean.java:262) at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref
>>lectionServiceFactoryBean.java:143) at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi
>>ceFactoryBean.java:89) at
>> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abstrac
>>tEndpointFactory.java:82) at
>> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.jav
>>a:50) at
>> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFacto
>>ryBean.java:89) at
>> org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:336) at
>> org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:241) ... 3
>> more
>>
>>
>> the "UserSessionId" is a complextype that should be in header.
>>
>> Please, could anyone say what's wrong?
>>
>> To reproduce the error you'll only need to paste the xml into the
>> pom.xml, and then
>> mvn compile exec:java.
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/CXF-Client-not-working-tf4359854.html#a12459211
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF Client not working

Posted by Daniel Kulp <dk...@apache.org>.
Just FYI:  I tracked this down this afternoon and its working with trunk.   
I'm deploying a new snapshot now.   It should thus work with 2.0.2 when 
we release it.

Dan

On Monday 03 September 2007, exgorth wrote:
> Hello, thanx.
>
> It's working now, but:
>
> the Holder.value is null:
> String login = "xxx";
> String password = "xxx";
> Holder<UserSessionId> userSessionId = new Holder<UserSessionId>();
> client.login(login, password, userSessionId);
> System.out.println("login._login_userSessionId=" +
> userSessionId.value);
>
> I'm sending:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> 	<soap:Body>
> 		<ns5:Login xmlns="http://tourml.ru/query-request/2004-07-07"
> xmlns:ns2="http://www.megatec.ru/tourml/extensions"
> xmlns:ns3="http://tourml.ru/products/2004-04-19"
> xmlns:ns4="http://tourml.ru/service/2006-03-14"
> xmlns:ns5="http://tourml.ru/serviceSecurity/2006-03-14/">
> 			<ns5:login>xxx</ns5:login>
> 			<ns5:password>xxx</ns5:password>
> 		</ns5:Login>
> 	</soap:Body>
> </soap:Envelope>
>
> and receiving:
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<soap:Header>
> 		<UserSessionId xmlns="http://tourml.ru/serviceSecurity/2006-03-14/">
> 			<currentGuid>valid-session-id</currentGuid>
> 		</UserSessionId>
> 	</soap:Header>
> 	<soap:Body>
> 		<LoginResponse
> xmlns="http://tourml.ru/serviceSecurity/2006-03-14/"/> </soap:Body>
> </soap:Envelope>
>
>
> But i cannot access the valid value in my java code 'cause it's NULL.
>
> This problem is claimed to be fixed in XFIRE, but still exists. :(
>
>
> Another question: why cxf is making 3 wsdl requests when i'm invoking
> a single operation? With tcpmon i see those 3 requests for wsdl, why
> do it need them?
>
> dkulp wrote:
> > Just to let you know.   I can reproduce this issue.   I have a fix
> > that I'm testing now and hope to have committed to SVN shortly.
> >
> > Dan
> >
> > On Friday 31 August 2007, exgorth wrote:
> >> Hello, I've generated the client for the 3rd party service:
> >> http://touralliance.bronni.ru/Loader.asmx?wsdl
> >>
> >> with the following:
> >>
> >> <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/maven-v4_0_0.xsd">
> >>     <modelVersion>4.0.0</modelVersion>
> >>     <groupId>ru.invito.ws.client.bronni</groupId>
> >>     <artifactId>spyglass-ws-client-bronni</artifactId>
> >>     <packaging>jar</packaging>
> >>     <version>1.0-SNAPSHOT</version>
> >>     <name>spyglass-ws-client-bronni</name>
> >>     <url>http://maven.apache.org</url>
> >>     <build>
> >>         <plugins>
> >>             <plugin>
> >>                 <groupId>org.apache.cxf</groupId>
> >>                 <artifactId>cxf-codegen-plugin</artifactId>
> >>                 <version>2.1-incubator-SNAPSHOT</version>
> >>                 <dependencies>
> >>                     <dependency>
> >>                         <groupId>org.apache.cxf</groupId>
> >>                        
> >> <artifactId>cxf-rt-bindings-soap</artifactId>
> >> <version>2.1-incubator-SNAPSHOT</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>
> >>             <plugin>
> >>                 <groupId>org.apache.maven.plugins</groupId>
> >>                 <artifactId>maven-compiler-plugin</artifactId>
> >>                 <configuration>
> >>                     <source>1.5</source>
> >>                     <target>1.5</target>
> >>                 </configuration>
> >>             </plugin>
> >>             <plugin>
> >>                 <groupId>org.codehaus.mojo</groupId>
> >>                 <artifactId>exec-maven-plugin</artifactId>
> >>                 <executions>
> >>                     <execution>
> >>                         <goals>
> >>                             <goal>java</goal>
> >>                         </goals>
> >>                     </execution>
> >>                 </executions>
> >>                 <configuration>
> >>
> >> <includeProjectDependencies>true</includeProjectDependencies>
> >>
> >> <mainClass>ru.invito.ws.client.bronni.App</mainClass>
> >> </configuration> </plugin>
> >>         </plugins>
> >>     </build>
> >>     <dependencies>
> >>         <dependency>
> >>             <groupId>org.apache.cxf</groupId>
> >>             <artifactId>cxf-rt-frontend-jaxws</artifactId>
> >>             <version>2.1-incubator-SNAPSHOT</version>
> >>         </dependency>
> >>         <dependency>
> >>             <groupId>org.apache.cxf</groupId>
> >>             <artifactId>cxf-rt-transports-http</artifactId>
> >>             <version>2.1-incubator-SNAPSHOT</version>
> >>         </dependency>
> >>         <dependency>
> >>             <groupId>junit</groupId>
> >>             <artifactId>junit</artifactId>
> >>             <version>4.1</version>
> >>             <scope>test</scope>
> >>         </dependency>
> >>     </dependencies>
> >>     <repositories>
> >>         <repository>
> >>             <id>apache-snapshots</id>
> >>             <name>Apache SNAPSHOT Repository</name>
> >>
> >> <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
> >> <snapshots>
> >>                 <enabled>true</enabled>
> >>             </snapshots>
> >>         </repository>
> >>         <repository>
> >>             <id>apache-incubating</id>
> >>             <name>Apache Incubating Repository</name>
> >>
> >> <url>http://people.apache.org/repo/m2-incubating-repository/</url>
> >>         </repository>
> >>     </repositories>
> >>     <pluginRepositories>
> >>         <pluginRepository>
> >>             <id>apache-plugin-snapshots</id>
> >>             <name>Apache Maven Plugin Snapshots</name>
> >>
> >> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
> >> <releases>
> >>                 <enabled>false</enabled>
> >>             </releases>
> >>             <snapshots>
> >>                 <enabled>true</enabled>
> >>             </snapshots>
> >>         </pluginRepository>
> >>     </pluginRepositories>
> >> </project>
> >>
> >>
> >> And when i invoke the generated with the code:
> >>
> >> Loader ss = new Loader();
> >> LoaderSoap client = ss.getLoaderSoap();
> >> System.out.println("Invoking login...");
> >> String login = "";
> >> String password = "";
> >> Holder<UserSessionId> userSessionId = new Holder<UserSessionId>();
> >> client.login(login, password, userSessionId);
> >> System.out.println("login._login_userSessionId=" +
> >> userSessionId.value);
> >>
> >> i'm getting error:
> >>
> >> 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:23)
> >> 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.initializePara
> >>met er(JaxWsServiceFactoryBean.java:391) at
> >> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClas
> >>sIn fo(JaxWsServiceFactoryBean.java:358) at
> >> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDL
> >>Ope ration(JaxWsServiceFactoryBean.java:173) at
> >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initial
> >>ize WSDLOperations(ReflectionServiceFactoryBean.java:319) at
> >> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDL
> >>Ope rations(JaxWsServiceFactoryBean.java:182) at
> >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildSe
> >>rvi ceFromWSDL(ReflectionServiceFactoryBean.java:211) at
> >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initial
> >>ize ServiceModel(ReflectionServiceFactoryBean.java:262) at
> >> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(
> >>Ref lectionServiceFactoryBean.java:143) at
> >> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsSe
> >>rvi ceFactoryBean.java:89) at
> >> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abst
> >>rac tEndpointFactory.java:82) at
> >> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.
> >>jav a:50) at
> >> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFa
> >>cto ryBean.java:89) at
> >> org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:336)
> >> at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:241)
> >> ... 3 more
> >>
> >>
> >> the "UserSessionId" is a complextype that should be in header.
> >>
> >> Please, could anyone say what's wrong?
> >>
> >> To reproduce the error you'll only need to paste the xml into the
> >> pom.xml, and then
> >> mvn compile exec:java.
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog