You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christian Landbo Frederiksen <CL...@Ementor.dk> on 2008/12/15 15:57:19 UTC
Figuring out why params turn to null
I am using CXF 2.1
I expose a java class/method like this
@WebService(name="EchoService",
targetNamespace="http://echo.dk/2008/11/16")
public interface EchoService {
@WebMethod
public String echo(@WebParam(name = "hello") String hello)
This turns into this wsdl:
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="http://echo.dk/2008/11/16"
xmlns="http://echo.dk/2008/11/16"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="echo" type="echo"/>
<xs:complexType name="echo">
<xs:sequence>
<xs:element minOccurs="0" name="hello" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="echoResponse" type="echoResponse"/>
<xs:complexType name="echoResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Can successfully be called in SOAP-UI:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://optagelse.dk/2008/11/16">
<soapenv:Header/>
<soapenv:Body>
<ns:echo>
<hello>Champ</hello>
</ns:echo>
</soapenv:Body>
</soapenv:Envelope>
But another client generates this:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
<echo xmlns="http://optagelse.dk/2008/11/16">
<hello>Champ</hello>
</echo>
</soapenv:Body>
</soapenv:Envelope>
And this results in the param being null in the method
The problem is that the param only works when it is given without
namespace.
ns:hello gives the same result in the first example.
Is this not a bug? The schema in the wsdl has targetNamespace set so you
would assume that the client namespace on the param would work.
/Chr
RE: Figuring out why params turn to null
Posted by Christian Landbo Frederiksen <CL...@Ementor.dk>.
Upgrading to 2.1.3 did not help, I'm afraid.
Any other ideas are very welcome.
/Chr
-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: 5. januar 2009 20:17
To: users@cxf.apache.org
Cc: Christian Landbo Frederiksen
Subject: Re: Figuring out why params turn to null
On Friday 19 December 2008 9:11:40 am Christian Landbo Frederiksen wrote:
> Version 2.1
Update to 2.1.3. That MAY help.
Dan
>
> We don't use java2wsdl directly.
>
> We use Spring and the jaxws:endpoint tag
>
> /Chr
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 14:43
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> What version of CXF? What command-line args to java2wsdl?
>
> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
>
> <CL...@ementor.dk> wrote:
> > OK Thanks.
> >
> > So now I try change it to qualified, since I have a client (Delphi) that
> > cannot handle this.
> >
> > Searching for how to do this I saw the package-info.java thing.
> >
> > So I put a package-info.java file into the package of the service with
> > this content:
> >
> > @javax.xml.bind.annotation.XmlSchema(
> > namespace = "http://echo/2008/11/16",
> >
> > attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
> >
> > elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> > package dk.something;
> >
> >
> > But nothing happens to the generated WSDL it still has both set to
> > unqualified.
> >
> > Am I missing something or is there another way?
> >
> > /Chr
> >
> > -----Original Message-----
> > From: Daniel Kulp [mailto:dkulp@apache.org]
> > Sent: 15. december 2008 17:52
> > To: users@cxf.apache.org
> > Cc: Christian Landbo Frederiksen
> > Subject: Re: Figuring out why params turn to null
> >
> >
> > The schema has:
> >
> > <xs:schema attributeFormDefault="unqualified"
> > elementFormDefault="unqualified"
> >
> > Thus, the "hello" child element MUST be unqualified. That's per the
> > schema
> > rules. If it's sent qualified, then it doesn't match the schema.
> >
> > Dan
> >
> >
> >
> >
> > On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
> >
> > wrote:
> >> I am using CXF 2.1
> >>
> >>
> >>
> >> I expose a java class/method like this
> >>
> >>
> >>
> >> @WebService(name="EchoService",
> >> targetNamespace="http://echo.dk/2008/11/16")
> >>
> >> public interface EchoService {
> >>
> >>
> >>
> >> @WebMethod
> >>
> >> public String echo(@WebParam(name = "hello") String hello)
> >>
> >>
> >>
> >>
> >>
> >> This turns into this wsdl:
> >>
> >>
> >>
> >> <xs:schema attributeFormDefault="unqualified"
> >> elementFormDefault="unqualified"
> >> targetNamespace="http://echo.dk/2008/11/16"
> >> xmlns="http://echo.dk/2008/11/16"
> >> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> >>
> >> <xs:element name="echo" type="echo"/>
> >>
> >> <xs:complexType name="echo">
> >>
> >> <xs:sequence>
> >>
> >> <xs:element minOccurs="0" name="hello" type="xs:string"/>
> >>
> >> </xs:sequence>
> >>
> >> </xs:complexType>
> >>
> >> <xs:element name="echoResponse" type="echoResponse"/>
> >>
> >> <xs:complexType name="echoResponse">
> >>
> >> <xs:sequence>
> >>
> >> <xs:element minOccurs="0" name="return" type="xs:string"/>
> >>
> >> </xs:sequence>
> >>
> >> </xs:complexType>
> >>
> >> </xs:schema>
> >>
> >>
> >>
> >>
> >>
> >> Can successfully be called in SOAP-UI:
> >>
> >>
> >>
> >> <soapenv:Envelope
> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> >> xmlns:ns="http://optagelse.dk/2008/11/16">
> >>
> >> <soapenv:Header/>
> >>
> >> <soapenv:Body>
> >>
> >> <ns:echo>
> >>
> >> <hello>Champ</hello>
> >>
> >> </ns:echo>
> >>
> >> </soapenv:Body>
> >>
> >> </soapenv:Envelope>
> >>
> >>
> >>
> >> But another client generates this:
> >>
> >>
> >>
> >> <soapenv:Envelope
> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
> >>
> >> <soapenv:Header/>
> >>
> >> <soapenv:Body>
> >>
> >> <echo xmlns="http://optagelse.dk/2008/11/16">
> >>
> >> <hello>Champ</hello>
> >>
> >> </echo>
> >>
> >> </soapenv:Body>
> >>
> >> </soapenv:Envelope>
> >>
> >>
> >>
> >> And this results in the param being null in the method
> >>
> >>
> >>
> >> The problem is that the param only works when it is given without
> >> namespace.
> >>
> >> ns:hello gives the same result in the first example.
> >>
> >>
> >>
> >> Is this not a bug? The schema in the wsdl has targetNamespace set so
> >
> > you
> >
> >> would assume that the client namespace on the param would work.
> >>
> >>
> >>
> >> /Chr
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: Figuring out why params turn to null
Posted by Daniel Kulp <dk...@apache.org>.
On Friday 19 December 2008 9:11:40 am Christian Landbo Frederiksen wrote:
> Version 2.1
Update to 2.1.3. That MAY help.
Dan
>
> We don't use java2wsdl directly.
>
> We use Spring and the jaxws:endpoint tag
>
> /Chr
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 14:43
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> What version of CXF? What command-line args to java2wsdl?
>
> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
>
> <CL...@ementor.dk> wrote:
> > OK Thanks.
> >
> > So now I try change it to qualified, since I have a client (Delphi) that
> > cannot handle this.
> >
> > Searching for how to do this I saw the package-info.java thing.
> >
> > So I put a package-info.java file into the package of the service with
> > this content:
> >
> > @javax.xml.bind.annotation.XmlSchema(
> > namespace = "http://echo/2008/11/16",
> >
> > attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
> >
> > elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> > package dk.something;
> >
> >
> > But nothing happens to the generated WSDL it still has both set to
> > unqualified.
> >
> > Am I missing something or is there another way?
> >
> > /Chr
> >
> > -----Original Message-----
> > From: Daniel Kulp [mailto:dkulp@apache.org]
> > Sent: 15. december 2008 17:52
> > To: users@cxf.apache.org
> > Cc: Christian Landbo Frederiksen
> > Subject: Re: Figuring out why params turn to null
> >
> >
> > The schema has:
> >
> > <xs:schema attributeFormDefault="unqualified"
> > elementFormDefault="unqualified"
> >
> > Thus, the "hello" child element MUST be unqualified. That's per the
> > schema
> > rules. If it's sent qualified, then it doesn't match the schema.
> >
> > Dan
> >
> >
> >
> >
> > On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
> >
> > wrote:
> >> I am using CXF 2.1
> >>
> >>
> >>
> >> I expose a java class/method like this
> >>
> >>
> >>
> >> @WebService(name="EchoService",
> >> targetNamespace="http://echo.dk/2008/11/16")
> >>
> >> public interface EchoService {
> >>
> >>
> >>
> >> @WebMethod
> >>
> >> public String echo(@WebParam(name = "hello") String hello)
> >>
> >>
> >>
> >>
> >>
> >> This turns into this wsdl:
> >>
> >>
> >>
> >> <xs:schema attributeFormDefault="unqualified"
> >> elementFormDefault="unqualified"
> >> targetNamespace="http://echo.dk/2008/11/16"
> >> xmlns="http://echo.dk/2008/11/16"
> >> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> >>
> >> <xs:element name="echo" type="echo"/>
> >>
> >> <xs:complexType name="echo">
> >>
> >> <xs:sequence>
> >>
> >> <xs:element minOccurs="0" name="hello" type="xs:string"/>
> >>
> >> </xs:sequence>
> >>
> >> </xs:complexType>
> >>
> >> <xs:element name="echoResponse" type="echoResponse"/>
> >>
> >> <xs:complexType name="echoResponse">
> >>
> >> <xs:sequence>
> >>
> >> <xs:element minOccurs="0" name="return" type="xs:string"/>
> >>
> >> </xs:sequence>
> >>
> >> </xs:complexType>
> >>
> >> </xs:schema>
> >>
> >>
> >>
> >>
> >>
> >> Can successfully be called in SOAP-UI:
> >>
> >>
> >>
> >> <soapenv:Envelope
> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> >> xmlns:ns="http://optagelse.dk/2008/11/16">
> >>
> >> <soapenv:Header/>
> >>
> >> <soapenv:Body>
> >>
> >> <ns:echo>
> >>
> >> <hello>Champ</hello>
> >>
> >> </ns:echo>
> >>
> >> </soapenv:Body>
> >>
> >> </soapenv:Envelope>
> >>
> >>
> >>
> >> But another client generates this:
> >>
> >>
> >>
> >> <soapenv:Envelope
> >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
> >>
> >> <soapenv:Header/>
> >>
> >> <soapenv:Body>
> >>
> >> <echo xmlns="http://optagelse.dk/2008/11/16">
> >>
> >> <hello>Champ</hello>
> >>
> >> </echo>
> >>
> >> </soapenv:Body>
> >>
> >> </soapenv:Envelope>
> >>
> >>
> >>
> >> And this results in the param being null in the method
> >>
> >>
> >>
> >> The problem is that the param only works when it is given without
> >> namespace.
> >>
> >> ns:hello gives the same result in the first example.
> >>
> >>
> >>
> >> Is this not a bug? The schema in the wsdl has targetNamespace set so
> >
> > you
> >
> >> would assume that the client namespace on the param would work.
> >>
> >>
> >>
> >> /Chr
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: Figuring out why params turn to null
Posted by Benson Margulies <bi...@gmail.com>.
I'm over my head.
On Fri, Dec 19, 2008 at 10:04 AM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
>
>
> <jaxws:endpoint
> id="EchoService"
> implementor="dk.something.EchoServiceImpl"
> address="/EchoService">
> </jaxws:endpoint>
>
>
> The EchoService class:
>
> @WebService(name="EchoService", targetNamespace="http://echo/2008/11/16")
> public interface EchoService {
>
> @WebMethod
> public String echo(
> @WebParam(name = "hello") String hello) throws WebServiceException ;
>
> ...
>
> The EchoServiceImpl class:
>
>
> @WebService(endpointInterface = "dk.something.EchoService", serviceName = "EchoService", targetNamespace = "http://echo/2008/11/16")
> public class EchoServiceImpl implements EchoService {
>
> @Resource
> private WebServiceContext context;
>
> public String echo(String hello) throws WebServiceException {
>
> ....
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 15:53
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> Hmm. Can I see your spring endpoint configuration?
>
> On Fri, Dec 19, 2008 at 9:32 AM, Christian Landbo Frederiksen
> <CL...@ementor.dk> wrote:
>> Yes that is exactly the situation.
>>
>> And yes the package-info.class is right there next to the other classes.
>>
>> It is not mentioned anywhere in any spring xml file.
>>
>> /Chr
>>
>>
>> -----Original Message-----
>> From: Benson Margulies [mailto:bimargulies@gmail.com]
>> Sent: 19. december 2008 15:22
>> To: users@cxf.apache.org
>> Subject: Re: Figuring out why params turn to null
>>
>> So, the net is that you add the package-info.java, compile it, and the
>> wsdl from ?wsdl does not change? You're sure that the
>> package-info.class is sitting there with your other .class files?
>>
>> Dan, am I missing something? Is there a JAX-WS versus JAX-B issue here?
>>
>> On Fri, Dec 19, 2008 at 9:11 AM, Christian Landbo Frederiksen
>> <CL...@ementor.dk> wrote:
>>> Version 2.1
>>>
>>> We don't use java2wsdl directly.
>>>
>>> We use Spring and the jaxws:endpoint tag
>>>
>>> /Chr
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Benson Margulies [mailto:bimargulies@gmail.com]
>>> Sent: 19. december 2008 14:43
>>> To: users@cxf.apache.org
>>> Subject: Re: Figuring out why params turn to null
>>>
>>> What version of CXF? What command-line args to java2wsdl?
>>>
>>> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
>>> <CL...@ementor.dk> wrote:
>>>> OK Thanks.
>>>>
>>>> So now I try change it to qualified, since I have a client (Delphi) that
>>>> cannot handle this.
>>>>
>>>> Searching for how to do this I saw the package-info.java thing.
>>>>
>>>> So I put a package-info.java file into the package of the service with
>>>> this content:
>>>>
>>>> @javax.xml.bind.annotation.XmlSchema(
>>>> namespace = "http://echo/2008/11/16",
>>>>
>>>> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>>>>
>>>> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>>>> package dk.something;
>>>>
>>>>
>>>> But nothing happens to the generated WSDL it still has both set to
>>>> unqualified.
>>>>
>>>> Am I missing something or is there another way?
>>>>
>>>> /Chr
>>>>
>>>> -----Original Message-----
>>>> From: Daniel Kulp [mailto:dkulp@apache.org]
>>>> Sent: 15. december 2008 17:52
>>>> To: users@cxf.apache.org
>>>> Cc: Christian Landbo Frederiksen
>>>> Subject: Re: Figuring out why params turn to null
>>>>
>>>>
>>>> The schema has:
>>>>
>>>> <xs:schema attributeFormDefault="unqualified"
>>>> elementFormDefault="unqualified"
>>>>
>>>> Thus, the "hello" child element MUST be unqualified. That's per the
>>>> schema
>>>> rules. If it's sent qualified, then it doesn't match the schema.
>>>>
>>>> Dan
>>>>
>>>>
>>>>
>>>>
>>>> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
>>>> wrote:
>>>>> I am using CXF 2.1
>>>>>
>>>>>
>>>>>
>>>>> I expose a java class/method like this
>>>>>
>>>>>
>>>>>
>>>>> @WebService(name="EchoService",
>>>>> targetNamespace="http://echo.dk/2008/11/16")
>>>>>
>>>>> public interface EchoService {
>>>>>
>>>>>
>>>>>
>>>>> @WebMethod
>>>>>
>>>>> public String echo(@WebParam(name = "hello") String hello)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> This turns into this wsdl:
>>>>>
>>>>>
>>>>>
>>>>> <xs:schema attributeFormDefault="unqualified"
>>>>> elementFormDefault="unqualified"
>>>>> targetNamespace="http://echo.dk/2008/11/16"
>>>>> xmlns="http://echo.dk/2008/11/16"
>>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>>>
>>>>> <xs:element name="echo" type="echo"/>
>>>>>
>>>>> <xs:complexType name="echo">
>>>>>
>>>>> <xs:sequence>
>>>>>
>>>>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>>>>
>>>>> </xs:sequence>
>>>>>
>>>>> </xs:complexType>
>>>>>
>>>>> <xs:element name="echoResponse" type="echoResponse"/>
>>>>>
>>>>> <xs:complexType name="echoResponse">
>>>>>
>>>>> <xs:sequence>
>>>>>
>>>>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>>>>
>>>>> </xs:sequence>
>>>>>
>>>>> </xs:complexType>
>>>>>
>>>>> </xs:schema>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Can successfully be called in SOAP-UI:
>>>>>
>>>>>
>>>>>
>>>>> <soapenv:Envelope
>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>>>>
>>>>> <soapenv:Header/>
>>>>>
>>>>> <soapenv:Body>
>>>>>
>>>>> <ns:echo>
>>>>>
>>>>> <hello>Champ</hello>
>>>>>
>>>>> </ns:echo>
>>>>>
>>>>> </soapenv:Body>
>>>>>
>>>>> </soapenv:Envelope>
>>>>>
>>>>>
>>>>>
>>>>> But another client generates this:
>>>>>
>>>>>
>>>>>
>>>>> <soapenv:Envelope
>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>>>>
>>>>> <soapenv:Header/>
>>>>>
>>>>> <soapenv:Body>
>>>>>
>>>>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>>>>
>>>>> <hello>Champ</hello>
>>>>>
>>>>> </echo>
>>>>>
>>>>> </soapenv:Body>
>>>>>
>>>>> </soapenv:Envelope>
>>>>>
>>>>>
>>>>>
>>>>> And this results in the param being null in the method
>>>>>
>>>>>
>>>>>
>>>>> The problem is that the param only works when it is given without
>>>>> namespace.
>>>>>
>>>>> ns:hello gives the same result in the first example.
>>>>>
>>>>>
>>>>>
>>>>> Is this not a bug? The schema in the wsdl has targetNamespace set so
>>>> you
>>>>> would assume that the client namespace on the param would work.
>>>>>
>>>>>
>>>>>
>>>>> /Chr
>>>>
>>>>
>>>>
>>>> --
>>>> Daniel Kulp
>>>> dkulp@apache.org
>>>> http://dankulp.com/blog
>>>>
>>>
>>
>
RE: Figuring out why params turn to null
Posted by Christian Landbo Frederiksen <CL...@Ementor.dk>.
<jaxws:endpoint
id="EchoService"
implementor="dk.something.EchoServiceImpl"
address="/EchoService">
</jaxws:endpoint>
The EchoService class:
@WebService(name="EchoService", targetNamespace="http://echo/2008/11/16")
public interface EchoService {
@WebMethod
public String echo(
@WebParam(name = "hello") String hello) throws WebServiceException ;
...
The EchoServiceImpl class:
@WebService(endpointInterface = "dk.something.EchoService", serviceName = "EchoService", targetNamespace = "http://echo/2008/11/16")
public class EchoServiceImpl implements EchoService {
@Resource
private WebServiceContext context;
public String echo(String hello) throws WebServiceException {
....
-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com]
Sent: 19. december 2008 15:53
To: users@cxf.apache.org
Subject: Re: Figuring out why params turn to null
Hmm. Can I see your spring endpoint configuration?
On Fri, Dec 19, 2008 at 9:32 AM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
> Yes that is exactly the situation.
>
> And yes the package-info.class is right there next to the other classes.
>
> It is not mentioned anywhere in any spring xml file.
>
> /Chr
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 15:22
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> So, the net is that you add the package-info.java, compile it, and the
> wsdl from ?wsdl does not change? You're sure that the
> package-info.class is sitting there with your other .class files?
>
> Dan, am I missing something? Is there a JAX-WS versus JAX-B issue here?
>
> On Fri, Dec 19, 2008 at 9:11 AM, Christian Landbo Frederiksen
> <CL...@ementor.dk> wrote:
>> Version 2.1
>>
>> We don't use java2wsdl directly.
>>
>> We use Spring and the jaxws:endpoint tag
>>
>> /Chr
>>
>>
>>
>> -----Original Message-----
>> From: Benson Margulies [mailto:bimargulies@gmail.com]
>> Sent: 19. december 2008 14:43
>> To: users@cxf.apache.org
>> Subject: Re: Figuring out why params turn to null
>>
>> What version of CXF? What command-line args to java2wsdl?
>>
>> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
>> <CL...@ementor.dk> wrote:
>>> OK Thanks.
>>>
>>> So now I try change it to qualified, since I have a client (Delphi) that
>>> cannot handle this.
>>>
>>> Searching for how to do this I saw the package-info.java thing.
>>>
>>> So I put a package-info.java file into the package of the service with
>>> this content:
>>>
>>> @javax.xml.bind.annotation.XmlSchema(
>>> namespace = "http://echo/2008/11/16",
>>>
>>> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>>>
>>> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>>> package dk.something;
>>>
>>>
>>> But nothing happens to the generated WSDL it still has both set to
>>> unqualified.
>>>
>>> Am I missing something or is there another way?
>>>
>>> /Chr
>>>
>>> -----Original Message-----
>>> From: Daniel Kulp [mailto:dkulp@apache.org]
>>> Sent: 15. december 2008 17:52
>>> To: users@cxf.apache.org
>>> Cc: Christian Landbo Frederiksen
>>> Subject: Re: Figuring out why params turn to null
>>>
>>>
>>> The schema has:
>>>
>>> <xs:schema attributeFormDefault="unqualified"
>>> elementFormDefault="unqualified"
>>>
>>> Thus, the "hello" child element MUST be unqualified. That's per the
>>> schema
>>> rules. If it's sent qualified, then it doesn't match the schema.
>>>
>>> Dan
>>>
>>>
>>>
>>>
>>> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
>>> wrote:
>>>> I am using CXF 2.1
>>>>
>>>>
>>>>
>>>> I expose a java class/method like this
>>>>
>>>>
>>>>
>>>> @WebService(name="EchoService",
>>>> targetNamespace="http://echo.dk/2008/11/16")
>>>>
>>>> public interface EchoService {
>>>>
>>>>
>>>>
>>>> @WebMethod
>>>>
>>>> public String echo(@WebParam(name = "hello") String hello)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> This turns into this wsdl:
>>>>
>>>>
>>>>
>>>> <xs:schema attributeFormDefault="unqualified"
>>>> elementFormDefault="unqualified"
>>>> targetNamespace="http://echo.dk/2008/11/16"
>>>> xmlns="http://echo.dk/2008/11/16"
>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>>
>>>> <xs:element name="echo" type="echo"/>
>>>>
>>>> <xs:complexType name="echo">
>>>>
>>>> <xs:sequence>
>>>>
>>>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>>>
>>>> </xs:sequence>
>>>>
>>>> </xs:complexType>
>>>>
>>>> <xs:element name="echoResponse" type="echoResponse"/>
>>>>
>>>> <xs:complexType name="echoResponse">
>>>>
>>>> <xs:sequence>
>>>>
>>>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>>>
>>>> </xs:sequence>
>>>>
>>>> </xs:complexType>
>>>>
>>>> </xs:schema>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Can successfully be called in SOAP-UI:
>>>>
>>>>
>>>>
>>>> <soapenv:Envelope
>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>>>
>>>> <soapenv:Header/>
>>>>
>>>> <soapenv:Body>
>>>>
>>>> <ns:echo>
>>>>
>>>> <hello>Champ</hello>
>>>>
>>>> </ns:echo>
>>>>
>>>> </soapenv:Body>
>>>>
>>>> </soapenv:Envelope>
>>>>
>>>>
>>>>
>>>> But another client generates this:
>>>>
>>>>
>>>>
>>>> <soapenv:Envelope
>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>>>
>>>> <soapenv:Header/>
>>>>
>>>> <soapenv:Body>
>>>>
>>>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>>>
>>>> <hello>Champ</hello>
>>>>
>>>> </echo>
>>>>
>>>> </soapenv:Body>
>>>>
>>>> </soapenv:Envelope>
>>>>
>>>>
>>>>
>>>> And this results in the param being null in the method
>>>>
>>>>
>>>>
>>>> The problem is that the param only works when it is given without
>>>> namespace.
>>>>
>>>> ns:hello gives the same result in the first example.
>>>>
>>>>
>>>>
>>>> Is this not a bug? The schema in the wsdl has targetNamespace set so
>>> you
>>>> would assume that the client namespace on the param would work.
>>>>
>>>>
>>>>
>>>> /Chr
>>>
>>>
>>>
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://dankulp.com/blog
>>>
>>
>
Re: Figuring out why params turn to null
Posted by Benson Margulies <bi...@gmail.com>.
Hmm. Can I see your spring endpoint configuration?
On Fri, Dec 19, 2008 at 9:32 AM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
> Yes that is exactly the situation.
>
> And yes the package-info.class is right there next to the other classes.
>
> It is not mentioned anywhere in any spring xml file.
>
> /Chr
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 15:22
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> So, the net is that you add the package-info.java, compile it, and the
> wsdl from ?wsdl does not change? You're sure that the
> package-info.class is sitting there with your other .class files?
>
> Dan, am I missing something? Is there a JAX-WS versus JAX-B issue here?
>
> On Fri, Dec 19, 2008 at 9:11 AM, Christian Landbo Frederiksen
> <CL...@ementor.dk> wrote:
>> Version 2.1
>>
>> We don't use java2wsdl directly.
>>
>> We use Spring and the jaxws:endpoint tag
>>
>> /Chr
>>
>>
>>
>> -----Original Message-----
>> From: Benson Margulies [mailto:bimargulies@gmail.com]
>> Sent: 19. december 2008 14:43
>> To: users@cxf.apache.org
>> Subject: Re: Figuring out why params turn to null
>>
>> What version of CXF? What command-line args to java2wsdl?
>>
>> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
>> <CL...@ementor.dk> wrote:
>>> OK Thanks.
>>>
>>> So now I try change it to qualified, since I have a client (Delphi) that
>>> cannot handle this.
>>>
>>> Searching for how to do this I saw the package-info.java thing.
>>>
>>> So I put a package-info.java file into the package of the service with
>>> this content:
>>>
>>> @javax.xml.bind.annotation.XmlSchema(
>>> namespace = "http://echo/2008/11/16",
>>>
>>> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>>>
>>> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>>> package dk.something;
>>>
>>>
>>> But nothing happens to the generated WSDL it still has both set to
>>> unqualified.
>>>
>>> Am I missing something or is there another way?
>>>
>>> /Chr
>>>
>>> -----Original Message-----
>>> From: Daniel Kulp [mailto:dkulp@apache.org]
>>> Sent: 15. december 2008 17:52
>>> To: users@cxf.apache.org
>>> Cc: Christian Landbo Frederiksen
>>> Subject: Re: Figuring out why params turn to null
>>>
>>>
>>> The schema has:
>>>
>>> <xs:schema attributeFormDefault="unqualified"
>>> elementFormDefault="unqualified"
>>>
>>> Thus, the "hello" child element MUST be unqualified. That's per the
>>> schema
>>> rules. If it's sent qualified, then it doesn't match the schema.
>>>
>>> Dan
>>>
>>>
>>>
>>>
>>> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
>>> wrote:
>>>> I am using CXF 2.1
>>>>
>>>>
>>>>
>>>> I expose a java class/method like this
>>>>
>>>>
>>>>
>>>> @WebService(name="EchoService",
>>>> targetNamespace="http://echo.dk/2008/11/16")
>>>>
>>>> public interface EchoService {
>>>>
>>>>
>>>>
>>>> @WebMethod
>>>>
>>>> public String echo(@WebParam(name = "hello") String hello)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> This turns into this wsdl:
>>>>
>>>>
>>>>
>>>> <xs:schema attributeFormDefault="unqualified"
>>>> elementFormDefault="unqualified"
>>>> targetNamespace="http://echo.dk/2008/11/16"
>>>> xmlns="http://echo.dk/2008/11/16"
>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>>
>>>> <xs:element name="echo" type="echo"/>
>>>>
>>>> <xs:complexType name="echo">
>>>>
>>>> <xs:sequence>
>>>>
>>>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>>>
>>>> </xs:sequence>
>>>>
>>>> </xs:complexType>
>>>>
>>>> <xs:element name="echoResponse" type="echoResponse"/>
>>>>
>>>> <xs:complexType name="echoResponse">
>>>>
>>>> <xs:sequence>
>>>>
>>>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>>>
>>>> </xs:sequence>
>>>>
>>>> </xs:complexType>
>>>>
>>>> </xs:schema>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Can successfully be called in SOAP-UI:
>>>>
>>>>
>>>>
>>>> <soapenv:Envelope
>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>>>
>>>> <soapenv:Header/>
>>>>
>>>> <soapenv:Body>
>>>>
>>>> <ns:echo>
>>>>
>>>> <hello>Champ</hello>
>>>>
>>>> </ns:echo>
>>>>
>>>> </soapenv:Body>
>>>>
>>>> </soapenv:Envelope>
>>>>
>>>>
>>>>
>>>> But another client generates this:
>>>>
>>>>
>>>>
>>>> <soapenv:Envelope
>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>>>
>>>> <soapenv:Header/>
>>>>
>>>> <soapenv:Body>
>>>>
>>>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>>>
>>>> <hello>Champ</hello>
>>>>
>>>> </echo>
>>>>
>>>> </soapenv:Body>
>>>>
>>>> </soapenv:Envelope>
>>>>
>>>>
>>>>
>>>> And this results in the param being null in the method
>>>>
>>>>
>>>>
>>>> The problem is that the param only works when it is given without
>>>> namespace.
>>>>
>>>> ns:hello gives the same result in the first example.
>>>>
>>>>
>>>>
>>>> Is this not a bug? The schema in the wsdl has targetNamespace set so
>>> you
>>>> would assume that the client namespace on the param would work.
>>>>
>>>>
>>>>
>>>> /Chr
>>>
>>>
>>>
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://dankulp.com/blog
>>>
>>
>
RE: Figuring out why params turn to null
Posted by Christian Landbo Frederiksen <CL...@Ementor.dk>.
Yes that is exactly the situation.
And yes the package-info.class is right there next to the other classes.
It is not mentioned anywhere in any spring xml file.
/Chr
-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com]
Sent: 19. december 2008 15:22
To: users@cxf.apache.org
Subject: Re: Figuring out why params turn to null
So, the net is that you add the package-info.java, compile it, and the
wsdl from ?wsdl does not change? You're sure that the
package-info.class is sitting there with your other .class files?
Dan, am I missing something? Is there a JAX-WS versus JAX-B issue here?
On Fri, Dec 19, 2008 at 9:11 AM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
> Version 2.1
>
> We don't use java2wsdl directly.
>
> We use Spring and the jaxws:endpoint tag
>
> /Chr
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 14:43
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> What version of CXF? What command-line args to java2wsdl?
>
> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
> <CL...@ementor.dk> wrote:
>> OK Thanks.
>>
>> So now I try change it to qualified, since I have a client (Delphi) that
>> cannot handle this.
>>
>> Searching for how to do this I saw the package-info.java thing.
>>
>> So I put a package-info.java file into the package of the service with
>> this content:
>>
>> @javax.xml.bind.annotation.XmlSchema(
>> namespace = "http://echo/2008/11/16",
>>
>> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>>
>> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>> package dk.something;
>>
>>
>> But nothing happens to the generated WSDL it still has both set to
>> unqualified.
>>
>> Am I missing something or is there another way?
>>
>> /Chr
>>
>> -----Original Message-----
>> From: Daniel Kulp [mailto:dkulp@apache.org]
>> Sent: 15. december 2008 17:52
>> To: users@cxf.apache.org
>> Cc: Christian Landbo Frederiksen
>> Subject: Re: Figuring out why params turn to null
>>
>>
>> The schema has:
>>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="unqualified"
>>
>> Thus, the "hello" child element MUST be unqualified. That's per the
>> schema
>> rules. If it's sent qualified, then it doesn't match the schema.
>>
>> Dan
>>
>>
>>
>>
>> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
>> wrote:
>>> I am using CXF 2.1
>>>
>>>
>>>
>>> I expose a java class/method like this
>>>
>>>
>>>
>>> @WebService(name="EchoService",
>>> targetNamespace="http://echo.dk/2008/11/16")
>>>
>>> public interface EchoService {
>>>
>>>
>>>
>>> @WebMethod
>>>
>>> public String echo(@WebParam(name = "hello") String hello)
>>>
>>>
>>>
>>>
>>>
>>> This turns into this wsdl:
>>>
>>>
>>>
>>> <xs:schema attributeFormDefault="unqualified"
>>> elementFormDefault="unqualified"
>>> targetNamespace="http://echo.dk/2008/11/16"
>>> xmlns="http://echo.dk/2008/11/16"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>
>>> <xs:element name="echo" type="echo"/>
>>>
>>> <xs:complexType name="echo">
>>>
>>> <xs:sequence>
>>>
>>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>>
>>> </xs:sequence>
>>>
>>> </xs:complexType>
>>>
>>> <xs:element name="echoResponse" type="echoResponse"/>
>>>
>>> <xs:complexType name="echoResponse">
>>>
>>> <xs:sequence>
>>>
>>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>>
>>> </xs:sequence>
>>>
>>> </xs:complexType>
>>>
>>> </xs:schema>
>>>
>>>
>>>
>>>
>>>
>>> Can successfully be called in SOAP-UI:
>>>
>>>
>>>
>>> <soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>>
>>> <soapenv:Header/>
>>>
>>> <soapenv:Body>
>>>
>>> <ns:echo>
>>>
>>> <hello>Champ</hello>
>>>
>>> </ns:echo>
>>>
>>> </soapenv:Body>
>>>
>>> </soapenv:Envelope>
>>>
>>>
>>>
>>> But another client generates this:
>>>
>>>
>>>
>>> <soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>>
>>> <soapenv:Header/>
>>>
>>> <soapenv:Body>
>>>
>>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>>
>>> <hello>Champ</hello>
>>>
>>> </echo>
>>>
>>> </soapenv:Body>
>>>
>>> </soapenv:Envelope>
>>>
>>>
>>>
>>> And this results in the param being null in the method
>>>
>>>
>>>
>>> The problem is that the param only works when it is given without
>>> namespace.
>>>
>>> ns:hello gives the same result in the first example.
>>>
>>>
>>>
>>> Is this not a bug? The schema in the wsdl has targetNamespace set so
>> you
>>> would assume that the client namespace on the param would work.
>>>
>>>
>>>
>>> /Chr
>>
>>
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://dankulp.com/blog
>>
>
Re: Figuring out why params turn to null
Posted by Benson Margulies <bi...@gmail.com>.
So, the net is that you add the package-info.java, compile it, and the
wsdl from ?wsdl does not change? You're sure that the
package-info.class is sitting there with your other .class files?
Dan, am I missing something? Is there a JAX-WS versus JAX-B issue here?
On Fri, Dec 19, 2008 at 9:11 AM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
> Version 2.1
>
> We don't use java2wsdl directly.
>
> We use Spring and the jaxws:endpoint tag
>
> /Chr
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 19. december 2008 14:43
> To: users@cxf.apache.org
> Subject: Re: Figuring out why params turn to null
>
> What version of CXF? What command-line args to java2wsdl?
>
> On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
> <CL...@ementor.dk> wrote:
>> OK Thanks.
>>
>> So now I try change it to qualified, since I have a client (Delphi) that
>> cannot handle this.
>>
>> Searching for how to do this I saw the package-info.java thing.
>>
>> So I put a package-info.java file into the package of the service with
>> this content:
>>
>> @javax.xml.bind.annotation.XmlSchema(
>> namespace = "http://echo/2008/11/16",
>>
>> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>>
>> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
>> package dk.something;
>>
>>
>> But nothing happens to the generated WSDL it still has both set to
>> unqualified.
>>
>> Am I missing something or is there another way?
>>
>> /Chr
>>
>> -----Original Message-----
>> From: Daniel Kulp [mailto:dkulp@apache.org]
>> Sent: 15. december 2008 17:52
>> To: users@cxf.apache.org
>> Cc: Christian Landbo Frederiksen
>> Subject: Re: Figuring out why params turn to null
>>
>>
>> The schema has:
>>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="unqualified"
>>
>> Thus, the "hello" child element MUST be unqualified. That's per the
>> schema
>> rules. If it's sent qualified, then it doesn't match the schema.
>>
>> Dan
>>
>>
>>
>>
>> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
>> wrote:
>>> I am using CXF 2.1
>>>
>>>
>>>
>>> I expose a java class/method like this
>>>
>>>
>>>
>>> @WebService(name="EchoService",
>>> targetNamespace="http://echo.dk/2008/11/16")
>>>
>>> public interface EchoService {
>>>
>>>
>>>
>>> @WebMethod
>>>
>>> public String echo(@WebParam(name = "hello") String hello)
>>>
>>>
>>>
>>>
>>>
>>> This turns into this wsdl:
>>>
>>>
>>>
>>> <xs:schema attributeFormDefault="unqualified"
>>> elementFormDefault="unqualified"
>>> targetNamespace="http://echo.dk/2008/11/16"
>>> xmlns="http://echo.dk/2008/11/16"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>
>>> <xs:element name="echo" type="echo"/>
>>>
>>> <xs:complexType name="echo">
>>>
>>> <xs:sequence>
>>>
>>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>>
>>> </xs:sequence>
>>>
>>> </xs:complexType>
>>>
>>> <xs:element name="echoResponse" type="echoResponse"/>
>>>
>>> <xs:complexType name="echoResponse">
>>>
>>> <xs:sequence>
>>>
>>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>>
>>> </xs:sequence>
>>>
>>> </xs:complexType>
>>>
>>> </xs:schema>
>>>
>>>
>>>
>>>
>>>
>>> Can successfully be called in SOAP-UI:
>>>
>>>
>>>
>>> <soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>>
>>> <soapenv:Header/>
>>>
>>> <soapenv:Body>
>>>
>>> <ns:echo>
>>>
>>> <hello>Champ</hello>
>>>
>>> </ns:echo>
>>>
>>> </soapenv:Body>
>>>
>>> </soapenv:Envelope>
>>>
>>>
>>>
>>> But another client generates this:
>>>
>>>
>>>
>>> <soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>>
>>> <soapenv:Header/>
>>>
>>> <soapenv:Body>
>>>
>>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>>
>>> <hello>Champ</hello>
>>>
>>> </echo>
>>>
>>> </soapenv:Body>
>>>
>>> </soapenv:Envelope>
>>>
>>>
>>>
>>> And this results in the param being null in the method
>>>
>>>
>>>
>>> The problem is that the param only works when it is given without
>>> namespace.
>>>
>>> ns:hello gives the same result in the first example.
>>>
>>>
>>>
>>> Is this not a bug? The schema in the wsdl has targetNamespace set so
>> you
>>> would assume that the client namespace on the param would work.
>>>
>>>
>>>
>>> /Chr
>>
>>
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://dankulp.com/blog
>>
>
RE: Figuring out why params turn to null
Posted by Christian Landbo Frederiksen <CL...@Ementor.dk>.
Version 2.1
We don't use java2wsdl directly.
We use Spring and the jaxws:endpoint tag
/Chr
-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com]
Sent: 19. december 2008 14:43
To: users@cxf.apache.org
Subject: Re: Figuring out why params turn to null
What version of CXF? What command-line args to java2wsdl?
On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
> OK Thanks.
>
> So now I try change it to qualified, since I have a client (Delphi) that
> cannot handle this.
>
> Searching for how to do this I saw the package-info.java thing.
>
> So I put a package-info.java file into the package of the service with
> this content:
>
> @javax.xml.bind.annotation.XmlSchema(
> namespace = "http://echo/2008/11/16",
>
> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>
> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> package dk.something;
>
>
> But nothing happens to the generated WSDL it still has both set to
> unqualified.
>
> Am I missing something or is there another way?
>
> /Chr
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 15. december 2008 17:52
> To: users@cxf.apache.org
> Cc: Christian Landbo Frederiksen
> Subject: Re: Figuring out why params turn to null
>
>
> The schema has:
>
> <xs:schema attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
>
> Thus, the "hello" child element MUST be unqualified. That's per the
> schema
> rules. If it's sent qualified, then it doesn't match the schema.
>
> Dan
>
>
>
>
> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
> wrote:
>> I am using CXF 2.1
>>
>>
>>
>> I expose a java class/method like this
>>
>>
>>
>> @WebService(name="EchoService",
>> targetNamespace="http://echo.dk/2008/11/16")
>>
>> public interface EchoService {
>>
>>
>>
>> @WebMethod
>>
>> public String echo(@WebParam(name = "hello") String hello)
>>
>>
>>
>>
>>
>> This turns into this wsdl:
>>
>>
>>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="unqualified"
>> targetNamespace="http://echo.dk/2008/11/16"
>> xmlns="http://echo.dk/2008/11/16"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>
>> <xs:element name="echo" type="echo"/>
>>
>> <xs:complexType name="echo">
>>
>> <xs:sequence>
>>
>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>
>> </xs:sequence>
>>
>> </xs:complexType>
>>
>> <xs:element name="echoResponse" type="echoResponse"/>
>>
>> <xs:complexType name="echoResponse">
>>
>> <xs:sequence>
>>
>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>
>> </xs:sequence>
>>
>> </xs:complexType>
>>
>> </xs:schema>
>>
>>
>>
>>
>>
>> Can successfully be called in SOAP-UI:
>>
>>
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>
>> <soapenv:Header/>
>>
>> <soapenv:Body>
>>
>> <ns:echo>
>>
>> <hello>Champ</hello>
>>
>> </ns:echo>
>>
>> </soapenv:Body>
>>
>> </soapenv:Envelope>
>>
>>
>>
>> But another client generates this:
>>
>>
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>
>> <soapenv:Header/>
>>
>> <soapenv:Body>
>>
>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>
>> <hello>Champ</hello>
>>
>> </echo>
>>
>> </soapenv:Body>
>>
>> </soapenv:Envelope>
>>
>>
>>
>> And this results in the param being null in the method
>>
>>
>>
>> The problem is that the param only works when it is given without
>> namespace.
>>
>> ns:hello gives the same result in the first example.
>>
>>
>>
>> Is this not a bug? The schema in the wsdl has targetNamespace set so
> you
>> would assume that the client namespace on the param would work.
>>
>>
>>
>> /Chr
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>
Re: Figuring out why params turn to null
Posted by Benson Margulies <bi...@gmail.com>.
What version of CXF? What command-line args to java2wsdl?
On Thu, Dec 18, 2008 at 5:41 PM, Christian Landbo Frederiksen
<CL...@ementor.dk> wrote:
> OK Thanks.
>
> So now I try change it to qualified, since I have a client (Delphi) that
> cannot handle this.
>
> Searching for how to do this I saw the package-info.java thing.
>
> So I put a package-info.java file into the package of the service with
> this content:
>
> @javax.xml.bind.annotation.XmlSchema(
> namespace = "http://echo/2008/11/16",
>
> attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
>
> elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
> package dk.something;
>
>
> But nothing happens to the generated WSDL it still has both set to
> unqualified.
>
> Am I missing something or is there another way?
>
> /Chr
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 15. december 2008 17:52
> To: users@cxf.apache.org
> Cc: Christian Landbo Frederiksen
> Subject: Re: Figuring out why params turn to null
>
>
> The schema has:
>
> <xs:schema attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
>
> Thus, the "hello" child element MUST be unqualified. That's per the
> schema
> rules. If it's sent qualified, then it doesn't match the schema.
>
> Dan
>
>
>
>
> On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
> wrote:
>> I am using CXF 2.1
>>
>>
>>
>> I expose a java class/method like this
>>
>>
>>
>> @WebService(name="EchoService",
>> targetNamespace="http://echo.dk/2008/11/16")
>>
>> public interface EchoService {
>>
>>
>>
>> @WebMethod
>>
>> public String echo(@WebParam(name = "hello") String hello)
>>
>>
>>
>>
>>
>> This turns into this wsdl:
>>
>>
>>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="unqualified"
>> targetNamespace="http://echo.dk/2008/11/16"
>> xmlns="http://echo.dk/2008/11/16"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>
>> <xs:element name="echo" type="echo"/>
>>
>> <xs:complexType name="echo">
>>
>> <xs:sequence>
>>
>> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>>
>> </xs:sequence>
>>
>> </xs:complexType>
>>
>> <xs:element name="echoResponse" type="echoResponse"/>
>>
>> <xs:complexType name="echoResponse">
>>
>> <xs:sequence>
>>
>> <xs:element minOccurs="0" name="return" type="xs:string"/>
>>
>> </xs:sequence>
>>
>> </xs:complexType>
>>
>> </xs:schema>
>>
>>
>>
>>
>>
>> Can successfully be called in SOAP-UI:
>>
>>
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:ns="http://optagelse.dk/2008/11/16">
>>
>> <soapenv:Header/>
>>
>> <soapenv:Body>
>>
>> <ns:echo>
>>
>> <hello>Champ</hello>
>>
>> </ns:echo>
>>
>> </soapenv:Body>
>>
>> </soapenv:Envelope>
>>
>>
>>
>> But another client generates this:
>>
>>
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>>
>> <soapenv:Header/>
>>
>> <soapenv:Body>
>>
>> <echo xmlns="http://optagelse.dk/2008/11/16">
>>
>> <hello>Champ</hello>
>>
>> </echo>
>>
>> </soapenv:Body>
>>
>> </soapenv:Envelope>
>>
>>
>>
>> And this results in the param being null in the method
>>
>>
>>
>> The problem is that the param only works when it is given without
>> namespace.
>>
>> ns:hello gives the same result in the first example.
>>
>>
>>
>> Is this not a bug? The schema in the wsdl has targetNamespace set so
> you
>> would assume that the client namespace on the param would work.
>>
>>
>>
>> /Chr
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>
RE: Figuring out why params turn to null
Posted by Christian Landbo Frederiksen <CL...@Ementor.dk>.
OK Thanks.
So now I try change it to qualified, since I have a client (Delphi) that
cannot handle this.
Searching for how to do this I saw the package-info.java thing.
So I put a package-info.java file into the package of the service with
this content:
@javax.xml.bind.annotation.XmlSchema(
namespace = "http://echo/2008/11/16",
attributeFormDefault=javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package dk.something;
But nothing happens to the generated WSDL it still has both set to
unqualified.
Am I missing something or is there another way?
/Chr
-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: 15. december 2008 17:52
To: users@cxf.apache.org
Cc: Christian Landbo Frederiksen
Subject: Re: Figuring out why params turn to null
The schema has:
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
Thus, the "hello" child element MUST be unqualified. That's per the
schema
rules. If it's sent qualified, then it doesn't match the schema.
Dan
On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen
wrote:
> I am using CXF 2.1
>
>
>
> I expose a java class/method like this
>
>
>
> @WebService(name="EchoService",
> targetNamespace="http://echo.dk/2008/11/16")
>
> public interface EchoService {
>
>
>
> @WebMethod
>
> public String echo(@WebParam(name = "hello") String hello)
>
>
>
>
>
> This turns into this wsdl:
>
>
>
> <xs:schema attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
> targetNamespace="http://echo.dk/2008/11/16"
> xmlns="http://echo.dk/2008/11/16"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
> <xs:element name="echo" type="echo"/>
>
> <xs:complexType name="echo">
>
> <xs:sequence>
>
> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> <xs:element name="echoResponse" type="echoResponse"/>
>
> <xs:complexType name="echoResponse">
>
> <xs:sequence>
>
> <xs:element minOccurs="0" name="return" type="xs:string"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:schema>
>
>
>
>
>
> Can successfully be called in SOAP-UI:
>
>
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:ns="http://optagelse.dk/2008/11/16">
>
> <soapenv:Header/>
>
> <soapenv:Body>
>
> <ns:echo>
>
> <hello>Champ</hello>
>
> </ns:echo>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
> But another client generates this:
>
>
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>
> <soapenv:Header/>
>
> <soapenv:Body>
>
> <echo xmlns="http://optagelse.dk/2008/11/16">
>
> <hello>Champ</hello>
>
> </echo>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
> And this results in the param being null in the method
>
>
>
> The problem is that the param only works when it is given without
> namespace.
>
> ns:hello gives the same result in the first example.
>
>
>
> Is this not a bug? The schema in the wsdl has targetNamespace set so
you
> would assume that the client namespace on the param would work.
>
>
>
> /Chr
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: Figuring out why params turn to null
Posted by Daniel Kulp <dk...@apache.org>.
The schema has:
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
Thus, the "hello" child element MUST be unqualified. That's per the schema
rules. If it's sent qualified, then it doesn't match the schema.
Dan
On Monday 15 December 2008 9:57:19 am Christian Landbo Frederiksen wrote:
> I am using CXF 2.1
>
>
>
> I expose a java class/method like this
>
>
>
> @WebService(name="EchoService",
> targetNamespace="http://echo.dk/2008/11/16")
>
> public interface EchoService {
>
>
>
> @WebMethod
>
> public String echo(@WebParam(name = "hello") String hello)
>
>
>
>
>
> This turns into this wsdl:
>
>
>
> <xs:schema attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
> targetNamespace="http://echo.dk/2008/11/16"
> xmlns="http://echo.dk/2008/11/16"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
> <xs:element name="echo" type="echo"/>
>
> <xs:complexType name="echo">
>
> <xs:sequence>
>
> <xs:element minOccurs="0" name="hello" type="xs:string"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> <xs:element name="echoResponse" type="echoResponse"/>
>
> <xs:complexType name="echoResponse">
>
> <xs:sequence>
>
> <xs:element minOccurs="0" name="return" type="xs:string"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
> </xs:schema>
>
>
>
>
>
> Can successfully be called in SOAP-UI:
>
>
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:ns="http://optagelse.dk/2008/11/16">
>
> <soapenv:Header/>
>
> <soapenv:Body>
>
> <ns:echo>
>
> <hello>Champ</hello>
>
> </ns:echo>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
> But another client generates this:
>
>
>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
>
> <soapenv:Header/>
>
> <soapenv:Body>
>
> <echo xmlns="http://optagelse.dk/2008/11/16">
>
> <hello>Champ</hello>
>
> </echo>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
> And this results in the param being null in the method
>
>
>
> The problem is that the param only works when it is given without
> namespace.
>
> ns:hello gives the same result in the first example.
>
>
>
> Is this not a bug? The schema in the wsdl has targetNamespace set so you
> would assume that the client namespace on the param would work.
>
>
>
> /Chr
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog