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 Anting Xu <an...@hotmail.com> on 2001/05/23 16:59:02 UTC

StatelessEJBProvider bug

Hi:

I played around the source code of StatelessEJBProvider and found out there 
is a problem in the invoke() method of StatelessEJBProvider, when preparing 
the response, the encoding style it is picking up is 
call.getEncodingStyleURI() which gives back null if the request has the 
encoding style in the envelop instead of body.

I also found there is a variable respEncStyle defined and assigned values in 
the class but never used. It looks like here it should use respEncStyle 
instead of call.getEncodingStyleURI().

AFter I changed it, then it works.

I am using the apache SOAP 2.1 release, has this been fixed?

Thanks

Jian

        try {

          System.err.println("response encoding style is 
"+call.getEncodingStyleURI());
          Response resp = new Response( targetObjectURI,            // URI
                               call.getMethodName(),       // Method
                               (Parameter) ret,            // ReturnValue
                               null,                       // Params
                               null,                       // Header
//                               call.getEncodingStyleURI (),// encoding
                                respEncStyle,
                               resContext );        // response soapcontext 
- not supported yet
                  Envelope env = resp.buildEnvelope();
                  StringWriter  sw = new StringWriter();
                  env.marshall( sw, call.getSOAPMappingRegistry(), 
resContext );
                  resContext.setRootPart( sw.toString(), 
Constants.HEADERVAL_CONTENT_TYPE_UTF8);
                }


>From: "Anting Xu" <an...@hotmail.com>
>Reply-To: soap-user@xml.apache.org
>To: soap-user@xml.apache.org
>Subject: VB client (encodingStyle in soap envelope)  causing 
>StatelessEJBProvider fail
>Date: Tue, 22 May 2001 12:21:21 -0400
>
>Hi:
>
>I have got a VB client talking with Apache Server (invoking a class method)
>based on the demos provided in this mailing list, I am trying to set up the
>VB client invoking a EJB of the apache server(similar to the ejb example
>provided by apache, but vb to apache instead of apache to apache). VB 
>client
>request will have the encoding style in the soap envelop section which 
>works
>well with directly invoking a class method, but will cause this error from
>the StatelessEJBProvider if directly invoking a EJB. Apache client request
>will have the encoding style in the soap body which works well with the
>StatelessEJBProvider.
>
>Is this a problem(bug) with the StatelessEJBProvider mechanism? or I am
>missing something here?
>
>Any feedback will be appreciated.
>
>---------------------------
>VBClient
>---------------------------
>Soap Fault:
>
>[SOAP-ENV:Server]
>
>java.lang.IllegalArgumentException: No Serializer found to serialize a
>'org.apache.soap.rpc.Parameter' using encoding style 'null'.
>
><detail>
>
><stackTrace>[SOAPException: faultCode=SOAP-ENV:Server;
>msg=java.lang.IllegalArgumentException: No Serializer found to serialize a
>'org.apache.soap.rpc.Parameter' using encoding style 'null'.]
>
>	at
>org.apache.soap.providers.StatelessEJBProvider.invoke(StatelessEJBProvider.java:205)
>
>	at
>org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:267)
>
>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
>
>	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
>
>	at
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:106)
>
>	at
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:907)
>
>	at
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:851)
>
>	at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletCo
>
>Here is the tcp tunnel trace of the request from VB client where you can 
>see
>the encodingStyle is in the envelop(and this is probably the reason causing
>the StatelessEJBProvider to fail ?):
>******************************************************
>POST /soap/servlet/rpcrouter/ HTTP/1.1
>
>Content-Type: text/xml
>
>Host: localhost
>
>SOAPAction: "urn:ejbhello"
>
>Content-Length: 303
>
>
><?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><m:hello
>xmlns:m="urn:ejbhello"><s>what</s></m:hello></SOAP-ENV:Body></SOAP-ENV:Envelope>
>******************************************************
>
>Here is the tcp tunnel trace sent from the apache client to invoke EJB 
>where
>you can see the encoding style is in the soap body.( and this works with 
>the
>StatelessEJBProvider)
>
>**************************************************
>POST /soap/servlet/rpcrouter HTTP/1.0
>
>Host: localhost:8080
>
>Content-Type: text/xml; charset=utf-8
>
>Content-Length: 449
>
>SOAPAction: ""
>
>
><?xml version='1.0' encoding='UTF-8'?>
>
><SOAP-ENV:Envelope
>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>xmlns:xsd="http://www.w3.org/1999/XMLSchema">
>
><SOAP-ENV:Body>
>
><ns1:hello xmlns:ns1="urn:ejbhello"
>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>
><symbol xsi:type="xsd:string">test ejb xujian</symbol>
>
></ns1:hello>
>
></SOAP-ENV:Body>
>
></SOAP-ENV:Envelope>
>***************************************************************
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
>For additional commands, email: soap-user-help@xml.apache.org
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: StatelessEJBProvider bug

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Can u please try to 2.2 release candidate and see whether its ok now?
I believe this bug has been fixed but I could be wrong.

