Re: Could not find destination factory for transport

2007-07-20 Thread Willem Jiang

Hi Diego,

I just went through your mail, and found you put the server and client 
in one spring application context.

That is wrong. because they have different context.
And I also found that the log should be Could not find conduit 
initiator for ***


There some transport URI conflict between servlet transport and the 
standalone http transport.

We just split them into cxf-extension-http-jetty.xml  and cxf-servlet.xml.
And there is no http conduit  initiatior defined in the servlet 
transport factory.


And in your case , you just put the cxf-servlet.xml in you spring 
application context, so the client http conduit Initiator will not be 
found for the client.


You need to create the client with another spring application context 
file likes this:


beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:jaxws=http://cxf.apache.org/jaxws;
 xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;
  
   import resource=classpath:META-INF/cxf/cxf.xml /

   import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
   import resource=classpath:META-INF/cxf/cxf-extension-http-jetty.xml /

  

   bean id=client class=com.net2com.webservice.HelloWorld 
 factory-bean=clientFactory factory-method=create/

   bean id=clientFactory

class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
  property name=serviceClass 
value=com.net2com.webservice.HelloWorld/
  property name=address
value=http://localhost:8080/interface/webservice/HelloWorld/
   /bean
/beans

Cheers,

Willem.

Diego Xu wrote:

Hi:
  I'm using CXF2.0 release version for my first try of jax-ws, and now got
blocked by an error throwed by server.
  I'm using JDK5.0, Tomcat5.5, Spring2.0.6.
  
  here is my HellowWorld interface:

-
package com.net2com.webservice;

import javax.jws.WebService;

@WebService
public interface HelloWorld {
String sayHi(String text);
}

  and impl:

package com.net2com.webservice;

import javax.jws.WebService;

@WebService(endpointInterface = com.net2com.webservice.HelloWorld)
public class HelloWorldImpl implements HelloWorld {

public String sayHi(String text) {
return Hello  + text;
}
}


Spring config: (I put both server and client into one application)
---

beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:jaxws=http://cxf.apache.org/jaxws;
  xsi:schemaLocation=
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;
   
import resource=classpath:META-INF/cxf/cxf.xml /

import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
import resource=classpath:META-INF/cxf/cxf-servlet.xml /
  ...
  jaxws:endpoint id=helloWorld 
		implementor=com.net2com.webservice.HelloWorldImpl 
		address=/HelloWorld /
 
  bean id=client class=com.net2com.webservice.HelloWorld 
  factory-bean=clientFactory factory-method=create/

	bean id=clientFactory

class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
  property name=serviceClass 
value=com.net2com.webservice.HelloWorld/
  property name=address
value=http://localhost:8080/interface/webservice/HelloWorld/
/bean
/beans

 tomcat web.xml

web-app
...
servlet
servlet-nameCXFServlet/servlet-name
display-nameCXF Servlet/display-name
servlet-class
org.apache.cxf.transport.servlet.CXFServlet
/servlet-class
load-on-startup1/load-on-startup
/servlet

