[Issue 42] New - SOAPDeserializationContext.verifyEncodingStyle throws exception when EncodingStyle not provided from remote service

View: New views
3 Messages — Rating Filter:   Alert me  

[Issue 42] New - SOAPDeserializationContext.verifyEncodingStyle throws exception when EncodingStyle not provided from remote service

by uygaryuzsuren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://jax-rpc.dev.java.net/issues/show_bug.cgi?id=42
                 Issue #|42
                 Summary|SOAPDeserializationContext.verifyEncodingStyle throws
                        |exception when EncodingStyle not provided from remote
                        |service
               Component|jax-rpc
                 Version|current
                Platform|Macintosh
              OS/Version|All
                     URL|
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|spec
             Assigned to|issues@jax-rpc
             Reported by|uygaryuzsuren






------- Additional comments from uygaryuzsuren@... Thu May 28 14:53:51 +0000 2009 -------
Hi,

I'm developing some DII client implementations for a variety of web services.
The reason why I use DII instead of stub approach is that AXIS2 client is not
thread safe (multiple simultaneous calls fail for both single stub and multiple
stubs). I tried jwsdp2.0, but wsimport.sh failed. I may also request an
enhancement for wsimport, too.

The problem in DII client is that when I invoke a Call in a one-way fashion, it
works properly, but when I try to invoke the Call and get the result, an
exception occurs:

"unexpected encoding style: expected=http://schemas.xmlsoap.org/soap/encoding/,
actual=
        at
com.sun.xml.rpc.encoding.SOAPDeserializationContext.verifyEncodingStyle(SOAPDeserializationContext.java:168)

..."

I googled the java code of SOAPDeserializationContext, and I found out that the
verifyEncodingStyle method throws an exception when the encoding style parameter
is not provided by the server.

I can see the purpose of the function verifyEncodingStyle, but in such a case
(when web service doesn't specify the encoding style), one cannot use the web
service in the first place.

I think this is a problem since the client may not be the one who had developed
the service at the server side (just like my case).

So, what should be done in my opinion is either to use the expected encoding
style (http://schemas.xmlsoap.org/soap/encoding/) when not provided by the
server, or to provide a means for the client developer to be able to substitute
one (the developer may not change the service code at the server but he may ask
the encoding style, or he may already know it).

My suggestion is that the corresponding class be modified in the following way:

SOAPDeserializationContext.java

...

public void verifyEncodingStyle(String expectedEncodingStyle) {
        if (expectedEncodingStyle == null ||
expectedEncodingStyle.trim().equals("")) {
            expectedEncodingStyle = EXPECTED_ENCODING_STYLE;
//http://schemas.xmlsoap.org/soap/encoding/
        }

...

Thank you in advance

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@...
For additional commands, e-mail: issues-help@...


[Issue 42] SOAPDeserializationContext.verifyEncodingStyle throws exception when EncodingStyle not provided from remote service

by uygaryuzsuren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://jax-rpc.dev.java.net/issues/show_bug.cgi?id=42






------- Additional comments from uygaryuzsuren@... Thu May 28 21:28:01 +0000 2009 -------
Created an attachment (id=12)
DummyClient.java


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@...
For additional commands, e-mail: issues-help@...


[Issue 42] SOAPDeserializationContext.verifyEncodingStyle throws exception when EncodingStyle not provided from remote service

by uygaryuzsuren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://jax-rpc.dev.java.net/issues/show_bug.cgi?id=42






------- Additional comments from uygaryuzsuren@... Thu May 28 21:29:50 +0000 2009 -------
Okay, I performed a CVS checkout and found out that there is nothing wrong with
expectedEncodingStyle as the parameter of verifyEncodingStyle function. When I
commented out the following line at the end of the function and merely put a
return statement instead, my web service call worked perfectly:)

...

//throw new DeserializationException(
//            "soap.unexpectedEncodingStyle",
//            new Object[] { expectedEncodingStyle, curEncodingStyle });

return;

...

The problem turned out to be in the following statement:

...

if (expectedEncodingStyle == soapNamespaceConstants.getEncoding()
            || expectedEncodingStyle.equals(
                soapNamespaceConstants.getEncoding())) {
            if (isSOAPEncodingStyle) {
                return;
            }
        }

...

Here isSOAPEncodingStyle is always false, I don't know why. I found that it is
raised to true in "initEncodingStyleInfo" function. I also found out that in
this function the statement

...

if (curEncodingStyle.indexOf(' ') == -1) {

...

always goes to true since curEncodingStyle is an empty string. When
curEncodingStyle is an empty string isSOAPEncodingStyle is always false, leading
the verifyEncodingStyle function to throw an invalid Exception...


Is it because of my missing something in my client code?I am using jax-rpc
without an application server. I provided the java code as an attachment...


Thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@...
For additional commands, e-mail: issues-help@...