• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

WSAD 5.1.1 SOAP RPC return type of Object[]

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a java bean with a method:
public Object[] methodOne(String s, Object obj) {...}
I've used the WSAD wizard to generate a web service from the java bean.
The client looks like this:
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL("http://localhost:9080/RPCWeb/services/AWebService"));
call.setOperationName(new QName(getNamespace(), getMethodName()));
Object[] invocationParameters =new Object[] { "input", "more input" };
Object returnValue = call.invoke(invocationParameters);
I can see that the request is getting to the web service. However, the returnValue from the call.invoke(...) is always null.
Any ideas?
Thanks
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check whether the webservice is returing a valid response ?. An easy way to moniter this is by writing a simple app that stands between the web service and the client an trace out the XML and redirects the req/res to the corresponding destination. Apache SOAP used to have one utility to this. I don't know about WSAD impl
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Axis has tcpmon (see the Axis User's Guide). There are other "logging proxy" type of programs out there as well. One of the good ones is tcpsniffer.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This won't work in Apache SOAP (which you're using) or Apache Axis for that matter because the SOAP engine doesn't know what type of objects it is serializing and during the generation of the stub and server will not generate/link in the appropriate serializer types. You should never use an Object type or Object Array in Web Services -- use an array typed to your actual type you want returned instead.
Kyle
 
Antoine Catalfano
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using the TCPMonitor in WSAD. I see the following response is being sent:
HTTP/1.1 200 OK
Server: WebSphere Application Server/5.0
Content-Type: text/xml; charset=utf-8
Content-Language: en-US
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<methodOneResponse xmlns="http://service.web">
<methodOneReturn xsi:type="soapenc:Array" soapenc:arrayType="xsd:anyType[2]" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns="">
<item xsi:type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema">Morandi</item>
<item xsi:type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema">Hello Antoine</item>
</methodOneReturn>
</methodOneResponse>
</soapenv:Body>
</soapenv:Envelope>
I'm just not sure how to get it.
 
Antoine Catalfano
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is currently working using Apache AXIS and a Jetty server. We (John Deere and Thought Works) built a custom EAI framework. Our SOAP adapters support RPC and JAXM Messaging. We've exposed our framework as a SOAP service.
The method signature is as follows:
public Object[] execute(String service, String activity, String ativityMsgVersion, String sourceSystem,Object payload) throws ISFException
The .wsdd looks like:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="isf" provider="java:RPC">
<parameter name="className" value="com.deere.isf.adapters.soap.ISFSOAP"/>
<parameter name="allowedMethods" value="*"/>
<namespace>http://www.deere.com/isf/duck</namespace>;
</service>
</deployment>
We have a JUnit script that generates wsdl, stubs, starts a Jetty server, deploys the web service and tests it. I'm currently trying to get the unit tests running in WSAD.
 
Antoine Catalfano
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I should have mentioned that since this is an integration framework, we have to support taking a payload of any type (a java Object).
 
Straws are for suckers. Now suck on this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic