I have a web service deployed as rpc-literal. I have two methods, one returns
an int, the other a complex type "Persion". What steps do I need to follow to
get serialzation/deserialization of my complex type to work? I've found alot of
examples of web services using simple types... none with complex types.
Returning the int works fine in my client, but when I try to call getPerson(),
I get an exception:
| java.rmi.RemoteException: Runtime exception; nested exception is:
| unexpected element name: expected=result, actual={urn:Foo}Person
| at
com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318)
| at
com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300)
| at
com.danny.CalculatorService_Stub.getPerson(CalculatorService_Stub.java:69)
| at com.danny.CalculatorClient.main(CalculatorClient.java:22)
| Caused by: unexpected element name: expected=result, actual={urn:Foo}Person
| at
com.danny.CalculatorService_getPerson_ResponseStruct_LiteralSerializer.doDeserialize(CalculatorService_getPerson_ResponseStruct_LiteralSerializer.java:57)
| at
com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.internalDeserialize(LiteralObjectSerializerBase.java:216)
| at
com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.deserialize(LiteralObjectSerializerBase.java:124)
| at
com.danny.CalculatorService_Stub._deserialize_getPerson(CalculatorService_Stub.java:174)
| at
com.danny.CalculatorService_Stub._readFirstBodyElement(CalculatorService_Stub.java:157)
| at
com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:215)
| ... 2 more
I use wscompile to create both the server and the client. The client using the
command:
wscompile -gen:client -f:rpcliteral -f:wsi -mapping jaxrpc-mapping.xml -d build
-keep config.xml
My config.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
| <configuration
| xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
| <wsdl
location="http://xxx:8080/CalculatorService/CalculatorService?wsdl"
| packageName="com.danny"/>
| </configuration>
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872617#3872617
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872617
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user