servlet-mapping
servlet-nameCXFServlet/servlet-name
url-pattern/webservice/*/url-pattern
/servlet-mapping
   ..
/web-app

and i already put following deps into WEB-INF/lib
---
commons-logging-1.1.jar
geronimo-activation_1.1_spec-1.0-M1.jar 
geronimo-annotation_1.0_spec-1.1.jar 
geronimo-javamail_1.4_spec-1.0-M1.jar 
geronimo-servlet_2.5_spec-1.1-M1.jar 
geronimo-ws-metadata_2.0_spec-1.1.1.jar 
jaxb-api-2.0.jar

jaxb-impl-2.0.5.jar
jaxws-api-2.0.jar
saaj-api-1.3.jar
saaj-impl-1.3.jar
stax-api-1.0.1.jar
wsdl4j-1.6.1.jar
wstx-asl-3.2.1.jar
XmlSchema-1.2.jar

spring-2.0.6.jar

cxf-2.0-incubator.jar

-#

that's all my did to run the first spring demo, but when i try to invoke
server side impl through:

this.helloWorldService = (HelloWorld) wac.getBean(client);  // get ws
client bean from 

Re: Error trying to run client against web service with Header

2007-07-20 Thread Jim Ma
I verified and this issue is fixed in latest cxf  kit . But I found 
another unsupported binding in CXF. When I run the soap client , I get 
the below

exception :

[java] Exception in thread main javax.xml.ws.WebServiceException: 
org.apache.cxf.service.factory.ServiceConstrluctionException
[java] at 
org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:243)

[java] at javax.xml.ws.Service.getPort(Service.java:94)
  ...
[java] Caused by: org.apache.cxf.BusException: No binding factory 
for namespace http://schemas.xmlsoap.org/wsdl/http/ registered
[java] at 
org.apache.cxf.binding.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:78)
[java] at 
org.apache.cxf.endpoint.EndpointImpl.createBinding(EndpointImpl.java:127)

[java] ... 14 more

I filled a jira issue for this : 
https://issues.apache.org/jira/browse/CXF-816.


BTW , CXF implemented own http binding which can easily build restful 
webservice.

http://cwiki.apache.org/CXF20DOC/http-binding.html ,FYI.


Jim

Jim Ma wrote:

Hi,
I think this issue is fixed by James couple days before 
.(http://svn.apache.org/viewvc?view=revrev=554819*)* . Did you used 
the lastest cxf kit ?

Cheers
Jim



kranga wrote:
Can someone please attempt to duplicate this and help me debug the 
root cause. The error is with the geenrated code without changes. The 
WSDL is readily accessible at the location (you don't have to 
register) and the error happens on calling the SoapPort 
implementation. Any help is appreciated.


Thanks

- Original Message - From: kranga [EMAIL PROTECTED]
To: cxf-user@incubator.apache.org
Sent: Thursday, July 19, 2007 1:52 PM
Subject: Error trying to run client against web service with Header


I'm trying to build a webservice against the WSDL at 
http://www.xignite.com/xRealTime.asmx?WSDL


I generated the client using wsdl2Java included the -exsh flag. 
However, when I run the SOAP client, I get the following exception:


Note: The web service works perfectly when I access from Axis2 
generated client, but I'd really like to use CXF. So please help!


EXCEPTION STACK TRACE:
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find a message part matching name 
{http://www.xignite.com/services/}Header. Possible values are 
[{http://www.xignite.com/services/}Time, 
{http://www.xignite.com/services/}Symbol, 
http://www.xignite.com/services/}Exchange].


at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(Jax 


WsServiceFactoryBean.java:393)

at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(Jax 


WsServiceFactoryBean.java:371)

at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation 


(JaxWsServiceFactoryBean.java:187)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOp 


erations(ReflectionServiceFactoryBean.java:303)

at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation 


s(JaxWsServiceFactoryBean.java:196)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom 


WSDL(ReflectionServiceFactoryBean.java:195)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic 


eModel(ReflectionServiceFactoryBean.java:246)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio 


nServiceFactoryBean.java:136)

at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpo 


intFactory.java:83)

at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) 



at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean 


.java:82)

at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:320)

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:238)







Re: JAX-WS/annotated SOAP services -- exporting implementation methods rather than interface ones?

2007-07-20 Thread Stuart Bingë
On Thursday 19 July 2007 19:59:17 Daniel Kulp wrote:
 Confirmed as a bug and logged as:
 https://issues.apache.org/jira/browse/CXF-813
 I'm testing a fix now.

Thanks for your help Daniel -- I'll eagerly await the next release then :-)

Cheers,
Stuart

__

“Complinet Ltd is registered in England. Registered office at Vintners Place, 
68 Upper Thames Street, London EC4V 3BJ. Company number 3170722. VAT No. 749 
324 021.
Complinet Inc is a corporation registered in Delaware, USA.”

This email has been scanned by the MessageLabs Email Security System.


Re: Returning a java map

2007-07-20 Thread Jim Ma

Hi ,

I used eclipse stp to validate this wsdl and found two errors  : 
in  this line element minOccurs=0 name=id nillable=true 
type=ns0:UUID/, the namespace prefix  ns0 is not defined .
in this line element minOccurs=0 name=context nillable=true 
type=ns1:Context/ , context element can not be found in ns1 namespace ,

it's defined in namespace http://metadata.core.lor.rbx.com; .

Cheers
Jim



Julio Arias wrote:

Hi Jim -

I partially fix this, I change the data binding to Aegis (now the map 
has a type in the WSDL) but now I get a different problem with wsdl2java
The WSDL looks very similar at the one generated by xFire I think 
there is a problem with the WSDL namespaces but I'm not sure what.

This is the WSDL:

?xml version=1.0 encoding=utf-8?
wsdl:definitions name=MetadataService 
targetNamespace=http://lor.rbx.com/ws/metadata; 
xmlns:ns1=http://lor.rbx.com/ws/metadata; 
xmlns:ns2=urn:com:rbx:lor:ws:model xmlns:ns3=http://util.java; 
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; 
xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema;

  wsdl:types
schema attributeFormDefault=qualified 
elementFormDefault=qualified 
targetNamespace=http://metadata.core.lor.rbx.com; 
xmlns=http://www.w3.org/2001/XMLSchema;

simpleType name=DocumentLanguage
restriction base=string
enumeration value=Any/
enumeration value=English/
/restriction
/simpleType
simpleType name=DocumentDegreeInteractivity
restriction base=string
enumeration value=Any/
enumeration value=VeryLow/
enumeration value=Low/
enumeration value=Medium/

enumeration value=High/
enumeration value=VeryHigh/
/restriction
/simpleType
simpleType name=DocumentFormat
restriction base=string
enumeration value=Any/
enumeration value=HTML_XHTML/
enumeration value=SHOWCKWAVE_FLASH/
enumeration value=FLASH_VIDEO/
enumeration value=JPEG/
enumeration value=GIF/
enumeration value=MPEG/
enumeration value=PDF/
enumeration value=MSWORD/
enumeration value=MSEXCEL/
enumeration value=MSPOWERPOINT/

enumeration value=XML/
/restriction
/simpleType
simpleType name=DocumentDifficulty
restriction base=string
enumeration value=Any/
enumeration value=VeryLow/
enumeration value=Low/
enumeration value=Medium/
enumeration value=High/
enumeration value=VeryHigh/
/restriction
/simpleType
simpleType name=DocumentLearningResourceType
restriction base=string
enumeration value=Any/
enumeration value=Excercise/

enumeration value=Simulation/
enumeration value=Questionnaire/
enumeration value=Diagram/
enumeration value=Figure/
enumeration value=Graph/
enumeration value=Index/
enumeration value=Slide/
enumeration value=Table/
enumeration value=NarrativeText/
enumeration value=Exam/
enumeration value=Experiment/
enumeration value=ProblemStatement/
enumeration value=SelfAssesment/
/restriction
/simpleType
simpleType name=DocumentIntendedEndUser
restriction base=string

enumeration value=Any/
enumeration value=Teacher/
enumeration value=Author/
enumeration value=Learner/
enumeration value=Manager/
/restriction
/simpleType
simpleType name=Context
restriction base=string
enumeration value=Any/
enumeration value=PrimaryEducation/
enumeration value=SecondaryEducation/
enumeration value=HigherEducation/
enumeration value=UniversityFirstCycle/
enumeration value=UniversitySecondCycle/
enumeration value=UniversityPostgrade/
enumeration value=TechnicalSchoolFirstCycle/

enumeration value=TechnicalSchoolSecondCycle/
enumeration value=ProfessionalFormation/
enumeration value=ContinuousFormation/
enumeration value=VocationalTraining/
/restriction
/simpleType
simpleType name=DocumentStatus
restriction base=string
enumeration value=Any/
enumeration value=Draft/
enumeration value=Final/
enumeration value=Revised/
enumeration value=Unavailable/
/restriction
/simpleType
simpleType name=DocumentInteractivityType
restriction base=string

enumeration value=Any/
enumeration value=Active/
enumeration value=Expositive/
enumeration value=Mixed/
enumeration value=Undefined/
/restriction
/simpleType
/schema

schema attributeFormDefault=qualified 
elementFormDefault=qualified 
targetNamespace=http://lor.rbx.com/ws/metadata; 
xmlns=http://www.w3.org/2001/XMLSchema;

complexType name=anyType2anyTypeMap
sequence
element maxOccurs=unbounded minOccurs=0 name=entry
complexType
sequence
element minOccurs=0 name=key type=anyType/
element minOccurs=0 name=value type=anyType/

/sequence
/complexType
/element
/sequence
/complexType
/schema

schema attributeFormDefault=qualified 
elementFormDefault=qualified 
targetNamespace=urn:com:rbx:lor:ws:model 
xmlns=http://www.w3.org/2001/XMLSchema; xmlns:ns0=http://util.java; 
xmlns:ns1=http://metadata.core.lor.rbx.com;

complexType name=User
sequence
element minOccurs=0 name=firstName nillable=true type=string/
element minOccurs=0 name=id nillable=true type=ns0:UUID/
element minOccurs=0 name=lastName nillable=true type=string/
any maxOccurs=unbounded/
/sequence
/complexType
complexType name=Metadata

sequence
element minOccurs=0 name=ageFrom type=int/

RE: Back to a really basic question: using CXF+Spring to deploy a JAX-WS+Aegis service behind a servlet container.

2007-07-20 Thread Benson Margulies
My experience is that commenting on the Wiki pages is like a quantum
process. Willem fixes them more or less instantly.

 -Original Message-
 From: Freeman Fang [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 19, 2007 10:55 PM
 To: cxf-user@incubator.apache.org
 Subject: Re: Back to a really basic question: using CXF+Spring to
deploy a
 JAX-WS+Aegis service behind a servlet container.
 
 Hi Benson,
 FYI,  I just know Willem update this wiki page today. So what I see
may
 not same as you saw.
 
 Best Regards
 Freeman
 
 Freeman Fang wrote:
  Hi Benson,
 
  I think you should follow spring_http sample.
  The doc from wiki might out of date, but the working demo is more
  believable. :-)
 
  Btw, I roughly check this wiki page and spring_http sample, they are
  pretty much match with each other. Would you please mark what kind
of
  macros defined in the sample is not match the wiki, so that we can
  update the wiki.
  Best Regards
 
  Freeman
 
  Benson Margulies wrote:
  Before I started discovering various issues in the migration from
xfire
  to cxf, my original goal was to wrap up a service of mine for
 deployment
  in a servlet container. The code of my service is set up to use
Spring
  to wire together various of its bits and pieces.
 
 
 
  I'm looking at the macros defined in the samples, and I see one or
two
  things that give me a pause. They don't look that much like
 
http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html.
  Should I just follow the wiki and ignore the samples?
 
 
 
 
 
 


context-params, spring, CXF

2007-07-20 Thread Benson Margulies
The following isn't exactly a cxf issue. It's more of a generic problem
with servlets that I've run into many times. However, I wonder if people
in CXF-land have had some relevant experience.

Consider a software module that is implemented as a CXF service. Its
job, let us say, is to publish a large raft of data from some
database-like location over a service. The author wishes to distribute
the module in the form of a WAR file, and be able to tell the recipient:
Just drop the war file into the container, \set some parameters to tell
us where you've configured the database,/ and start it up.

The trouble comes in my typewriter italics. How to tell the recipient to
set some parameters? Note that in my particular case the data source is
not, in fact, an actual JDBC datasource, so the 'j2ee light' resource
pools for JDBC and Java Mail often seen in servlet containers aren't any
help.

I can think of a few options:

1) Tell them to drop the web application unpacked, and tell them to edit
web.xml to set one or more context-param elements. In the spring wiring,
use ServletContextPropertyPlaceholderConfigurer to pull those values
into the beans.

2) Let them leave the WAR file packed, but tell them how to use
container-specific configuration to set these parameters at the
container level. I know how to do this for Tomcat, I have no information
on the difficulty level of Jetty or anything else.

3) Have the application start up without the data, and supply an admin
web UI that can accept these parameters and store them ... where?

4) Get involved in JNDI. This presumably requires a custom spring
property editor (or just passing JNDI refs into the beans and letting
them talk to the JNDI API). That's a painful pile of mechanism to set a
simple parameter.

5) Give them a program that they run to push the configuration into the
WAR file by pushing a property file into the classpath.

 Have any of you gentle readers been down this path?

--benson



Re: Error trying to run client against web service with Header

2007-07-20 Thread kranga

I'm using version the 2.0 release not the latest snapshot.

Thanks

- Original Message - 
From: Jim Ma [EMAIL PROTECTED]

To: cxf-user@incubator.apache.org
Sent: Thursday, July 19, 2007 11:14 PM
Subject: Re: Error trying to run client against web service with Header



Hi,
I think this issue is fixed by James couple days before 
.(http://svn.apache.org/viewvc?view=revrev=554819*)* . Did you used the 
lastest cxf kit ?

Cheers
Jim



kranga wrote:
Can someone please attempt to duplicate this and help me debug the root 
cause. The error is with the geenrated code without changes. The WSDL is 
readily accessible at the location (you don't have to register) and the 
error happens on calling the SoapPort implementation. Any help is 
appreciated.


Thanks

- Original Message - From: kranga [EMAIL PROTECTED]
To: cxf-user@incubator.apache.org
Sent: Thursday, July 19, 2007 1:52 PM
Subject: Error trying to run client against web service with Header


I'm trying to build a webservice against the WSDL at 
http://www.xignite.com/xRealTime.asmx?WSDL


I generated the client using wsdl2Java included the -exsh flag. However, 
when I run the SOAP client, I get the following exception:


Note: The web service works perfectly when I access from Axis2 generated 
client, but I'd really like to use CXF. So please help!


EXCEPTION STACK TRACE:
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find a message part matching name 
{http://www.xignite.com/services/}Header. Possible values are 
[{http://www.xignite.com/services/}Time, 
{http://www.xignite.com/services/}Symbol, 
http://www.xignite.com/services/}Exchange].


at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeParameter(Jax

WsServiceFactoryBean.java:393)

at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeClassInfo(Jax

WsServiceFactoryBean.java:371)

at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation

(JaxWsServiceFactoryBean.java:187)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOp
erations(ReflectionServiceFactoryBean.java:303)

at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation
s(JaxWsServiceFactoryBean.java:196)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFrom
WSDL(ReflectionServiceFactoryBean.java:195)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServic
eModel(ReflectionServiceFactoryBean.java:246)

at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflectio
nServiceFactoryBean.java:136)

at
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpo
intFactory.java:83)

at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)

at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean
.java:82)

at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:320)

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:238)









RE: Back to a really basic question: using CXF+Spring to deploy a JAX-WS+Aegis service behind a servlet container.

2007-07-20 Thread Benson Margulies
I see that the Wiki and the spring_http samples are perfectly aligned.

My confusion resulted from looking at hello_world, which is another
thing altogether. What's going on in there?

The hello sample carefully deploys a prebuilt, static, WSDL file. Why
not just let the service handle the ?wsdl URL, as usual?

The cxf.xml for hello_world uses complex {} namespaces. The wiki
doesn't. It has a SOAPService bean. ?


Determine which services are registered

2007-07-20 Thread Holger Stolzenberg
I have a web page that should dynamically show a list of all registered 
services.

Is there a class that knows all the web services (endpoints) that have been 
registered. If yes how can get this class or bean from the spring context? 

Mit lieben Grüßen aus dem eWerk

  |  Holger Stolzenberg
  |  Softwareentwickler
  |
  |  Geschäftsführer: 
  |  Frank Richter, Erik Wende, Hendrik Schubert
  |
  |  eWerk IT GmbH
  |  Markt 16
  |  Leipzig 04109
  |  http://www.ewerk.com
  |  HRB 9065, AG Leipzig
  |  Hauptniederlassung Leipzig
  |
  |  fon +49.341.4 26 49-0
  |  fax +49.341.4 26 49-88
  |  mailto:[EMAIL PROTECTED]
  |
  |  Support:
  |  fon 0700 CALLME24 (0700 22556324)
  |  fax 0700 CALLME24 (0700 22556324)
  |
  | Auskünfte und Angebote per Mail
  | sind freibleibend und unverbindlich. 


Re: Endpoint config problems

2007-07-20 Thread Andrea Smyth

Hi Julio,

I believe this is due to a bug in the EndpointDefinitionParser for which 
I have committed a fix with 
http://svn.apache.org/viewvc?view=revrev=557992 
http://svn.apache.org/viewvc?view=revrev=557992
Let me know if you still have problems using the first form of 
configuration.


Regards,
Andrea.

.. Julio Arias wrote:


Hi all -

Just to let you now about this problem I have. I got the following  
spring endpoint config:


jaxws:endpoint id=documentService address=/DocumentService
jaxws:implementor   
bean class=com.rbx.lor.ws.DocumentServiceImpl

property name=documentManager ref=documentManager/
/bean
/jaxws:implementor
jaxws:inInterceptors
bean class=org.apache.cxf.binding.soap.saaj.SAAJInInterceptor/
bean class=org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
constructor-arg
map
entry key=action value=UsernameToken/
entry key=passwordType value=PasswordText/
entry key=passwordCallbackClass  
value=com.rbx.lor.ws.security.AuthenticationCallback/

/map
/constructor-arg
/bean
/jaxws:inInterceptors
/jaxws:endpoint


I like this config but I get a spring xml context exception

2007-07-18 10:33:28,686 ERROR [org.apache.catalina.core.ContainerBase. 
[Catalina].[localhost].[/lor]] - Exception sending context  
initialized event to listener instance of class  
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException 
: Configuration problem: constructor-arg element must not contain  
more than one sub-element


I fix it by changing the implementor as an attribute of the endpoint  
using # to point to by implementing bean and now it works fine, but  
like my initial config is simpler and I have everything in one place,  
is there another workaround for this??


The working config is this:

bean id=documentServiceImpl  
class=com.rbx.lor.ws.DocumentServiceImpl

property name=documentManager ref=documentManager/
/bean

jaxws:endpoint id=documentService address=/DocumentService  
implementor=#documentServiceImpl

jaxws:inInterceptors
bean 
class=org.apache.cxf.binding.soap.saaj.SAAJInInterceptor/
bean 
class=org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor

constructor-arg
map
entry key=action value=UsernameToken/
entry key=passwordType value=PasswordText/
entry key=passwordCallbackClass  
value=com.rbx.lor.ws.security.AuthenticationCallback/

/map
/constructor-arg
/bean
/jaxws:inInterceptors
/jaxws:endpoint


Julio Arias
Java Developer
Roundbox Global : enterprise : technology : genius
-
Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica
tel: 404.567.5000 ext. 2001 | cell: 11.506.849.5981
email: [EMAIL PROTECTED] | www.rbxglobal.com
-





IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland


Re: Returning a java map

2007-07-20 Thread Dan Diephouse

Hi Julio,

I believe I fixed this yesterday as part of CXF-811. Could you try a
SNAPSHOT build?

http://incubator.apache.org/cxf/download.html

The fixes will be part of our 2.0.1 release. Thanks,

- Dan

On 7/19/07, Julio Arias [EMAIL PROTECTED] wrote:


Hi Jim -

I partially fix this, I change the data binding to Aegis (now the map
has a type in the WSDL) but now I get a different problem with wsdl2java
The WSDL looks very similar at the one generated by xFire I think
there is a problem with the WSDL namespaces but I'm not sure what.
This is the WSDL:

?xml version=1.0 encoding=utf-8?
wsdl:definitions name=MetadataService targetNamespace=http://
lor.rbx.com/ws/metadata xmlns:ns1=http://lor.rbx.com/ws/metadata;
xmlns:ns2=urn:com:rbx:lor:ws:model xmlns:ns3=http://util.java;
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://
schemas.xmlsoap.org/wsdl/ xmlns:xsd=http://www.w3.org/2001/XMLSchema;
   wsdl:types
schema attributeFormDefault=qualified
elementFormDefault=qualified targetNamespace=http://
metadata.core.lor.rbx.com xmlns=http://www.w3.org/2001/XMLSchema;
simpleType name=DocumentLanguage
restriction base=string
enumeration value=Any/
enumeration value=English/
/restriction
/simpleType
simpleType name=DocumentDegreeInteractivity
restriction base=string
enumeration value=Any/
enumeration value=VeryLow/
enumeration value=Low/
enumeration value=Medium/

enumeration value=High/
enumeration value=VeryHigh/
/restriction
/simpleType
simpleType name=DocumentFormat
restriction base=string
enumeration value=Any/
enumeration value=HTML_XHTML/
enumeration value=SHOWCKWAVE_FLASH/
enumeration value=FLASH_VIDEO/
enumeration value=JPEG/
enumeration value=GIF/
enumeration value=MPEG/
enumeration value=PDF/
enumeration value=MSWORD/
enumeration value=MSEXCEL/
enumeration value=MSPOWERPOINT/

enumeration value=XML/
/restriction
/simpleType
simpleType name=DocumentDifficulty
restriction base=string
enumeration value=Any/
enumeration value=VeryLow/
enumeration value=Low/
enumeration value=Medium/
enumeration value=High/
enumeration value=VeryHigh/
/restriction
/simpleType
simpleType name=DocumentLearningResourceType
restriction base=string
enumeration value=Any/
enumeration value=Excercise/

enumeration value=Simulation/
enumeration value=Questionnaire/
enumeration value=Diagram/
enumeration value=Figure/
enumeration value=Graph/
enumeration value=Index/
enumeration value=Slide/
enumeration value=Table/
enumeration value=NarrativeText/
enumeration value=Exam/
enumeration value=Experiment/
enumeration value=ProblemStatement/
enumeration value=SelfAssesment/
/restriction
/simpleType
simpleType name=DocumentIntendedEndUser
restriction base=string

enumeration value=Any/
enumeration value=Teacher/
enumeration value=Author/
enumeration value=Learner/
enumeration value=Manager/
/restriction
/simpleType
simpleType name=Context
restriction base=string
enumeration value=Any/
enumeration value=PrimaryEducation/
enumeration value=SecondaryEducation/
enumeration value=HigherEducation/
enumeration value=UniversityFirstCycle/
enumeration value=UniversitySecondCycle/
enumeration value=UniversityPostgrade/
enumeration value=TechnicalSchoolFirstCycle/

enumeration value=TechnicalSchoolSecondCycle/
enumeration value=ProfessionalFormation/
enumeration value=ContinuousFormation/
enumeration value=VocationalTraining/
/restriction
/simpleType
simpleType name=DocumentStatus
restriction base=string
enumeration value=Any/
enumeration value=Draft/
enumeration value=Final/
enumeration value=Revised/
enumeration value=Unavailable/
/restriction
/simpleType
simpleType name=DocumentInteractivityType
restriction base=string

enumeration value=Any/
enumeration value=Active/
enumeration value=Expositive/
enumeration value=Mixed/
enumeration value=Undefined/
/restriction
/simpleType
/schema

schema attributeFormDefault=qualified
elementFormDefault=qualified targetNamespace=http://lor.rbx.com/ws/
metadata xmlns=http://www.w3.org/2001/XMLSchema;
complexType name=anyType2anyTypeMap
sequence
element maxOccurs=unbounded minOccurs=0 name=entry
complexType
sequence
element minOccurs=0 name=key type=anyType/
element minOccurs=0 name=value type=anyType/

/sequence
/complexType
/element
/sequence
/complexType
/schema

schema attributeFormDefault=qualified
elementFormDefault=qualified
targetNamespace=urn:com:rbx:lor:ws:model xmlns=http://www.w3.org/
2001/XMLSchema xmlns:ns0=http://util.java; xmlns:ns1=http://
metadata.core.lor.rbx.com
complexType name=User
sequence
element minOccurs=0 name=firstName nillable=true type=string/
element minOccurs=0 name=id nillable=true type=ns0:UUID/
element minOccurs=0 name=lastName nillable=true type=string/
any maxOccurs=unbounded/
/sequence
/complexType
complexType name=Metadata

sequence
element minOccurs=0 name=ageFrom type=int/
element minOccurs=0 name=ageTo type=int/
element minOccurs=0 name=context nillable=true
type=ns1:Context/
element minOccurs=0 name=coverage nillable=true
type=ns3:Coverage/
element 

Off to a poor start with tomcat + spring + cxf + sysdeo?

2007-07-20 Thread Benson Margulies
I've probably no one else to blame but myself for the fact that my first
experiment involves running under tomcat with the sysdeo tomcat plugin
instead of with a plain vanilla config. I get the following back, and no
log traffic at all. Startup is uneventful from a logging standpoint, as
well.


HTTP Status 404 - Servlet CXFServlet is not available




type Status report

message Servlet CXFServlet is not available

description The requested resource (Servlet CXFServlet is not available)
is not available.




Apache Tomcat/5.5.23


 



Re: Returning a java map

2007-07-20 Thread Daniel Kulp

Julio,

Dan D. thinks he fixed the namespace issue in the Aegis binding 
yesterday.  Is there any way you could grab the latest snapshot that I 
deployed last night from:

http://people.apache.org/repo/m2-snapshot-repository/org/apache/cxf/apache-cxf/2.0.1-incubator-SNAPSHOT/

and give that a try?

Thanks!
Dan


On Thursday 19 July 2007 23:07, Julio Arias wrote:
 Hi Jim -

 I partially fix this, I change the data binding to Aegis (now the map
 has a type in the WSDL) but now I get a different problem with
 wsdl2java The WSDL looks very similar at the one generated by xFire I
 think there is a problem with the WSDL namespaces but I'm not sure
 what. This is the WSDL:

 ?xml version=1.0 encoding=utf-8?
 wsdl:definitions name=MetadataService targetNamespace=http://
 lor.rbx.com/ws/metadata xmlns:ns1=http://lor.rbx.com/ws/metadata;
 xmlns:ns2=urn:com:rbx:lor:ws:model xmlns:ns3=http://util.java;
 xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://
 schemas.xmlsoap.org/wsdl/
 xmlns:xsd=http://www.w3.org/2001/XMLSchema; wsdl:types
 schema attributeFormDefault=qualified
 elementFormDefault=qualified targetNamespace=http://
 metadata.core.lor.rbx.com xmlns=http://www.w3.org/2001/XMLSchema;
 simpleType name=DocumentLanguage
 restriction base=string
 enumeration value=Any/
 enumeration value=English/
 /restriction
 /simpleType
 simpleType name=DocumentDegreeInteractivity
 restriction base=string
 enumeration value=Any/
 enumeration value=VeryLow/
 enumeration value=Low/
 enumeration value=Medium/

 enumeration value=High/
 enumeration value=VeryHigh/
 /restriction
 /simpleType
 simpleType name=DocumentFormat
 restriction base=string
 enumeration value=Any/
 enumeration value=HTML_XHTML/
 enumeration value=SHOWCKWAVE_FLASH/
 enumeration value=FLASH_VIDEO/
 enumeration value=JPEG/
 enumeration value=GIF/
 enumeration value=MPEG/
 enumeration value=PDF/
 enumeration value=MSWORD/
 enumeration value=MSEXCEL/
 enumeration value=MSPOWERPOINT/

 enumeration value=XML/
 /restriction
 /simpleType
 simpleType name=DocumentDifficulty
 restriction base=string
 enumeration value=Any/
 enumeration value=VeryLow/
 enumeration value=Low/
 enumeration value=Medium/
 enumeration value=High/
 enumeration value=VeryHigh/
 /restriction
 /simpleType
 simpleType name=DocumentLearningResourceType
 restriction base=string
 enumeration value=Any/
 enumeration value=Excercise/

 enumeration value=Simulation/
 enumeration value=Questionnaire/
 enumeration value=Diagram/
 enumeration value=Figure/
 enumeration value=Graph/
 enumeration value=Index/
 enumeration value=Slide/
 enumeration value=Table/
 enumeration value=NarrativeText/
 enumeration value=Exam/
 enumeration value=Experiment/
 enumeration value=ProblemStatement/
 enumeration value=SelfAssesment/
 /restriction
 /simpleType
 simpleType name=DocumentIntendedEndUser
 restriction base=string

 enumeration value=Any/
 enumeration value=Teacher/
 enumeration value=Author/
 enumeration value=Learner/
 enumeration value=Manager/
 /restriction
 /simpleType
 simpleType name=Context
 restriction base=string
 enumeration value=Any/
 enumeration value=PrimaryEducation/
 enumeration value=SecondaryEducation/
 enumeration value=HigherEducation/
 enumeration value=UniversityFirstCycle/
 enumeration value=UniversitySecondCycle/
 enumeration value=UniversityPostgrade/
 enumeration value=TechnicalSchoolFirstCycle/

 enumeration value=TechnicalSchoolSecondCycle/
 enumeration value=ProfessionalFormation/
 enumeration value=ContinuousFormation/
 enumeration value=VocationalTraining/
 /restriction
 /simpleType
 simpleType name=DocumentStatus
 restriction base=string
 enumeration value=Any/
 enumeration value=Draft/
 enumeration value=Final/
 enumeration value=Revised/
 enumeration value=Unavailable/
 /restriction
 /simpleType
 simpleType name=DocumentInteractivityType
 restriction base=string

 enumeration value=Any/
 enumeration value=Active/
 enumeration value=Expositive/
 enumeration value=Mixed/
 enumeration value=Undefined/
 /restriction
 /simpleType
 /schema

 schema attributeFormDefault=qualified
 elementFormDefault=qualified targetNamespace=http://lor.rbx.com/ws/
 metadata xmlns=http://www.w3.org/2001/XMLSchema;
 complexType name=anyType2anyTypeMap
 sequence
 element maxOccurs=unbounded minOccurs=0 name=entry
 complexType
 sequence
 element minOccurs=0 name=key type=anyType/
 element minOccurs=0 name=value type=anyType/

 /sequence
 /complexType
 /element
 /sequence
 /complexType
 /schema

 schema attributeFormDefault=qualified
 elementFormDefault=qualified
 targetNamespace=urn:com:rbx:lor:ws:model xmlns=http://www.w3.org/
 2001/XMLSchema xmlns:ns0=http://util.java; xmlns:ns1=http://
 metadata.core.lor.rbx.com
 complexType name=User
 sequence
 element minOccurs=0 name=firstName nillable=true
 type=string/ element minOccurs=0 name=id nillable=true
 type=ns0:UUID/ element minOccurs=0 name=lastName
 nillable=true type=string/ any maxOccurs=unbounded/
 /sequence
 /complexType
 

Add SOAP HEADER value

2007-07-20 Thread Pirola Davide
Hi,

anyone know how to add some value to Soap Header in cxf?

I have generated a client code with wsdl2java, but I don't know how to
add this values to the soap header of the message.

I tried with this code:

 

  MapString, Object soapHeaders = new HashMapString, Object();

List h1 = new ArrayList();

h1.add(value1);

soapHeaders.put(parameter1, h1);

List h2 = new ArrayList();

h2.add(parameter2);

soapHeaders.put(value2, h2);

 ...

 ...

requestContext.put(MessageContext.HTTP_REQUEST_HEADERS,
soapHeaders);

 

but, this seems that they are ignored by the server part of the web
services.

 

Thanks

Davide



Re: Add SOAP HEADER value

2007-07-20 Thread Ulhas Bhole(IONA)

Hi Davide,

Are you trying to add soap headers that are not defined in WSDL? 
(Out-of-band Header) If yes then here is the code snippet that does the 
same.


For adding header :
   InvocationHandler handler  = Proxy.getInvocationHandler(portType);
   BindingProvider  bp = null;

   try {
   if (handler instanceof BindingProvider) {
   bp = (BindingProvider)handler;
   MapString, Object requestContext = bp.getRequestContext();
  
   OutofBandHeader ob = new OutofBandHeader();

   ob.setName(testOobHeader);
   ob.setValue(testOobHeaderValue);
   ob.setHdrAttribute(testHdrAttribute);

   JAXBElementOutofBandHeader job = new 
JAXBElementOutofBandHeader(
   new QName(TEST_HDR_NS, TEST_HDR_REQUEST_ELEM), 
OutofBandHeader.class, null, ob);

   Header hdr = new Header(
   new QName(TEST_HDR_NS, TEST_HDR_REQUEST_ELEM),
   job,
   new JAXBDataBinding(ob.getClass()));

   ListHeader holder = new ArrayListHeader();
   holder.add(hdr);
  
   //Add List of headerHolders to requestContext.

   requestContext.put(Header.HEADER_LIST, holder);
   }
   } catch (JAXBException ex) {
   //System.out.println(failed to insert header into request 
context : + ex);

   }
  



For Accessing the headers received from server :

   InvocationHandler handler  = Proxy.getInvocationHandler(portType);
   BindingProvider  bp = null;
   if (handler instanceof BindingProvider) {
   bp = (BindingProvider)handler;
   MapString, Object responseContext = bp.getResponseContext();
   OutofBandHeader hdrToTest = null;
   List oobHdr = (List) responseContext.get(Header.HEADER_LIST);
   if (oobHdr == null) {
   fail(Should have got List of out-of-band headers ..);
   }
  
   if (oobHdr != null  oobHdr instanceof List) {

   Iterator iter = oobHdr.iterator();
   while (iter.hasNext()) {
   Object hdr = iter.next();
   if (hdr instanceof Header) {
   Header hdr1 = (Header) hdr;
   if (hdr1.getObject() instanceof Node) {
   //System.out.println(Node conains :  + 
hdr1.getObject().toString());

   try {
   JAXBElement job = (JAXBElement) 
JAXBContext.newInstance(ObjectFactory.class)

   .createUnmarshaller()
   .unmarshal((Node) hdr1.getObject());
   hdrToTest = (OutofBandHeader) 
job.getValue();
// System.out.println(oob-hdr contains 
: \nname = 

//   + hdrToTest.getName()
//   +   \nvalue =  + 
hdrToTest.getValue()
//   +  \natribute =  + 
hdrToTest.getHdrAttribute());

   } catch (JAXBException ex) {
   //
   ex.printStackTrace();
   }
   }
   }
   }
   }


This code snippet is from the System test and it uses JAXB generated 
class for headers but is not limited to JAXB.


Regards,

Ulhas Bhole

Pirola Davide wrote:

Hi,

anyone know how to add some value to Soap Header in cxf?

I have generated a client code with wsdl2java, but I don't know how to
add this values to the soap header of the message.

I tried with this code:

 


  MapString, Object soapHeaders = new HashMapString, Object();

List h1 = new ArrayList();

h1.add(value1);

soapHeaders.put(parameter1, h1);

List h2 = new ArrayList();

h2.add(parameter2);

soapHeaders.put(value2, h2);

 ...

 ...

requestContext.put(MessageContext.HTTP_REQUEST_HEADERS,
soapHeaders);

 


but, this seems that they are ignored by the server part of the web
services.

 


Thanks

Davide


  



IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland


RE: xfire migration

2007-07-20 Thread Deno Vichas
Crap!  I found it.  D'oh!  I forgot to remove the bean from the old xml
config that xfire was using. That and I changed the class from
constructor to setter injection for spring.  I can now view my WSDL.
Now It's time to write a client.

It looks like CXF has fixed the problem with JAXB and minOccur=0 and
nillable=false in the XSD file end up being minOccur=0 and nillable=true
in the WSDL.


Off topic question-
What are the pros and cons of constructor vs setting injection with
spring?


Thanks willem!

-Original Message-
From: Willem Jiang [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 20, 2007 12:43 AM
To: cxf-user@incubator.apache.org
Subject: Re: xfire migration

Hi Deno,
I am sorry to reply your mail later.

Basicly you NPE issue is coming from the bus is not loaded rightly.

Please check the log files to see if you can get the below information:

Jul 20, 2007 3:27:58 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf.xml]
Jul 20, 2007 3:27:58 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-extension-soap.xml]
Jul 20, 2007 3:27:58 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-servlet.xml]

I just went through your web.xml and found it may relate your 
contextConfigLocation

 context-param
param-namecontextConfigLocation/param-name
param-value
/WEB-INF/applicationContext.xml 
!-- /WEB-INF/xfire-servlet.xml --
   classpath/applicationContext-services.xml
   !--
classpath:org/codehaus/xfire/spring/xfire.xml --
/param-value
 /context-param

Which one is your services.xml ?
Does classpath/applicationContext-services.xml mean 
classpath:applicaitonContext-services.xml?


Willem.

Deno Vichas wrote:
 Willem,
 I'm sending this again.  I'm not sure you missed it the first time or
 you been too busy to look at it.  

 Here's my services.xml and web.xml.  I'm not sure how to show you my
 classpath.  I'm building this project inside of eclipse.  I have all
my
 jars in my WEB-INF dir and I'm using the eclipse web library to add
them
 to my classpath.

 Thanks,
 deno


 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
   
 http://www.springframework.org/schema/beans/spring-beans.xsd
   http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd;

   import resource=classpath:META-INF/cxf/cxf.xml /
   import resource=classpath:META-INF/cxf/cxf-extension-soap.xml
 /
   import resource=classpath:META-INF/cxf/cxf-servlet.xml /
   
   
   jaxws:endpoint id=helloWorld 
   
 implementor=com.autoreturn.service.HelloWorldImpl 
   address=/hello /

   jaxws:endpoint id=VehicleLookupService 
   
 implementor=com.autoreturn.service.VehicleLookupServiceImpl 
   address=/VehicleLookupService
   jaxws:properties
   entry key=dtsFactory
   ref bean=DTSManager /
   /entry
   entry key=xmlConverter
   ref bean=XmlConverter /
   /entry
   entry key=serviceUsername
 value=${vehicleLookupService.username} /
   entry key=servicePassword
 value=${vehicleLookupService.password} /
   /jaxws:properties
   /jaxws:endpoint
 /beans


 ?xml version=1.0 encoding=UTF-8?
 web-app id=WebApp_ID version=2.4 
   xmlns=http://java.sun.com/xml/ns/j2ee; 
   
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
   
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
   
   display-namethe oracle/display-name
   
   context-param
   param-namewebAppRootKey/param-name
   param-value/oracle/param-value
   /context-param

   context-param
   param-namelog4jConfigLocation/param-name
   param-value/WEB-INF/classes/log4j.xml/param-value
   /context-param
   
   context-param
 param-namelog4jRefreshInterval/param-name
 param-value1000/param-value
   /context-param

   context-param
   param-namecontextConfigLocation/param-name
   param-value
   /WEB-INF/applicationContext.xml 
   

RE: Add SOAP HEADER value

2007-07-20 Thread Pirola Davide
Hi Bhole,
Thanks for your response!

I must call a web services (Google Adsense):
https://sandbox.google.com/api/adsense/v2/AccountService?wsdl

All services, accept request only if in the header contains some value (es: 
developer_email | developer_password ecc..), otherwise google send back an 
error.

So, in the WSDL they are defined... I simply need to add my values to the soap 
message.
Google put on its site a sample code for who use AXIS:
http://code.google.com/apis/adsense/developer/samples/java/CreateAccount.java.txt

I need to do the same thing, but with CXF :-D

Your code is valid also in this case?

Thanks
Davide

-Original Message-
From: Ulhas Bhole(IONA) [mailto:[EMAIL PROTECTED] 
Sent: venerdì 20 luglio 2007 17.53
To: cxf-user@incubator.apache.org
Subject: Re: Add SOAP HEADER value

Hi Davide,

Are you trying to add soap headers that are not defined in WSDL? 
(Out-of-band Header) If yes then here is the code snippet that does the 
same.

 For adding header :
InvocationHandler handler  = Proxy.getInvocationHandler(portType);
BindingProvider  bp = null;

try {
if (handler instanceof BindingProvider) {
bp = (BindingProvider)handler;
MapString, Object requestContext = bp.getRequestContext();
   
OutofBandHeader ob = new OutofBandHeader();
ob.setName(testOobHeader);
ob.setValue(testOobHeaderValue);
ob.setHdrAttribute(testHdrAttribute);

JAXBElementOutofBandHeader job = new 
JAXBElementOutofBandHeader(
new QName(TEST_HDR_NS, TEST_HDR_REQUEST_ELEM), 
OutofBandHeader.class, null, ob);
Header hdr = new Header(
new QName(TEST_HDR_NS, TEST_HDR_REQUEST_ELEM),
job,
new JAXBDataBinding(ob.getClass()));

ListHeader holder = new ArrayListHeader();
holder.add(hdr);
   
//Add List of headerHolders to requestContext.
requestContext.put(Header.HEADER_LIST, holder);
}
} catch (JAXBException ex) {
//System.out.println(failed to insert header into request 
context : + ex);
}
   


For Accessing the headers received from server :

InvocationHandler handler  = Proxy.getInvocationHandler(portType);
BindingProvider  bp = null;
if (handler instanceof BindingProvider) {
bp = (BindingProvider)handler;
MapString, Object responseContext = bp.getResponseContext();
OutofBandHeader hdrToTest = null;
List oobHdr = (List) responseContext.get(Header.HEADER_LIST);
if (oobHdr == null) {
fail(Should have got List of out-of-band headers ..);
}
   
if (oobHdr != null  oobHdr instanceof List) {
Iterator iter = oobHdr.iterator();
while (iter.hasNext()) {
Object hdr = iter.next();
if (hdr instanceof Header) {
Header hdr1 = (Header) hdr;
if (hdr1.getObject() instanceof Node) {
//System.out.println(Node conains :  + 
hdr1.getObject().toString());
try {
JAXBElement job = (JAXBElement) 
JAXBContext.newInstance(ObjectFactory.class)
.createUnmarshaller()
.unmarshal((Node) hdr1.getObject());
hdrToTest = (OutofBandHeader) 
job.getValue();
// System.out.println(oob-hdr contains 
: \nname = 
//   + hdrToTest.getName()
//   +   \nvalue =  + 
hdrToTest.getValue()
//   +  \natribute =  + 
hdrToTest.getHdrAttribute());
} catch (JAXBException ex) {
//
ex.printStackTrace();
}
}
}
}
}


This code snippet is from the System test and it uses JAXB generated 
class for headers but is not limited to JAXB.

Regards,

Ulhas Bhole

Pirola Davide wrote:
 Hi,

 anyone know how to add some value to Soap Header in cxf?

 I have generated a client code with wsdl2java, but I don't know how to
 add this values to the soap header of the message.

 I tried with this code:

  

   MapString, Object soapHeaders = new HashMapString, Object();

 List h1 = new ArrayList();

 h1.add(value1);

 soapHeaders.put(parameter1, h1);

 List h2 = new ArrayList();

 h2.add(parameter2);

 soapHeaders.put(value2, h2);

  ...

  ...

 requestContext.put(MessageContext.HTTP_REQUEST_HEADERS,
 

RE: xfire migration

2007-07-20 Thread Deno Vichas
My WSDL file is now very different from the WSDL the xfire was
generating. This service was created doing schema first using jaxb. The
first problem I notice is that after changing my constructor args to
setters for injection (I didn't know how to write the service xml config
for constructor args - is this possible?) I now have a soap operations
for my setters. How to I avoid this?

The other bigger problem I have I when I build I request in soapUi I
only get a single generic arg element for the request.  Before I would
get something that looked like the object that method of the service
class is expecting.  Where I have gone wrong with all this my service
interface looks like;

@WebService 
public interface VehicleLookupService {
public LookupVehiclesResponse getVehicles(LookupVehiclesRequest
request);
}

LookupVehicleReponse and LookupVehiclesRequest are classes that where
generated with jaxb.

Thanks,
deno



-Original Message-
From: Deno Vichas [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 20, 2007 9:40 AM
To: cxf-user@incubator.apache.org
Subject: RE: xfire migration

Crap!  I found it.  D'oh!  I forgot to remove the bean from the old xml
config that xfire was using. That and I changed the class from
constructor to setter injection for spring.  I can now view my WSDL.
Now It's time to write a client.

It looks like CXF has fixed the problem with JAXB and minOccur=0 and
nillable=false in the XSD file end up being minOccur=0 and nillable=true
in the WSDL.


Off topic question-
What are the pros and cons of constructor vs setting injection with
spring?


Thanks willem!

-Original Message-
From: Willem Jiang [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 20, 2007 12:43 AM
To: cxf-user@incubator.apache.org
Subject: Re: xfire migration

Hi Deno,
I am sorry to reply your mail later.

Basicly you NPE issue is coming from the bus is not loaded rightly.

Please check the log files to see if you can get the below information:

Jul 20, 2007 3:27:58 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf.xml]
Jul 20, 2007 3:27:58 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-extension-soap.xml]
Jul 20, 2007 3:27:58 PM 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource 
[META-INF/cxf/cxf-servlet.xml]

I just went through your web.xml and found it may relate your 
contextConfigLocation

 context-param
param-namecontextConfigLocation/param-name
param-value
/WEB-INF/applicationContext.xml 
!-- /WEB-INF/xfire-servlet.xml --
   classpath/applicationContext-services.xml
   !--
classpath:org/codehaus/xfire/spring/xfire.xml --
/param-value
 /context-param

Which one is your services.xml ?
Does classpath/applicationContext-services.xml mean 
classpath:applicaitonContext-services.xml?


Willem.

Deno Vichas wrote:
 Willem,
 I'm sending this again.  I'm not sure you missed it the first time or
 you been too busy to look at it.  

 Here's my services.xml and web.xml.  I'm not sure how to show you my
 classpath.  I'm building this project inside of eclipse.  I have all
my
 jars in my WEB-INF dir and I'm using the eclipse web library to add
them
 to my classpath.

 Thanks,
 deno


 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
   
 http://www.springframework.org/schema/beans/spring-beans.xsd
   http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd;

   import resource=classpath:META-INF/cxf/cxf.xml /
   import resource=classpath:META-INF/cxf/cxf-extension-soap.xml
 /
   import resource=classpath:META-INF/cxf/cxf-servlet.xml /
   
   
   jaxws:endpoint id=helloWorld 
   
 implementor=com.autoreturn.service.HelloWorldImpl 
   address=/hello /

   jaxws:endpoint id=VehicleLookupService 
   
 implementor=com.autoreturn.service.VehicleLookupServiceImpl 
   address=/VehicleLookupService
   jaxws:properties
   entry key=dtsFactory
   ref bean=DTSManager /
   /entry
   entry key=xmlConverter
   ref bean=XmlConverter /
   /entry
   entry key=serviceUsername
 value=${vehicleLookupService.username} /

Re: Returning a java map

2007-07-20 Thread Julio Arias
I try the latest SNAPSHOT (apache-cxf-2.0.1- 
incubator-20070720.021044-2.tar.gz ) and still is not working. The  
WSDL here is not the same I put first but it has the same problem.


--SEI---

@WebService(
targetNamespace = http://client.webservice.crm.ecot.com/ 
skeleton/StudentService,

name = StudentService
)
@SOAPBinding(style = SOAPBinding.Style.RPC, use =  
SOAPBinding.Use.LITERAL)

public interface StudentService {

public StudentVO findStudent(Long id);

public MapLong, StudentVO getStudentsMap();

public ListStudentVO getStudents(MapString, String filters);

public ListStudentVO getStudentsByIds(ListString ids);

}

---Spring config-


bean id=aegisDatabinding
  class=org.apache.cxf.aegis.databinding.AegisDatabinding/


bean id=userServiceImpl  
class=com.altair.cls.web.service.crm.UserServiceImpl

property name=userManager ref=userManager/
/bean

jaxws:endpoint id=userService address=/UserService  
implementor=#userServiceImpl


jaxws:serviceFactory
bean  
class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean

property name=dataBinding ref=aegisDatabinding/
/bean
/jaxws:serviceFactory

 /jaxws:endpoint


 WSDL-

?xml version=1.0 encoding=utf-8?
wsdl:definitions name=StudentService targetNamespace=http:// 
client.webservice.crm.ecot.com/skeleton/StudentService  
xmlns:ns1=http://client.webservice.crm.ecot.com/skeleton/ 
StudentService xmlns:ns2=urn:com:ecot:crm:webservice:vo:student  
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http:// 
schemas.xmlsoap.org/wsdl/ xmlns:xsd=http://www.w3.org/2001/XMLSchema;

  wsdl:types
schema attributeFormDefault=qualified  
elementFormDefault=qualified targetNamespace=http:// 
client.webservice.crm.ecot.com/skeleton/StudentService xmlns=http:// 
www.w3.org/2001/XMLSchema

complexType name=ArrayOfString
sequence
element maxOccurs=unbounded minOccurs=0 name=string  
nillable=true type=string/

/sequence
/complexType
complexType name=anyType2anyTypeMap
sequence
element maxOccurs=unbounded minOccurs=0 name=entry
complexType
sequence
element minOccurs=0 name=key type=anyType/
element minOccurs=0 name=value type=anyType/

/sequence
/complexType
/element
/sequence
/complexType
/schema

schema attributeFormDefault=qualified  
elementFormDefault=qualified  
targetNamespace=urn:com:ecot:crm:webservice:vo:student  
xmlns=http://www.w3.org/2001/XMLSchema;

complexType name=ArrayOfStudentVO
sequence
element maxOccurs=unbounded minOccurs=0 name=StudentVO  
nillable=true type=ns1:StudentVO/

/sequence
/complexType
complexType name=StudentVO
sequence
element minOccurs=0 name=SEPId nillable=true type=long/
element minOccurs=0 name=address nillable=true type=string/

element minOccurs=0 name=admittedDate nillable=true  
type=string/
element minOccurs=0 name=adultFirstName nillable=true  
type=string/
element minOccurs=0 name=adultLastName nillable=true  
type=string/

element minOccurs=0 name=birthDate nillable=true type=string/
element minOccurs=0 name=country nillable=true type=string/
element minOccurs=0 name=email nillable=true type=string/
element minOccurs=0 name=enrolledDate nillable=true  
type=string/

element minOccurs=0 name=firstName nillable=true type=string/
element minOccurs=0 name=gender nillable=true type=string/
element minOccurs=0 name=grade nillable=true type=string/
element minOccurs=0 name=lastName nillable=true type=string/
element minOccurs=0 name=phone nillable=true type=string/
element minOccurs=0 name=status nillable=true type=string/
any maxOccurs=unbounded/
/sequence
/complexType
/schema

  /wsdl:types
  wsdl:message name=findStudent
wsdl:part name=arg0 type=xsd:long
/wsdl:part
  /wsdl:message
  wsdl:message name=getStudentsByIdsResponse
wsdl:part name=return type=ns2:ArrayOfStudentVO
/wsdl:part

  /wsdl:message
  wsdl:message name=getStudentsByIds
wsdl:part name=arg0 type=ns1:ArrayOfString
/wsdl:part
  /wsdl:message
  wsdl:message name=findStudentResponse
wsdl:part name=return type=ns2:StudentVO
/wsdl:part
  /wsdl:message

  wsdl:message name=getStudentsMap
  /wsdl:message
  wsdl:message name=getStudentsResponse
wsdl:part name=return type=ns2:ArrayOfStudentVO
/wsdl:part
  /wsdl:message
  wsdl:message name=getStudents
wsdl:part name=arg0 type=ns1:anyType2anyTypeMap
/wsdl:part

  /wsdl:message
  wsdl:message name=getStudentsMapResponse
wsdl:part name=return type=ns1:anyType2anyTypeMap
/wsdl:part
  /wsdl:message
  wsdl:portType name=StudentService
wsdl:operation name=getStudentsByIds
  wsdl:input message=ns1:getStudentsByIds  
name=getStudentsByIds

/wsdl:input

  wsdl:output message=ns1:getStudentsByIdsResponse  
name=getStudentsByIdsResponse

/wsdl:output
/wsdl:operation
wsdl:operation name=findStudent
 

Consfused newbie

2007-07-20 Thread Mark Babcock
I have built the following tutorial with no issues:

 

http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

 

 

However, I added my own concrete class and interface and new endpoint in
the beans.xml

 

And I can visit the url and see a wsdl.  But every time I try to consume
it all my objects from what I just created are null.   Why?

 

- beans.xml ---

 

beans xmlns=http://www.springframework.org/schema/beans;

 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

 xmlns:jaxws=http://cxf.apache.org/jaxws;

 xsi:schemaLocation=

http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd

http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;

 

import resource=classpath:META-INF/cxf/cxf.xml /

import
resource=classpath:META-INF/cxf/cxf-extension-soap.xml /

import resource=classpath:META-INF/cxf/cxf-servlet.xml /



jaxws:endpoint

  id=xscout

 
implementor=com.cid.xscout.service.XscoutWebServiceImpl

  address=/XscoutWebService /



jaxws:endpoint

  id=helloWorld

  implementor=com.cid.xscout.demo.HelloWorldImpl

  address=/HelloWorld /

  



/beans

 

 

--  interface 

 

 

package com.cid.xscout.service;

 

 

import com.cid.xscout.bean.Document;

import com.cid.xscout.bean.Taxonomy;

 

import javax.jws.WebMethod;

import javax.jws.WebService;

 

@WebService

public interface XscoutWebService {

 

  

  @WebMethod

  String a();

}

 

 

 concrete class 

package com.cid.xscout.service;

 

import javax.jws.WebService;

 

@WebService

public class XscoutWebServiceImpl implements XscoutWebService{

public String a() { return why;}

}

 



WSS4J implementation in CXF

2007-07-20 Thread gdprao

I have used spring and Xfire combination to configure WSS4J for user
authentication with WSS4JInHandler.  I would like to know whether it is
supported in CXF.  Appreciate if someone could help me out on this.  My
current configuration is as follows:

property name=inHandlers
list
bean 
class=org.codehaus.xfire.util.dom.DOMInHandler /
bean

class=org.codehaus.xfire.security.wss4j.WSS4JInHandler
property name=properties
map
entry 
key=passwordCallbackRef
bean

class=com.mydomain.security.PasswordHandler
/bean
/entry
entry key=action 
value=UsernameToken /
/map
/property

/bean
bean

class=com.mydomain.security.ValidateUserTokenHandler /
/list
/property
-- 
View this message in context: 
http://www.nabble.com/WSS4J-implementation-in-CXF-tf4119426.html#a11715464
Sent from the cxf-user mailing list archive at Nabble.com.



Re: Add SOAP HEADER value

2007-07-20 Thread Daniel Kulp


Davide,

In addition to what Ulhas mentioned, you could also have it
done automatically at wsdl2java time.   If you run wsdl2java with
the -exsh true flag, all the headers would be added as additional
parameters to the methods.

Example:

@WebMethod
public void addSyndicationService(
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
name = synServiceType)
java.lang.String synServiceType,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = debug_zip)
java.lang.String debugZip,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = debug_phone)
java.lang.String debugPhone,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = debug_association_type)
java.lang.String debugAssociationType,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = display_locale)
java.lang.String displayLocale,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = client_id)
java.lang.String clientId,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = developer_email)
java.lang.String developerEmail,
@WebParam(targetNamespace = http://www.google.com/api/adsense/v2;, 
header = true, name = developer_password)
java.lang.String developerPassword
) throws AdSenseApiException_Exception;


That said, there have been some runtime bugs with that.  You may need 
the latest trunk for that to actually work.

Dan


On Friday 20 July 2007 11:38, Pirola Davide wrote:
 Hi,

 anyone know how to add some value to Soap Header in cxf?

 I have generated a client code with wsdl2java, but I don't know how
 to add this values to the soap header of the message.

 I tried with this code:



   MapString, Object soapHeaders = new HashMapString, Object();

 List h1 = new ArrayList();

 h1.add(value1);

 soapHeaders.put(parameter1, h1);

 List h2 = new ArrayList();

 h2.add(parameter2);

 soapHeaders.put(value2, h2);

  ...

  ...

 requestContext.put(MessageContext.HTTP_REQUEST_HEADERS,
 soapHeaders);



 but, this seems that they are ignored by the server part of the web
 services.



 Thanks

 Davide

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog


Re: WSS4J implementation in CXF

2007-07-20 Thread Julio Arias

Hello -

You could use something like this, but there is a bug in the  
WSS4JInInterceptor https://issues.apache.org/jira/browse/CXF-819 that  
needs to be address beffore you can use a password callback by reference


jaxws:endpoint id=metadataService address=/MetadataService  
implementor=#metadataServiceImpl

jaxws:inInterceptors
bean 
class=org.apache.cxf.binding.soap.saaj.SAAJInInterceptor/
bean 
class=org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
property name=properties
map
entry key=action 
value=UsernameToken/
entry key=passwordType 
value=PasswordText/
		entry key=passwordCallbackRef value- 
ref=authenticationCallbackHandler/

/map
/property
/bean
/jaxws:inInterceptors
/jaxws:endpoint

On Jul 20, 2007, at 2:32 PM, gdprao wrote:



I have used spring and Xfire combination to configure WSS4J for user
authentication with WSS4JInHandler.  I would like to know whether  
it is
supported in CXF.  Appreciate if someone could help me out on  
this.  My

current configuration is as follows:

property name=inHandlers
list
bean 
class=org.codehaus.xfire.util.dom.DOMInHandler /
bean

class=org.codehaus.xfire.security.wss4j.WSS4JInHandler
property name=properties
map
entry 
key=passwordCallbackRef
bean

class=com.mydomain.security.PasswordHandler
/bean
/entry
entry key=action 
value=UsernameToken /
/map
/property

/bean
bean

class=com.mydomain.security.ValidateUserTokenHandler /
/list
/property
--
View this message in context: http://www.nabble.com/WSS4J- 
implementation-in-CXF-tf4119426.html#a11715464

Sent from the cxf-user mailing list archive at Nabble.com.






Julio Arias
Java Developer
Roundbox Global : enterprise : technology : genius
-
Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica
tel: 404.567.5000 ext. 2001 | cell: 11.506.849.5981
email: [EMAIL PROTECTED] | www.rbxglobal.com
-



RE: Could not find destination factory for transport

2007-07-20 Thread Jiang, Ning (Willem)
I got what's you want. 

I filled a JIRA for it[1]. And You could watch it and try out the snapshots 
when I close the JIRA.

[1]https://issues.apache.org/jira/browse/CXF-821

Willem.

-Original Message-
From: Diego Xu [mailto:[EMAIL PROTECTED]
Sent: Fri 7/20/2007 18:38
To: cxf-user@incubator.apache.org
Subject: Re: Could not find destination factory for transport
 

Hi Willem:
Thanks alot for ur reply.
And definitly u r right. i have tried it out, and it turn's out work
fine.
you also make the trick more clear, i got that. thks again:)

while as u just mentioned: one can not  put both server and client in
one spring context... that make me come up with a senario that in some cases
we need an spring application be both the web service provider and consumer.
is your saying meant that there will be problem work this out?

well, this 'problem' is not proved by code anyway. but i realy
interested about it. 



Willem Jiang-2 wrote:
 
 Hi Diego,
 
 I just went through your mail, and found you put the server and client 
 in one spring application context.
 That is wrong. because they have different context.
 And I also found that the log should be Could not find conduit 
 initiator for ***
 
 There some transport URI conflict between servlet transport and the 
 standalone http transport.
 We just split them into cxf-extension-http-jetty.xml  and cxf-servlet.xml.
 And there is no http conduit  initiatior defined in the servlet 
 transport factory.
 
 And in your case , you just put the cxf-servlet.xml in you spring 
 application context, so the client http conduit Initiator will not be 
 found for the client.
 
 You need to create the client with another spring application context 
 file likes this:
 
 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xsi:schemaLocation=
   http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;

 import resource=classpath:META-INF/cxf/cxf.xml /
 import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
 import resource=classpath:META-INF/cxf/cxf-extension-http-jetty.xml
 /
 

 
 bean id=client class=com.net2com.webservice.HelloWorld 
   factory-bean=clientFactory factory-method=create/
  
 bean id=clientFactory
 class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
 property name=serviceClass
 value=com.net2com.webservice.HelloWorld/
 property name=address
 value=http://localhost:8080/interface/webservice/HelloWorld/
 /bean
 /beans
 
 Cheers,
 
 Willem.
 
 Diego Xu wrote:
 Hi:
   I'm using CXF2.0 release version for my first try of jax-ws, and now
 got
 blocked by an error throwed by server.
   I'm using JDK5.0, Tomcat5.5, Spring2.0.6.
   
   here is my HellowWorld interface:
 -
 package com.net2com.webservice;

 import javax.jws.WebService;

 @WebService
 public interface HelloWorld {
 String sayHi(String text);
 }

   and impl:
 
 package com.net2com.webservice;

 import javax.jws.WebService;

 @WebService(endpointInterface = com.net2com.webservice.HelloWorld)
 public class HelloWorldImpl implements HelloWorld {

 public String sayHi(String text) {
 return Hello  + text;
 }
 }


 Spring config: (I put both server and client into one application)
 ---

 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jaxws=http://cxf.apache.org/jaxws;
   xsi:schemaLocation=
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;

 import resource=classpath:META-INF/cxf/cxf.xml /
  import resource=classpath:META-INF/cxf/cxf-extension-soap.xml /
  import resource=classpath:META-INF/cxf/cxf-servlet.xml /
   ...
   jaxws:endpoint id=helloWorld 
  implementor=com.net2com.webservice.HelloWorldImpl 
  address=/HelloWorld /
  
   bean id=client class=com.net2com.webservice.HelloWorld 
   factory-bean=clientFactory factory-method=create/
 
  bean id=clientFactory
 class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
property name=serviceClass
 value=com.net2com.webservice.HelloWorld/
property name=address
 value=http://localhost:8080/interface/webservice/HelloWorld/
  /bean
 /beans

  tomcat web.xml
 
 web-app
 ...
  servlet
  servlet-nameCXFServlet/servlet-name
  

Re: Consfused newbie

2007-07-20 Thread Jeff.Yu

Hi, Mark

I think your service code is good, it could be something wrong in your 
client. I write some similiar code as yours, and I also write a client, 
it just works fine.


below is the client consumer code that I am writting:

   URL wsdlURL = new URL(http://localhost:8080/um/soapService?wsdl;);
   assertNotNull(wsdlURL);
   QName serviceName = new QName(http://biz.app.com/;, 
SoapServiceImplService);

   Service service = Service.create(wsdlURL, serviceName);
  
   SoapService client = service.getPort(SoapService.class);

   System.out.println(client.sayHi());
   assertEquals(Hi,client.sayHi());

can you test your service with this sort of client and to see what you 
can get.



Thanks
Jeff Yu


Mark Babcock wrote:

I have built the following tutorial with no issues:

 


http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

 

 


However, I added my own concrete class and interface and new endpoint in
the beans.xml

 


And I can visit the url and see a wsdl.  But every time I try to consume
it all my objects from what I just created are null.   Why?

 


- beans.xml ---

 


beans xmlns=http://www.springframework.org/schema/beans;

 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

 xmlns:jaxws=http://cxf.apache.org/jaxws;

 xsi:schemaLocation=

http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd

http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd;

 


import resource=classpath:META-INF/cxf/cxf.xml /

import
resource=classpath:META-INF/cxf/cxf-extension-soap.xml /

import resource=classpath:META-INF/cxf/cxf-servlet.xml /




jaxws:endpoint

  id=xscout

 
implementor=com.cid.xscout.service.XscoutWebServiceImpl


  address=/XscoutWebService /




jaxws:endpoint

  id=helloWorld

  implementor=com.cid.xscout.demo.HelloWorldImpl

  address=/HelloWorld /

  



/beans

 

 


--  interface 

 

 


package com.cid.xscout.service;

 

 


import com.cid.xscout.bean.Document;

import com.cid.xscout.bean.Taxonomy;

 


import javax.jws.WebMethod;

import javax.jws.WebService;

 


@WebService

public interface XscoutWebService {

 

  


  @WebMethod

  String a();

}

 

 


 concrete class 

package com.cid.xscout.service;

 


import javax.jws.WebService;

 


@WebService

public class XscoutWebServiceImpl implements XscoutWebService{

public String a() { return why;}

}

 



  


RE: Configuring a JSON endpoint via Spring

2007-07-20 Thread Jiang, Ning \(Willem\)

Hi 

From your fault message, I think you need add the below line in you spring 
application context. 
import resource=classpath:META-INF/cxf/cxf-extension-xml.xml/ 

Which include the cxf xformat binding for wiring the bus. 

Willem 




-Original Message-
From: Dale Peakall [mailto:[EMAIL PROTECTED]
Sent: Fri 7/20/2007 18:55
To: cxf-user@incubator.apache.org
Subject: Configuring a JSON endpoint via Spring
 
I've been trying to add a JSON endpoint to my service by updating the 
Spring configuration but with no success.   The REST based version works 
just fine, but the JSON version either: returns an empty-page for the 
Mapped version or returns:

{ns1:XMLFault:{@xmlns:{ns1:http:\/\/cxf.apache.org\/bindings\/xformat},ns1:faultstring:{@xmlns:{ns1:http:\/\/cxf.apache.org\/bindings\/xformat},$:java.lang.NullPointerException}}}

for the BadgerFish based version.  In neither case is the Content-Type 
header set.  Any ideas where I'm going wrong?

Here are the relevant excerpts from my spring configuration.

import resource=classpath:META-INF/cxf/cxf.xml/
import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/
import 
resource=classpath:META-INF/cxf/cxf-extension-http-binding.xml/
import resource=classpath:META-INF/cxf/cxf-servlet.xml/
   
jaxws:endpoint id=catalogRestWS
implementor=#catalogService
address=/xml/Catalog
bindingUri=http://apache.org/cxf/binding/http;
jaxws:serviceFactory
bean 
class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
property name=wrapped value=true/
/bean
/jaxws:serviceFactory
/jaxws:endpoint
   
jaxws:endpoint id=catalogJsonWS
implementor=#catalogService
address=/json/Catalog
bindingUri=http://apache.org/cxf/binding/http;
jaxws:serviceFactory
bean 
class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean
property name=wrapped value=false/
property name=properties
map
entry key=Content-Type value=text/plain/
entry

keyvaluejavax.xml.stream.XMLInputFactory/value/key
bean 
class=org.codehaus.jettison.mapped.MappedXMLInputFactory
constructor-arg
map
entry 
key=http://catalog.epv.oclc.org/; value=catalog/
entry 
key=http://impl.catalog.epv.oclc.org/; value=catalogimpl/
/map
/constructor-arg
/bean
/entry
entry

keyvaluejavax.xml.stream.XMLOutputFactory/value/key
bean 
class=org.codehaus.jettison.mapped.MappedXMLOutputFactory
constructor-arg
map
entry 
key=http://catalog.epv.oclc.org/; value=catalog/
entry 
key=http://impl.catalog.epv.oclc.org/; value=catalogimpl/
/map
/constructor-arg
/bean
/entry
!--
entry

keyvaluejavax.xml.stream.XMLInputFactory/value/key
bean 
class=org.codehaus.jettison.badgerfish.BadgerFishXMLInputFactory/
/entry
entry

keyvaluejavax.xml.stream.XMLOutputFactory/value/key
bean 
class=org.codehaus.jettison.badgerfish.BadgerFishXMLOutputFactory/
/entry
 --
/map
/property
/bean
/jaxws:serviceFactory
/jaxws:endpoint