Hello all.

I am really struggling to know whether I am heading in the right direction
with this project, so any advice would be greatly appreciated.

The requirement: a WS-I-compliant web service to wrap an EJB which returns a
java.util.Vector of objects.

Firstly, I think the WS-I compliance bit means I have two choices:
rpc/literal or document/literal. I read in a mail from Anne Thomas Manes
that rpc/literal is "not recommended" but I'm not sure why.

Secondly, the List to be returned contains a JavaBean, which itself contains
two JavaBeans, one with two double and one String property, the other with
one String property. I gather there is some issue with returning arrays, but
I don't know which message style that applies to. I control the format of
the response, however, so this can be changed. However, the fact remains
that either a set of simple arrays or a java.util.Collection must be
returned somehow.

The method exposed as a web service takes three parameters (Short, String,
String) and I'm unclear on whether these three need to be kept separate as
they are, or grouped together into one class (e.g.
WebsrvcOrderInLmsImportParams).

At this point I am thoroughly confused by reading what seems to be
conflicting advice. If anyone can see straight away which route I should be
taking, or know of a relevant article on the web, please let me know.

I attach my deploy.wsdd and Java client, which have been modified too many
times now and I've managed to stop the thing working altogether!

Many thanks,

Dan

---------

Deploy.wsdd:

<deployment xmlns="http://xml.apache.org/axis/wsdd/";
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>

<service name="DanWS2" provider="java:RPC">
         style="rpc"
         use="literal">
  <parameter name="className" value="DanWS2"/>
  <parameter name="allowedMethods" value="*"/>
  
  <operation name="websrvcOrderInLms"
returnQname="ns:websrvcOrderInLmsResponse" returnType="ns:java.util.List">
    <parameter qname="ns:nummer1" type="xsd:short" mode="IN"/>
    <parameter qname="ns:userIntfNumb" type="xsd:string" mode="IN"/>
    <parameter qname="ns:dateCrtd" type="xsd:string" mode="IN"/>
  </operation>

  <beanMapping qname="ns:GrpExp" xmlns:ns="http://www.jumar-solutions.com/";
               languageSpecificType="java:GrpExp"/>
  <beanMapping qname="ns:StorOrdr"
xmlns:ns="http://www.jumar-solutions.com/";
               languageSpecificType="java:StorOrdr"/>
  <beanMapping qname="ns:OrdrStat"
xmlns:ns="http://www.jumar-solutions.com/";
               languageSpecificType="java:OrdrStat"/>

 </service>

</deployment>


TestClient.java:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import org.apache.axis.Constants;
import org.apache.axis.MessageContext;
import org.apache.axis.server.AxisServer;
import java.util.List;

public class TestClient2
{
   public static void main(String [] args) {
       MessageContext msgContext = new MessageContext(new AxisServer());

     String endpoint =
        "http://localhost:8080/axis/services/DanWS2";;
     String nameSpaceUri = "http://soapinterop.org";;
     String operation = "websrvcOrderInLms";

       try {

           Service  service = new Service();
           Call     call    = (Call) service.createCall();

           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           call.setOperation(new QName(nameSpaceUri, "DanWS2"), operation);

           // parameters
           Short nummer1 = new Short((short)1);
           String userIntfNumb = "10015";
           String dateCrtd = "20041230212749000000";

           List ret = (List) call.invoke( new Object[] { nummer1,
userIntfNumb, dateCrtd } );

           System.out.println("Sent " + nummer1 + "," + userIntfNumb + "," +
dateCrtd + ". Got: " + ret);
       } catch (Exception e) {
         e.printStackTrace();
       }
   }
}



Reply via email to