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 Michel Bergijk <mi...@cmg.nl> on 2002/02/26 13:08:39 UTC
RE: Error While Deploying.
Dinakar,
Can't help you with that. I'm not that well versed in SOAP at this moment. I
only adviced you to use the serializer because I have used it in the past
for an application. But why don't you look into
http://xml.apache.org/soap/docs/trouble/index.html
<http://xml.apache.org/soap/docs/trouble/index.html> . The bottom part
contains "Deployment error in SOAP service 'XYX':..., with link to
http://xml.apache.org/soap/docs/trouble/index.html
<http://xml.apache.org/soap/docs/trouble/index.html> and "No Deserializer
found to deserialize a 'XYZ' using encoding style 'FOO'" with links to
http://xml.apache.org/soap/docs/guide/deploy.html#typemapping
<http://xml.apache.org/soap/docs/guide/deploy.html#typemapping> and
http://xml.apache.org/soap/docs/guide/rpcclient.html
<http://xml.apache.org/soap/docs/guide/rpcclient.html> . Maybe that will
help you?
Success
Michel
-----Original Message-----
From: dinakar [mailto:dinakar.s@eximsoft.com]
Sent: dinsdag 26 februari 2002 23:27
To: michel.bergijk@cmg.nl
Subject: Re: Problem In Deploying webservice
thanks michel for ur reply.but now iam getting diffrerent error. i mean i
can't able to deploy the service.
when i deploy in the command prompt using dd.xml file its given this error
D:\webservicedemo\patientprofile>java
org.apache.soap.server.ServiceManagerClien
t <http://localhost:8080/soap/servlet/rpcrouter>
http://localhost:8080/soap/servlet/rpcrouter deploy DeploymentDescriptor.xml
Exception in thread "main" java.lang.IllegalArgumentException: Unable to
determi
ne namespace of 'patientinfo-object'.
at
org.apache.soap.util.xml.DOMUtils.getQualifiedAttributeValue(Unknown
Source)
at org.apache.soap.server.DeploymentDescriptor.fromXML(Unknown
Source)
at org.apache.soap.server.ServiceManagerClient.main(Unknown Source)
my dd.xml file is
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="patientprofile">
<isd:provider type="java"
scope="Application"
methods="getAllPatientDetails">
<isd:java class="PatientProfileObject" 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="urn:patientobjectinfoclass" qname="patientinfo-object"
javaType="PatientInfo"
java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
</isd:mappings>
</isd:service>
My PatientProfileObject class is
import java.util.*;
public class PatientProfileObject
{
public Hashtable patients=new Hashtable();
public PatientProfileObject()
{
addPatient("100",new PatientInfo("First","FirstAddress","Fever"));
addPatient("101",new PatientInfo("Second","SecondAddress","HeadAche"));
addPatient("102",new PatientInfo("third","ThirdAddress","Fracture"));
addPatient("103",new PatientInfo("Fourth","FourthAddress","cold"));
System.out.println("after putting into hashtable");
}
public void addPatient(String name, PatientInfo patinfo)
{
patients.put(name, patinfo);
}
public PatientInfo getAllPatientDetails(String name) throws
IllegalArgumentException
{
if (name == null)
{
throw new IllegalArgumentException("The name argument must not be " +
"null.");
}
return (PatientInfo)patients.get(name);
}
}
My PatientInfo class is
import java.io.*;
public class PatientInfo implements Serializable
{
private String patName;
private String patAddress;
private String patDesease;
public PatientInfo()
{
}
public PatientInfo(String patName, String patAddress, String patDesease)
{
this.patName = patName;
this.patAddress = patAddress;
this.patDesease = patDesease;
}
public void setpatName(String patName)
{
this.patName = patName;
}
public String getpatName()
{
return patName;
}
public void setpatAddress(String patAddress)
{
this.patAddress = patAddress;
}
public String getpatAddress()
{
return patAddress;
}
public void setpatDesease(String patDesease)
{
this.patDesease = patDesease;
}
public String getpatDesease()
{
return patDesease;
}
public String toString()
{
return patName + "\n" + patAddress + ", " + patDesease ;
}
}
i didn't get any problem when i deployed AddressBook sample which comes with
soap-2_2.
i followed the same way and got strucked at this point.
i will be thankful if u can solve my problem.
thanks in advance
with regards
dinakar.
----- Original Message -----
From: Michel <ma...@cmg.nl> Bergijk
To: soap-user@xml.apache.org <ma...@xml.apache.org>
Sent: Tuesday, February 26, 2002 2:51 AM
Subject: RE: Problem In Deploying webservice
Hi,
Why don't you let your patientInfo class implement the Serializable
interface, and import java.io.*. You don't need to do anything else, just
say you implement it. Look into the Javadoc for more information.
Succes,
Michel
-----Original Message-----
From: dinakar [ mailto:dinakar.s@eximsoft.com
<ma...@eximsoft.com> ]
Sent: dinsdag 26 februari 2002 21:10
To: soap-user@xml.apache.org
Subject: Problem In Deploying webservice
Hi All,
I have just subscribed into the soap-user mailiing list and hope i will
get used of it.
I am new to soap technologies i have just started to execute some java
samples applications.
I am using jakarta-tomcat 3.2.3 and soap 2.2 as an deployment server.
I have deployed some samples classes which accepts two parameters as
request like String,Integer,Float and also
sends an response as String or Integer .That was working fine.
Now i wanted to Pass an User Defined Object as an Parameter and also
should recieve an Object as an response.
When i did that i am facing an problem.I have two classes
PatientProfileObject and patientInfo class.
This is my PatientProfileObject class
import java.util.*;
public class PatientProfileObject
{
public PatientProfileObject()
{
}
public static Hashtable patients;
static
{ patients=new Hashtable();
patientInfo patient1=new patientInfo("First","FirstAddress","Fever");
patients.put("100",patient1);
}
public Hashtable getAllPatientDetails()
{
return patients;
}
}
This is patientInfo class
public class patientInfo
{
String id,name,address,desease;
public patientInfo()
{
}
public patientInfo(String name,String address,String desease)
{
this.name=name;
this.address=address;
this.desease=desease;
}
public patientInfo createPatienInfo(String name,String address,String
desease)
{
patientInfo patientinfo=new patientInfo(name,address,desease);
return patientinfo;
}
}
And this is my Client Class
import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.rpc.*;
public class PatientClientObject
{
public static void main(String args[]) throws Exception
{
URL url=new URL("http://10.10.20.58:8070/soap/servlet/rpcrouter");
String urn="patientprofile";
SOAPMappingRegistry smr=new SOAPMappingRegistry();
BeanSerializer beanSer=new BeanSerializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC,new
QName("urn:patientobjectclass","patient-object"),PatientProfileObject.class,
beanSer,beanSer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC,new
QName("urn:patientobjectinfoclass","patientinfo-object"),patientInfo.class,b
eanSer,beanSer);
Call call1=new Call();
call1.setTargetObjectURI(urn);
call1.setSOAPMappingRegistry(smr);
try
{
call1.setMethodName("getAllPatientDetails");
call1.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Response response2=call1.invoke(url,"");
if(!response2.generatedFault())
{
Parameter result2=response2.getReturnValue();
Object patients=result2.getValue();
Hashtable patientTable=(Hashtable)patients;
Enumeration enum=patientTable.elements();
Vector vect;
Enumeration vectEnum;
while (enum.hasMoreElements())
{
System.out.println(enum.nextElement());
}
}
else
{
Fault fault2=response2.getFault();
System.out.println("Error is " +
fault2.getFaultCode()+" " + fault2.getFaultString());
}
}//try ends
catch (SOAPException sexceptionss)
{
System.out.println(sexceptionss.getMessage());
}
}//method ends
}
I have deployed this service using deploy tool and when i run the client iam
getting this error
Error is SOAP-ENV:Server java.lang.IllegalArgumentException: No Serializer
found to serialize a 'patientInfo' using encoding style
'http://schemas.xmlsoap.org
/soap/encoding/'.
i think the problem is in deploying. can anyone pls help me in this regard
thanks in advance
thanks and regards
dinakar.s