You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Da...@sinnerschrader.de on 2001/11/26 11:46:01 UTC

SOAP Messaging

Hi,


the following is an example from a tutorial....(with the
DeploymentDescriptor) implemented with Apache SOAP

public class MessageSaveInvoice {
   public static void main (String[] args) {
      if (args.length < 2) {
         System.out.println("Usage: MessageSaveInvoice "  +
                            "<url> <message>");
         System.exit(-1);
      }
      StringBuffer sb = new StringBuffer();
      try {
         FileReader fr = new FileReader (args[1]);
         XMLParserLiaison xpl = new XercesParserLiaison();
         Document doc = xpl.read ("", fr);
         Envelope msgEnv = Envelope.unmarshall (doc.getDocumentElement());
         Message msg = new Message();
         msg.send (new URL (args[0]), "", msgEnv);
         SOAPTransport st = msg.getSOAPTransport();
         BufferedReader br = st.receive();
         String line;
         while ((line = br.readLine ()) != null) {
            System.out.println (line);
         }
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   }
}

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="http://companySender.com/schemas/invoice/" type="message">
  <isd:provider type="java"
                scope="Application"
                methods="saveInvoice">
    <isd:java class="Invoice" static="false"/>
  </isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>

In the MessageSaveInvoice Class it will be send a message (a xml document)
to an specific url.
This both parameters will be given by the command line arguments.
I know that in the soap-message-oriented way the client  should not being
bound
to particular methods and arguments (because loose coupling).
But from where does the client know which will process his message.
Even so the method is declared in de DD "saveInvoice".

thx in advance
daniel
____________________________________________

SinnerSchrader Deutschland GmbH
Communication & Technology

mailto:d.wolff@sinnerschrader.com
http://www.sinnerschrader.com
fon +49.(0) 40.39 88 55-0
fax +49.(0) 40.39 88 55-55
gasstrasse 8-16 | 22761 hamburg | germany
____________________________________________