Everything is same  as ur's . see it.
It is able to make a connection and call rpcrouter but it is not able to
call the method


<% Option Explicit %>
<HTML>
<HEAD>
<TITLE>SOAP Client</TITLE>
</HEAD>
<%
  Dim Serializer
  Dim Reader
  Dim Connector
  Dim Answer


Set Connector = CreateObject("MSSOAP.HttpConnector")
  Connector.Property("EndPointURL") =
"http://localhost:7001/soap/servlet/rpcrouter"; ' url of server
  Connector.Connect
  Connector.Property("SoapAction") = "engine"  ' urn name
  Connector.BeginMessage
Set Serializer = CreateObject("MSSOAP.SoapSerializer")
  Serializer.Init Connector.InputStream
  Serializer.startEnvelope
  Serializer.startBody
  Serializer.startElement "concat", "engine"     ' method name  , urn
  Serializer.startElement  "a"            ' 1st parameter
  Serializer.writeString "hello"
  Serializer.endElement
  Serializer.startElement  "b"    ' 2nd parameter
  Serializer.writeString "india"
  Serializer.endElement

  Serializer.endElement
  Serializer.endBody
  Serializer.endEnvelope


  Connector.EndMessage
Set Reader = CreateObject("MSSOAP.SoapReader")
  Reader.Load Connector.OutputStream

  If (Reader.Fault Is Nothing) Then
 Answer=   Reader.RPCResult.Text
  End If

%>


Result is:<%=Answer%>


</BODY>
</HTML>


public class  Data
{
 public double getData(double x) {
  System.out.println(x);
  return x*x;
 }

 public long add(long y,long z) {
  System.out.println(y);
  System.out.println(z);
  return y+z;
 }

 public String concat(String a,String b) {
  System.out.println(a);
  System.out.println(b);
  return a+b;
 }

 public String[] strAdd(String[] a, String[] b) {
  String[] d=new String[a.length];
  for (int i=0;i<a.length ;i++ ){
   d[i]=a[i]+b[i];
  }
  return d;
 }
}


'engine' Service Deployment Descriptor
Property                     Details
ID                              engine
Scope                        Application
Provider Type            java
Provider Class            Data
Use Static Class         false
Methods                     getData, add, concat, strAdd
Type Mappings
Default Mapping Registry Class





Janesh Kumar Vasudeva
ASAP Sols Pvt Ltd
B-3 Sector -4 Noida
Ph. No. 91-4443211/3212/3213

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 9:51 AM
Subject: Re: Anyone implemented vb client with java server


>
> I am giving u sample VB client code and web-service code which is working
> properly.
> You can convert VB code in ASP syntax. Hope this will help you.
>
> Web-Service has one parameter only.
> I am using
>
> tomcat 3.2, apache 1.3.20, soap 2.1 or higher and MS-Soap 2.0 beta 2
> release.
>
>
> <<<<<<<<<<<<<< Client Code >>>>>>>>>>>>>>>>>>>>>>>
>
> Dim Serializer As New SoapSerializer
> Dim Connector As SoapConnector
> Dim Reader As New SoapReader
> Dim str As String
>
> str = "hey can u here me"
>
> Set Connector = New HttpConnector
>
> Connector.Property("EndPointURL")
> = ""http://localhost:8080/soap/servlet/rpcrouter";
>
> Connector.Connect Nothing
>
> Connector.Property("SoapAction") = "urn:ASDCCServer"    ' This is the id
of
> Web-Service deployed
>
>
> Connector.BeginMessage Nothing
>
>
> Serializer.Init Connector.InputStream
>
>
> Serializer.startEnvelope
>
>
>     Serializer.startBody
>
>
>       Serializer.startElement "ASDCCRecieve", "urn:ASDCCServer"    '
> ASDCCRecieve is method of web-service
>
>
>          Serializer.startElement "xmlstrm"   'xmlstrm parameter of
> web-service
>
>
>              Serializer.writeString str  'value of parameter
>
>
>          Serializer.endElement
>
>
>       Serializer.endElement
>
>
>     Serializer.endBody
>
> Serializer.endEnvelope
>
>
> Connector.EndMessage
>
>
> Reader.Load Connector.OutputStream
>
> msgbox  Reader.RPCResult.Text
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> <<<<<<<<<<<<<<<<<<<<<<< Web-Service Code >>>>>>>>>>>>>>>>>>>>>>>
>
>
> import java.io.*;
> import java.util.*;
> import com.jobjects.jst.*;
>
> public class ASDCCServer
>
> {
>
>
>    public String ASDCCRecieve(String xmlstrm) throws Exception
>
>      {
>
>           try
>              {
>            return "XML-Stream Accepted - " + xmlstrm;
>               }
>
>           catch (Exception e)
>              {
>                     return  e.getMessage();
>               }
>      }
>
> }
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>
> <<<<<<<<<<<<<<<< deployement descriptor >>>>>>>>>>>>>>>>>>>>>>>>
>
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment";
>              id="urn:ASDCCServer">
>   <isd:provider type="java"
>                 scope="Application"
>                 methods="ASDCCRecieve">
>     <isd:java class="ASDCCServer" static="false"/>
>   </isd:provider>
>
>
>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r>
>
>   <isd:mappings>
>      <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
>              xmlns:x="" qname="x:xmlstrm"
>              xml2JavaClassName
> ="org.apache.soap.encoding.soapenc.StringDeserializer"/>
>   </isd:mappings>
>
> </isd:service>
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Brajendra Singh
> Software Engineer
> Max Ateev Limited
>

Reply via email to