You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Ji...@Prometric.com on 2000/10/16 23:17:19 UTC

Latest woes

I have a couple of questions.

1. Is there any good documentation of the DeploymentDescriptor.xml files?
2. I am having troubles using SOAP (I've got the samples to work, but I am
trying to add my own method).  The basic problem seems to be that SOAP
can't find a Deserializer, but I specify
org.apache.soap.encoding.soapenc.BeanSerializer, for both ways. Are there
constraints on the objects you can Serialize/Deserialize with this object?
Please see below for details...


WHAT I AM TRYING TO DO:

I am trying to simply add a "MyType getHelloWorld()" method to the
AddressBook example. I tried adding a "String getHelloWorld()", but I had
problems with that.

TYPE I AM RETURNING:

package samples.testing;

public class MyType {

    private String myData = "Hello SOAP World!";

    public String toString() {
        return myData;
    }
}

DEPLOYMENT FILE (ie, DeploymentDescriptor.xml):

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:Tester">
  <isd:provider type="java"
                scope="Application"
                methods="getAddressFromName addEntry getAllListings putListings getHelloWorld">
    <isd:java class="samples.testing.AddressBook" static="false"/>
  </isd:provider>
  <isd:mappings>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:MyType"
             javaType="samples.testing.MyType"
             java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
             xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:address"
             javaType="samples.testing.Address"
             java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
             xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:phone"
             javaType="samples.testing.PhoneNumber"
             java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
             xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
  </isd:mappings>
</isd:service>

EXCEPTION I AM GETTING:

Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
deserialize a 'urn:xml-soap-address-testing:MyType' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.






Re: Latest woes

Posted by Rob Walker <rw...@airflash.com>.
You'll need to add the methods get/setMyData() to your MyData class.

-Rob


Jim.Sweeney@Prometric.com wrote:

> I have a couple of questions.
>
> 1. Is there any good documentation of the DeploymentDescriptor.xml files?
> 2. I am having troubles using SOAP (I've got the samples to work, but I am
> trying to add my own method).  The basic problem seems to be that SOAP
> can't find a Deserializer, but I specify
> org.apache.soap.encoding.soapenc.BeanSerializer, for both ways. Are there
> constraints on the objects you can Serialize/Deserialize with this object?
> Please see below for details...
>
> WHAT I AM TRYING TO DO:
>
> I am trying to simply add a "MyType getHelloWorld()" method to the
> AddressBook example. I tried adding a "String getHelloWorld()", but I had
> problems with that.
>
> TYPE I AM RETURNING:
>
> package samples.testing;
>
> public class MyType {
>
>     private String myData = "Hello SOAP World!";
>
>     public String toString() {
>         return myData;
>     }
> }
>
> DEPLOYMENT FILE (ie, DeploymentDescriptor.xml):
>
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
>              id="urn:Tester">
>   <isd:provider type="java"
>                 scope="Application"
>                 methods="getAddressFromName addEntry getAllListings putListings getHelloWorld">
>     <isd:java class="samples.testing.AddressBook" static="false"/>
>   </isd:provider>
>   <isd:mappings>
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-testing" qname="x:MyType"
>              javaType="samples.testing.MyType"
>              java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>              xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-testing" qname="x:address"
>              javaType="samples.testing.Address"
>              java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>              xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-testing" qname="x:phone"
>              javaType="samples.testing.PhoneNumber"
>              java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>              xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>   </isd:mappings>
> </isd:service>
>
> EXCEPTION I AM GETTING:
>
> Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
> deserialize a 'urn:xml-soap-address-testing:MyType' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.


Re: Latest woes

Posted by Rob Walker <rw...@airflash.com>.
You'll need to add the methods get/setMyData() to your MyData class.

-Rob


Jim.Sweeney@Prometric.com wrote:

> I have a couple of questions.
>
> 1. Is there any good documentation of the DeploymentDescriptor.xml files?
> 2. I am having troubles using SOAP (I've got the samples to work, but I am
> trying to add my own method).  The basic problem seems to be that SOAP
> can't find a Deserializer, but I specify
> org.apache.soap.encoding.soapenc.BeanSerializer, for both ways. Are there
> constraints on the objects you can Serialize/Deserialize with this object?
> Please see below for details...
>
> WHAT I AM TRYING TO DO:
>
> I am trying to simply add a "MyType getHelloWorld()" method to the
> AddressBook example. I tried adding a "String getHelloWorld()", but I had
> problems with that.
>
> TYPE I AM RETURNING:
>
> package samples.testing;
>
> public class MyType {
>
>     private String myData = "Hello SOAP World!";
>
>     public String toString() {
>         return myData;
>     }
> }
>
> DEPLOYMENT FILE (ie, DeploymentDescriptor.xml):
>
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
>              id="urn:Tester">
>   <isd:provider type="java"
>                 scope="Application"
>                 methods="getAddressFromName addEntry getAllListings putListings getHelloWorld">
>     <isd:java class="samples.testing.AddressBook" static="false"/>
>   </isd:provider>
>   <isd:mappings>
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-testing" qname="x:MyType"
>              javaType="samples.testing.MyType"
>              java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>              xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-testing" qname="x:address"
>              javaType="samples.testing.Address"
>              java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>              xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-testing" qname="x:phone"
>              javaType="samples.testing.PhoneNumber"
>              java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>              xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
>   </isd:mappings>
> </isd:service>
>
> EXCEPTION I AM GETTING:
>
> Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
> deserialize a 'urn:xml-soap-address-testing:MyType' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.