Sanjiva.

----- Original Message -----
From: "Anting Xu" <an...@hotmail.com>
To: <so...@xml.apache.org>
Cc: <ka...@freddiemac.com>
Sent: Wednesday, May 23, 2001 10:59 AM
Subject: StatelessEJBProvider bug


> Hi:
>
> I played around the source code of StatelessEJBProvider and found out
there
> is a problem in the invoke() method of StatelessEJBProvider, when
preparing
> the response, the encoding style it is picking up is
> call.getEncodingStyleURI() which gives back null if the request has the
> encoding style in the envelop instead of body.
>
> I also found there is a variable respEncStyle defined and assigned values
in
> the class but never used. It looks like here it should use respEncStyle
> instead of call.getEncodingStyleURI().
>
> AFter I changed it, then it works.
>
> I am using the apache SOAP 2.1 release, has this been fixed?
>
> Thanks
>
> Jian
>
>         try {
>
>           System.err.println("response encoding style is
> "+call.getEncodingStyleURI());
>           Response resp = new Response( targetObjectURI,            // URI
>                                call.getMethodName(),       // Method
>                                (Parameter) ret,            // ReturnValue
>                                null,                       // Params
>                                null,                       // Header
> //                               call.getEncodingStyleURI (),// encoding
>                                 respEncStyle,
>                                resContext );        // response
soapcontext
> - not supported yet
>                   Envelope env = resp.buildEnvelope();
>                   StringWriter  sw = new StringWriter();
>                   env.marshall( sw, call.getSOAPMappingRegistry(),
> resContext );
>                   resContext.setRootPart( sw.toString(),
> Constants.HEADERVAL_CONTENT_TYPE_UTF8);
>                 }
>
>
> >From: "Anting Xu" <an...@hotmail.com>
> >Reply-To: soap-user@xml.apache.org
> >To: soap-user@xml.apache.org
> >Subject: VB client (encodingStyle in soap envelope)  causing
> >StatelessEJBProvider fail
> >Date: Tue, 22 May 2001 12:21:21 -0400
> >
> >Hi:
> >
> >I have got a VB client talking with Apache Server (invoking a class
method)
> >based on the demos provided in this mailing list, I am trying to set up
the
> >VB client invoking a EJB of the apache server(similar to the ejb example
> >provided by apache, but vb to apache instead of apache to apache). VB
> >client
> >request will have the encoding style in the soap envelop section which
> >works
> >well with directly invoking a class method, but will cause this error
from
> >the StatelessEJBProvider if directly invoking a EJB. Apache client
request
> >will have the encoding style in the soap body which works well with the
> >StatelessEJBProvider.
> >
> >Is this a problem(bug) with the StatelessEJBProvider mechanism? or I am
> >missing something here?
> >
> >Any feedback will be appreciated.
> >
> >---------------------------
> >VBClient
> >---------------------------
> >Soap Fault:
> >
> >[SOAP-ENV:Server]
> >
> >java.lang.IllegalArgumentException: No Serializer found to serialize a
> >'org.apache.soap.rpc.Parameter' using encoding style 'null'.
> >
> ><detail>
> >
> ><stackTrace>[SOAPException: faultCode=SOAP-ENV:Server;
> >msg=java.lang.IllegalArgumentException: No Serializer found to serialize
a
> >'org.apache.soap.rpc.Parameter' using encoding style 'null'.]
> >
> > at
>
>org.apache.soap.providers.StatelessEJBProvider.invoke(StatelessEJBProvider.
java:205)
> >
> > at
>
>org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:2
67)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> >
> > at
>
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.jav
a:106)
> >
> > at
>
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextIm
pl.java:907)
> >
> > at
>
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextIm
pl.java:851)
> >
> > at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletCo
> >
> >Here is the tcp tunnel trace of the request from VB client where you can
> >see
> >the encodingStyle is in the envelop(and this is probably the reason
causing
> >the StatelessEJBProvider to fail ?):
> >******************************************************
> >POST /soap/servlet/rpcrouter/ HTTP/1.1
> >
> >Content-Type: text/xml
> >
> >Host: localhost
> >
> >SOAPAction: "urn:ejbhello"
> >
> >Content-Length: 303
> >
> >
> ><?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
> >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><
m:hello
>
>xmlns:m="urn:ejbhello"><s>what</s></m:hello></SOAP-ENV:Body></SOAP-ENV:Enve
lope>
> >******************************************************
> >
> >Here is the tcp tunnel trace sent from the apache client to invoke EJB
> >where
> >you can see the encoding style is in the soap body.( and this works with
> >the
> >StatelessEJBProvider)
> >
> >**************************************************
> >POST /soap/servlet/rpcrouter HTTP/1.0
> >
> >Host: localhost:8080
> >
> >Content-Type: text/xml; charset=utf-8
> >
> >Content-Length: 449
> >
> >SOAPAction: ""
> >
> >
> ><?xml version='1.0' encoding='UTF-8'?>
> >
> ><SOAP-ENV:Envelope
> >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> >xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> >
> ><SOAP-ENV:Body>
> >
> ><ns1:hello xmlns:ns1="urn:ejbhello"
> >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> >
> ><symbol xsi:type="xsd:string">test ejb xujian</symbol>
> >
> ></ns1:hello>
> >
> ></SOAP-ENV:Body>
> >
> ></SOAP-ENV:Envelope>
> >***************************************************************
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at http://explorer.msn.com
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >For additional commands, email: soap-user-help@xml.apache.org
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: StatelessEJBProvider bug

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Can u please try to 2.2 release candidate and see whether its ok now?
I believe this bug has been fixed but I could be wrong.

