You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Robbie Gieze <gi...@eu.objectiflune.com> on 2011/02/09 10:45:18 UTC

wsdl2js generated code fails to parse a Java Map property

Hello,

I'm using Apache CXF to expose a Java object which has the following property:

private Map<String,String> constraintParams;

This gives me a correct WSDL file and I can use the SOAP method with no problems from tools like SOAPUI.

But I want to use the SOAP service from javascript. So I use the wsdl2js tool of CXF and it generates a .js file. When I use the javascript file it fails to parse the SOAP response from the server. 

The SOAP XML part that the javascript code fails to deserialize looks like this:

  <ns3:constraintParams>
    <ns1:entry>
      <ns1:key>regex</ns1:key>
      <ns1:value>^.+$</ns1:value>
    </ns1:entry>
  </ns3:constraintParams>

It seems like the generated js code tries to deserialize the <entry> tag but the wsdl2js generator didn't actually generate that function, so the code of the generator is calling a function that it didn't generate. The following line in the js gives a "services_systemcontrol_mydomain_com__entry_deserialize" is not defined" error.

   arrayItem = services_systemcontrol_mydomain_com__entry_deserialize(cxfjsutils, curElement);

At this moment the curElement property has the <entry> tag but the deserialize function simply is not in the generated js file.

Do I do anything wrong or is there another way that does work that I could look into?

On the server side I'm using 2.2.4, I tested the wsdl2js tool of versions 2.2.4, 2.2.12, 2.3.2 the result is always as above.

Thanks

Robbie

RE: wsdl2js generated code fails to parse a Java Map property

Posted by Robbie Gieze <gi...@eu.objectiflune.com>.
We use Aegis so I have created an issue in JIRA for this (CXF-3320)

Regards,

Robbie

-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: woensdag 9 februari 2011 13:07
To: users@cxf.apache.org
Subject: Re: wsdl2js generated code fails to parse a Java Map<String, String> property

Give or take the general limitations on 'Map', this should work. Which
is to say, I don't recall whether I was trying to make map work on
not. Map won't work on the Java side with JAXB, but it will work with
Aegis. A JIRA would be appropriate.

On Wed, Feb 9, 2011 at 4:45 AM, Robbie Gieze <gi...@eu.objectiflune.com> wrote:
> Hello,
>
> I'm using Apache CXF to expose a Java object which has the following property:
>
> private Map<String,String> constraintParams;
>
> This gives me a correct WSDL file and I can use the SOAP method with no problems from tools like SOAPUI.
>
> But I want to use the SOAP service from javascript. So I use the wsdl2js tool of CXF and it generates a .js file. When I use the javascript file it fails to parse the SOAP response from the server.
>
> The SOAP XML part that the javascript code fails to deserialize looks like this:
>
>  <ns3:constraintParams>
>    <ns1:entry>
>      <ns1:key>regex</ns1:key>
>      <ns1:value>^.+$</ns1:value>
>    </ns1:entry>
>  </ns3:constraintParams>
>
> It seems like the generated js code tries to deserialize the <entry> tag but the wsdl2js generator didn't actually generate that function, so the code of the generator is calling a function that it didn't generate. The following line in the js gives a "services_systemcontrol_mydomain_com__entry_deserialize" is not defined" error.
>
>   arrayItem = services_systemcontrol_mydomain_com__entry_deserialize(cxfjsutils, curElement);
>
> At this moment the curElement property has the <entry> tag but the deserialize function simply is not in the generated js file.
>
> Do I do anything wrong or is there another way that does work that I could look into?
>
> On the server side I'm using 2.2.4, I tested the wsdl2js tool of versions 2.2.4, 2.2.12, 2.3.2 the result is always as above.
>
> Thanks
>
> Robbie
>

Re: wsdl2js generated code fails to parse a Java Map property

Posted by Benson Margulies <bi...@gmail.com>.
Give or take the general limitations on 'Map', this should work. Which
is to say, I don't recall whether I was trying to make map work on
not. Map won't work on the Java side with JAXB, but it will work with
Aegis. A JIRA would be appropriate.

On Wed, Feb 9, 2011 at 4:45 AM, Robbie Gieze <gi...@eu.objectiflune.com> wrote:
> Hello,
>
> I'm using Apache CXF to expose a Java object which has the following property:
>
> private Map<String,String> constraintParams;
>
> This gives me a correct WSDL file and I can use the SOAP method with no problems from tools like SOAPUI.
>
> But I want to use the SOAP service from javascript. So I use the wsdl2js tool of CXF and it generates a .js file. When I use the javascript file it fails to parse the SOAP response from the server.
>
> The SOAP XML part that the javascript code fails to deserialize looks like this:
>
>  <ns3:constraintParams>
>    <ns1:entry>
>      <ns1:key>regex</ns1:key>
>      <ns1:value>^.+$</ns1:value>
>    </ns1:entry>
>  </ns3:constraintParams>
>
> It seems like the generated js code tries to deserialize the <entry> tag but the wsdl2js generator didn't actually generate that function, so the code of the generator is calling a function that it didn't generate. The following line in the js gives a "services_systemcontrol_mydomain_com__entry_deserialize" is not defined" error.
>
>   arrayItem = services_systemcontrol_mydomain_com__entry_deserialize(cxfjsutils, curElement);
>
> At this moment the curElement property has the <entry> tag but the deserialize function simply is not in the generated js file.
>
> Do I do anything wrong or is there another way that does work that I could look into?
>
> On the server side I'm using 2.2.4, I tested the wsdl2js tool of versions 2.2.4, 2.2.12, 2.3.2 the result is always as above.
>
> Thanks
>
> Robbie
>