KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jws > SoapCall


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.jws;
30
31 import java.io.ByteArrayInputStream JavaDoc;
32 import java.io.InputStream JavaDoc;
33
34 public class SoapCall {
35
36   private Envelope _envelope = null;
37
38   public SoapCall()
39   {
40   }
41
42   public SoapCall(String JavaDoc s) throws Exception JavaDoc
43   {
44     this(new ByteArrayInputStream JavaDoc(s.getBytes()));
45   }
46
47   public SoapCall(InputStream JavaDoc is) throws Exception JavaDoc
48   {
49     new com.caucho.config.Config().configure(this, is);
50   }
51
52   public String JavaDoc toString()
53   {
54     return "<soapcall>"+_envelope+"</soapcall>";
55   }
56
57   public Envelope.Body createBody() {
58     return createEnvelope().createBody();
59   }
60   public Envelope createEnvelope()
61   {
62     if (_envelope == null)
63       _envelope = new Envelope();
64
65     return _envelope;
66   }
67
68   public class Envelope {
69     private Body _body;
70
71     public Body createBody()
72     {
73       if (_body == null)
74     _body = new Body();
75
76       return _body;
77     }
78
79     public String JavaDoc toString()
80     {
81       return "<envelope>"+_body+"</envelope>";
82     }
83     
84     public class Body {
85
86       public CallResponse _callResponse;
87
88       public CallResponse createNullCallResponse() {
89     if (_callResponse == null)
90       _callResponse = new CallResponse();
91
92     return _callResponse;
93       }
94
95       public String JavaDoc toString()
96       {
97     return "<body>"+_callResponse+"</body>";
98       }
99       
100       public class CallResponse
101       {
102     public String JavaDoc toString()
103     {
104       return "<nullCallResponse/>";
105     }
106       }
107     }
108   }
109 }
110
Popular Tags