You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Muhammed Shariq (JIRA)" <ji...@apache.org> on 2011/06/08 13:59:58 UTC
[jira] [Created] (AXIS2-5064) Support HashMap type in the web
service.
Support HashMap type in the web service.
----------------------------------------
Key: AXIS2-5064
URL: https://issues.apache.org/jira/browse/AXIS2-5064
Project: Axis2
Issue Type: Improvement
Components: adb
Affects Versions: 1.6.0, 1.5.4
Reporter: Muhammed Shariq
Fix For: 1.7.0
Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Updated] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Sagara Gunathunga (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sagara Gunathunga updated AXIS2-5064:
--------------------------------------
Issue Type: New Feature (was: Improvement)
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: New Feature
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Assigned] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Sagara Gunathunga (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sagara Gunathunga reassigned AXIS2-5064:
-----------------------------------------
Assignee: Sagara Gunathunga
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Commented] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059884#comment-13059884 ]
Hudson commented on AXIS2-5064:
-------------------------------
Integrated in Axis2 #827 (See [https://builds.apache.org/job/Axis2/827/])
AXIS2-5064 - Implemented basic Java Map Support.
sagara :
Files :
* /axis/axis2/java/core/trunk/modules/adb/test/org/apache/axis2/databinding/utils/BeanUtilTest.java
* /axis/axis2/java/core/trunk/modules/adb/src
* /axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/rpc/receivers/RPCUtil.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/TypeTable.java
* /axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DocLitBareSchemaGenerator.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/Constants.java
* /axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Resolved] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Sagara Gunathunga (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sagara Gunathunga resolved AXIS2-5064.
---------------------------------------
Resolution: Fixed
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Commented] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Sagara Gunathunga (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070386#comment-13070386 ]
Sagara Gunathunga commented on AXIS2-5064:
-------------------------------------------
Hi Paul,
This is already supported , I just tried for your service as follows.
1.) Server side
public Map<String, Object> echoMap(Map<String, Object> testMap) {
Set<Entry<String, Object>> entrySet = testMap.entrySet();
for (Entry<String, Object> entry : entrySet) {
System.out.println(entry.getKey() + " : " + entry.getValue()
+ " : " + entry.getValue().getClass());
}
return testMap;
}
2. code generation
axis2-1.7.0-SNAPSHOT/bin/wsdl2java.sh -uw -u -uri http://localhost:8080/services/SimpleService?wsdl
3. Client side
org.apache.ws.namespaces.axis2.map.Map1 req = new org.apache.ws.namespaces.axis2.map.Map1();
org.apache.ws.namespaces.axis2.map.Entry1 e1 = new org.apache.ws.namespaces.axis2.map.Entry1();
e1.setKey("key1");
e1.setValue("value1");
org.apache.ws.namespaces.axis2.map.Entry1[] param = { e1};
req.setEntry(param);
org.apache.ws.namespaces.axis2.map.Map2 res = stub.echoMap(req);
System.out.println(res.getEntry()[0].getKey());
System.out.println(res.getEntry()[0].getValue());
I got expected results.
Please test this again with latest Axis2 trunk build . If you will get this issue again please attach your project here ( server /clients and configuration )
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Commented] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Sagara Gunathunga (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059841#comment-13059841 ]
Sagara Gunathunga commented on AXIS2-5064:
-------------------------------------------
Implemented basic Java Map Support in r1142991.
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org
[jira] [Commented] (AXIS2-5064) Support HashMap type in the web
service.
Posted by "Paul Nibin K J (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070368#comment-13070368 ]
Paul Nibin K J commented on AXIS2-5064:
---------------------------------------
Hi,
I tried to create a service that receives and returns a Map.
The Service class is:
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class MapTest
{
public Map < String, Object > echoMap( Map < String, Object > testMap )
{
Set < Entry < String, Object >> entrySet = testMap.entrySet();
for ( Entry < String, Object > entry : entrySet )
{
System.out.println( entry.getKey() + " : " + entry.getValue() + " : " + entry.getValue().getClass() );
}
return testMap;
}
}
I deployed this service as a POJO. And I generated client stub using the following code.
WSDL2Java.main( new String []
{ "-o", ".", "-uw", "-u", "-uri", "http://localhost:8080/axis2/services/MapTest?wsdl" } );
My Client test code is:
import org.apache.ws.namespaces.axis2.map.Entry1;
import org.apache.ws.namespaces.axis2.map.Entry2;
import org.apache.ws.namespaces.axis2.map.Map1;
import org.apache.ws.namespaces.axis2.map.Map2;
public class Axis2MapTest
{
public static void main( String [] args ) throws Throwable
{
MapTestStub stub = new MapTestStub();
Map1 testMap5 = new Map1();
Entry1 entry1 = new Entry1();
entry1.setKey( "key1" );
entry1.setValue( "Value1" );
testMap5.addEntry( entry1 );
entry1 = new Entry1();
entry1.setKey( "key2" );
entry1.setValue( 5 );
testMap5.addEntry( entry1 );
entry1 = new Entry1();
entry1.setKey( "key1" );
entry1.setValue( 47.2233 );
testMap5.addEntry( entry1 );
Map2 echoMap = stub.echoMap( testMap5 );
Entry2 [] entry = echoMap.getEntry();
for ( Entry2 entry2 : entry )
{
System.out.println( entry2.getKey() + " : " + entry2.getValue() + " : " + entry2.getValue().getClass() );
}
}
}
When I try to invoke the service using the client, I am getting the following error from the client.
Exception in thread "main" org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://ws.apache.org/namespaces/axis2/map}entry
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.ws.axis2.MapTestStub.fromOM(MapTestStub.java:529)
at org.apache.ws.axis2.MapTestStub.echoMap(MapTestStub.java:192)
at org.apache.ws.axis2.Axis2MapTest.main(Axis2MapTest.java:28)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://ws.apache.org/namespaces/axis2/map}entry
at org.apache.ws.namespaces.axis2.map.Map2$Factory.parse(Map2.java:538)
at org.apache.ws.axis2.EchoMapResponse$Factory.parse(EchoMapResponse.java:397)
at org.apache.ws.axis2.MapTestStub.fromOM(MapTestStub.java:523)
... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://ws.apache.org/namespaces/axis2/map}entry
at org.apache.ws.namespaces.axis2.map.Map2$Factory.parse(Map2.java:524)
... 4 more
There is no error at the server side. The exception occurs while parsing the response in the client side.
The response sent to the client from server is:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<ns:echoMapResponse xmlns:ns="http://ws.apache.org/axis2">
<return>
<map:entry xmlns:map="http://ws.apache.org/namespaces/axis2/map">
<map:key>key2</map:key>
<map:value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:int">5</map:value>
</map:entry>
<map:entry xmlns:map="http://ws.apache.org/namespaces/axis2/map">
<map:key>key1</map:key>
<map:value xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:double">47.2233</map:value>
</map:entry>
</return>
</ns:echoMapResponse>
</soapenv:Body>
</soapenv:Envelope>
Please check whether this is supported yet.
Thanks,
Paul
> Support HashMap type in the web service.
> ----------------------------------------
>
> Key: AXIS2-5064
> URL: https://issues.apache.org/jira/browse/AXIS2-5064
> Project: Axis2
> Issue Type: Improvement
> Components: adb
> Affects Versions: 1.5.4, 1.6.0
> Reporter: Muhammed Shariq
> Assignee: Sagara Gunathunga
> Fix For: 1.7.0
>
>
> Support HashMap type in the web service.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org