Sanjiva.

----- Original Message -----
From: "Anting Xu" <an...@hotmail.com>
To: <so...@xml.apache.org>
Cc: <ka...@freddiemac.com>
Sent: Wednesday, May 23, 2001 10:59 AM
Subject: StatelessEJBProvider bug


> Hi:
>
> I played around the source code of StatelessEJBProvider and found out
there
> is a problem in the invoke() method of StatelessEJBProvider, when
preparing
> the response, the encoding style it is picking up is
> call.getEncodingStyleURI() which gives back null if the request has the
> encoding style in the envelop instead of body.
>
> I also found there is a variable respEncStyle defined and assigned values
in
> the class but never used. It looks like here it should use respEncStyle
> instead of call.getEncodingStyleURI().
>
> AFter I changed it, then it works.
>
> I am using the apache SOAP 2.1 release, has this been fixed?
>
> Thanks
>
> Jian
>
>         try {
>
>           System.err.println("response encoding style is
> "+call.getEncodingStyleURI());
>           Response resp = new Response( targetObjectURI,            // URI
>                                call.getMethodName(),       // Method
>                                (Parameter) ret,            // ReturnValue
>                                null,                       // Params
>                                null,                       // Header
> //                               call.getEncodingStyleURI (),// encoding
>                                 respEncStyle,
>                                resContext );        // response
soapcontext
> - not supported yet
>                   Envelope env = resp.buildEnvelope();
>                   StringWriter  sw = new StringWriter();
>                   env.marshall( sw, call.getSOAPMappingRegistry(),
> resContext );
>                   resContext.setRootPart( sw.toString(),
> Constants.HEADERVAL_CONTENT_TYPE_UTF8);
>                 }
>
>
> >From: "Anting Xu" <an...@hotmail.com>
> >Reply-To: soap-user@xml.apache.org
> >To: soap-user@xml.apache.org
> >Subject: VB client (encodingStyle in soap envelope)  causing
> >StatelessEJBProvider fail
> >Date: Tue, 22 May 2001 12:21:21 -0400
> >
> >Hi:
> >
> >I have got a VB client talking with Apache Server (invoking a class
method)
> >based on the demos provided in this mailing list, I am trying to set up
the
> >VB client invoking a EJB of the apache server(similar to the ejb example
> >provided by apache, but vb to apache instead of apache to apache). VB
> >client
> >request will have the encoding style in the soap envelop section which
> >works
> >well with directly invoking a class method, but will cause this error
from
> >the StatelessEJBProvider if directly invoking a EJB. Apache client
request
> >will have the encoding style in the soap body which works well with the
> >StatelessEJBProvider.
> >
> >Is this a problem(bug) with the StatelessEJBProvider mechanism? or I am
> >missing something here?
> >
> >Any feedback will be appreciated.
> >
> >---------------------------
> >VBClient
> >---------------------------
> >Soap Fault:
> >
> >[SOAP-ENV:Server]
> >
> >java.lang.IllegalArgumentException: No Serializer found to serialize a
> >'org.apache.soap.rpc.Parameter' using encoding style 'null'.
> >
> ><detail>
> >
> ><stackTrace>[SOAPException: faultCode=SOAP-ENV:Server;
> >msg=java.lang.IllegalArgumentException: No Serializer found to serialize
a
> >'org.apache.soap.rpc.Parameter' using encoding style 'null'.]
> >
> > at
>
>org.apache.soap.providers.StatelessEJBProvider.invoke(StatelessEJBProvider.
java:205)
> >
> > at
>
>org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:2
67)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> >
> > at
>
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.jav
a:106)
> >
> > at
>
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextIm
pl.java:907)
> >
> > at
>
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextIm
pl.java:851)
> >
> > at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletCo
> >
> >Here is the tcp tunnel trace of the request from VB client where you can
> >see
> >the encodingStyle is in the envelop(and this is probably the reason
causing
> >the StatelessEJBProvider to fail ?):
> >******************************************************
> >POST /soap/servlet/rpcrouter/ HTTP/1.1
> >
> >Content-Type: text/xml
> >
> >Host: localhost
> >
> >SOAPAction: "urn:ejbhello"
> >
> >Content-Length: 303
> >
> >
> ><?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
> >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><
m:hello
>
>xmlns:m="urn:ejbhello"><s>what</s></m:hello></SOAP-ENV:Body></SOAP-ENV:Enve
lope>
> >******************************************************
> >
> >Here is the tcp tunnel trace sent from the apache client to invoke EJB
> >where
> >you can see the encoding style is in the soap body.( and this works with
> >the
> >StatelessEJBProvider)
> >
> >**************************************************
> >POST /soap/servlet/rpcrouter HTTP/1.0
> >
> >Host: localhost:8080
> >
> >Content-Type: text/xml; charset=utf-8
> >
> >Content-Length: 449
> >
> >SOAPAction: ""
> >
> >
> ><?xml version='1.0' encoding='UTF-8'?>
> >
> ><SOAP-ENV:Envelope
> >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> >xmlns:xsd="http://www.w3.org/1999/XMLSchema">
> >
> ><SOAP-ENV:Body>
> >
> ><ns1:hello xmlns:ns1="urn:ejbhello"
> >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> >
> ><symbol xsi:type="xsd:string">test ejb xujian</symbol>
> >
> ></ns1:hello>
> >
> ></SOAP-ENV:Body>
> >
> ></SOAP-ENV:Envelope>
> >***************************************************************
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at http://explorer.msn.com
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> >For additional commands, email: soap-user-help@xml.apache.org
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org