RE: Latest woes

Posted by Mike Pagano <mi...@voiceint.com>.
Jim,

Wow. I might actually be able to answer this.

I had to add soap.jar to my classpath since that is where BeanSerializer is
found.

Since I am using tomcat, I also had to add the soap.jar to the CLASSPATH
section in the tomcat.sh file.

I'm fairly sure I needed both.  Someone might correct me on this one.

Mike

-----Original Message-----
From: Jim.Sweeney@Prometric.com [mailto:Jim.Sweeney@Prometric.com]
Sent: Monday, October 16, 2000 5:17 PM
To: soap-user@xml.apache.org
Subject: Latest woes



I have a couple of questions.

1. Is there any good documentation of the DeploymentDescriptor.xml files?
2. I am having troubles using SOAP (I've got the samples to work, but I am
trying to add my own method).  The basic problem seems to be that SOAP
can't find a Deserializer, but I specify
org.apache.soap.encoding.soapenc.BeanSerializer, for both ways. Are there
constraints on the objects you can Serialize/Deserialize with this object?
Please see below for details...


WHAT I AM TRYING TO DO:

I am trying to simply add a "MyType getHelloWorld()" method to the
AddressBook example. I tried adding a "String getHelloWorld()", but I had
problems with that.

TYPE I AM RETURNING:

package samples.testing;

public class MyType {

    private String myData = "Hello SOAP World!";

    public String toString() {
        return myData;
    }
}

DEPLOYMENT FILE (ie, DeploymentDescriptor.xml):

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:Tester">
  <isd:provider type="java"
                scope="Application"
                methods="getAddressFromName addEntry getAllListings
putListings getHelloWorld">
    <isd:java class="samples.testing.AddressBook" static="false"/>
  </isd:provider>
  <isd:mappings>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:MyType"
             javaType="samples.testing.MyType"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:address"
             javaType="samples.testing.Address"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:phone"
             javaType="samples.testing.PhoneNumber"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
  </isd:mappings>
</isd:service>

EXCEPTION I AM GETTING:

Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
deserialize a 'urn:xml-soap-address-testing:MyType' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.






RE: Latest woes

Posted by Mike Pagano <mi...@voiceint.com>.
Jim,

Wow. I might actually be able to answer this.

I had to add soap.jar to my classpath since that is where BeanSerializer is
found.

Since I am using tomcat, I also had to add the soap.jar to the CLASSPATH
section in the tomcat.sh file.

I'm fairly sure I needed both.  Someone might correct me on this one.

Mike

-----Original Message-----
From: Jim.Sweeney@Prometric.com [mailto:Jim.Sweeney@Prometric.com]
Sent: Monday, October 16, 2000 5:17 PM
To: soap-user@xml.apache.org
Subject: Latest woes



I have a couple of questions.

1. Is there any good documentation of the DeploymentDescriptor.xml files?
2. I am having troubles using SOAP (I've got the samples to work, but I am
trying to add my own method).  The basic problem seems to be that SOAP
can't find a Deserializer, but I specify
org.apache.soap.encoding.soapenc.BeanSerializer, for both ways. Are there
constraints on the objects you can Serialize/Deserialize with this object?
Please see below for details...


WHAT I AM TRYING TO DO:

I am trying to simply add a "MyType getHelloWorld()" method to the
AddressBook example. I tried adding a "String getHelloWorld()", but I had
problems with that.

TYPE I AM RETURNING:

package samples.testing;

public class MyType {

    private String myData = "Hello SOAP World!";

    public String toString() {
        return myData;
    }
}

DEPLOYMENT FILE (ie, DeploymentDescriptor.xml):

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:Tester">
  <isd:provider type="java"
                scope="Application"
                methods="getAddressFromName addEntry getAllListings
putListings getHelloWorld">
    <isd:java class="samples.testing.AddressBook" static="false"/>
  </isd:provider>
  <isd:mappings>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:MyType"
             javaType="samples.testing.MyType"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:address"
             javaType="samples.testing.Address"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-testing" qname="x:phone"
             javaType="samples.testing.PhoneNumber"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
  </isd:mappings>
</isd:service>

EXCEPTION I AM GETTING:

Caught SOAPException (SOAP-ENV:Client): No Deserializer found to
deserialize a 'urn:xml-soap-address-testing:MyType' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.