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 Kapil Kapoor <ka...@tatainfotech.com> on 2002/02/27 13:57:08 UTC

RE: hi

Kaushik, tell me if its sufficient:-

The web service has been implemented in java. The Web Application Server
(IIS/JRUN) hosts the web service within a Java runtime environment. The web
service runs within the context of the web application server. Apache SOAP
RPC router (SOAP Service) unmarshalls SOAP remote procedure call (RPC)
messages and forwards them to the web service. The provider response is then
marshalled and returned to the requestor. The router is a servlet managed
within the context of the Web application server.

As business problem domain requires complex data to be transferred between
service requestor and service provider and to support service requestor
implementations independent of the hardware or software platform on which it
is implemented and the programming language in which it is written,  it was
decided that data will be exchanged as XML documents and that the XML
documents will be transported as string since sequence of characters or
string is a data type supported (and will be :-) ) by almost all major
programming language.

XML Schemas constrain and validate the format of information for the
business functions. The schemas are published to the service requestor.

First, we identified the web methods and then designed their signatures.  A
clean and elegant design practise is to have 4 or 5 parameters per web
method (well, its just a thumb rule we follow :-) , and its easier for
developer to remember when implementing a requestor for the service ), data
structures were created for each method parameter (if required). Infact all
the web methods of service also return the resultant data  as XML
structures. A WSDL document was then generated. An extract of the WSDL
document is below, where each part name in implementation is an XML string.
...........
<message
      name="<method name>">
  <part
      name="meth1_inType1" type="xsd:string"/>
  <part
      name="meth1_inType2" type="xsd:string"/>
  <part
      name="meth1_inType3" type="xsd:string"/>
  <part
      name="meth1_inType4" type="xsd:string"/>
  <part
      name="meth1_inType5" type="xsd:string"/>
  </message>
..................

Then generate the deployment descriptor ( Java specific) :-
....................
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="" qname="x:meth1_inType1"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
 <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="" qname="x:meth1_inType2"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
 <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="" qname="x:meth1_inType3"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
 <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="" qname="x:meth1_inType4"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
 <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="" qname="x:meth1_inType5"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
 ............................

The service requestor's application before invoking the web method, creates
XML documents using XML parser or may build as a string and passes the XML
document as string (XML String) by serializing the DOM Document object as a
string. This informationg on invoking is transported as part of SOAP
envelope and is forwarded by the SOAP service to the web service where this
string is deserialized into a DOM Document object, parsed and binded into a
Java class implementation for that XML document.

public String <method name> ( String <param1>,
                                              String <param2>,
                                              String <param3>,
                                              String <param4>,
                                              String <param5>  )
{

                //code specific to Xercex XML Java Parser below
                 DOMParser oParser = new DOMParser();
                 oParser.parse(new InputSource( new
StringReader(<param1>) ) );
                 Element oDocElm =
oParser.getDocument().getDocumentElement();
                .................................
}

Cheers
Kapil.


----Original Message-----
From: Kaushik Patra [mailto:kaushik.patra@eximsoft.com]
Sent: Wednesday, February 27, 2002 5:08 AM
To: kapil.kapoor@tatainfotech.com
Subject: hi


  Hi Kapil,
  I'm interested to know how u have implemented it..
  Can u send me some sample code and the process of implementing it..
  I'll be thanful
  regards
  kaushik

  Anne, it is possible to send the XML document either as a string or as a
Document object. About the latter I am not certain though I am sure I had
read it in some technical article.

  As a string, certainly yes. In my current project, we send and receive
custom data structures (value of web method parameter) as XML documents. On
receiving at server, the XML document are binded as Java classes. An
alternative approach is to use serializers and then the conversion happens
before you receive it in your program from SOAP service.

  Do tell me if you need specific details of implementation.

  Thanks,
  Kapil.