users@jax-rpc.java.net

Re: SOAP-ENC problem

From: Hrishikesh Bhagwat <Hrishikesh.Bhagwat_at_XORIANT.COM>
Date: Tue, 07 May 2002 09:51:41 +0530

hi kyle,

please refer ( Question 70, subject : xrpcc: Generate stub from WSDL )
in last month's (April 2002) archive.

Hrishikesh



-----Original Message-----
From: Kyle Lomeli [mailto:kyle.lomeli_at_DEITEL.NET]
Sent: Monday, May 07, 2001 12:26 AM
To: JAXRPC-INTEREST_at_JAVA.SUN.COM
Subject: SOAP-ENC problem


I'm trying to make my JAX-RPC client (JWSDP EA2 RI) talk to a Web service I
deployed on Axis. I generated a JAX-RPC stub from the WSDL document Axis
generates. The WS operation takes a string and returns a JavaBean type
class.

When I execute the JAX-RPC client, I get the following exception:

java.rmi.RemoteException: deserialization error: deserialization error:
deserial
ization error: deserialization error: unexpected encoding style:
expected=http:/
/schemas.xmlsoap.org/soap/encoding/, actual=; nested exception is:
        deserialization error: deserialization error: deserialization error:
des
erialization error: unexpected encoding style:
expected=http://schemas.xmlsoap.o
rg/soap/encoding/, actual=
deserialization error: deserialization error: deserialization error:
deserializa
tion error: unexpected encoding style:
expected=http://schemas.xmlsoap.org/soap/
encoding/, actual=
        at
com.sun.xml.rpc.encoding.SOAPDeserializationContext.deserializeMultiR
efObjects(SOAPDeserializationContext.java:107)
        at
com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:159
)
        at bookprice.BookPrice_Stub.getPrice(Unknown Source)

I have been able to run my JAX-RPC client successfully on the same WS
deployed on a WASP, CapeConnect and GLUE. I am using Axis Beta 1.

Is this a JAX-RPC bug or an Axis bug? From what I can tell, the Axis
response is well-formed. It seems to me that JAX-RPC RI expects that the
SOAP-ENC must be defined in the Envelope element. From what I have been
reading, this requirement is not part of the SOAP 1.1 specs. Have I missed
something? Is there a work-around?

The wire-dumps follow:

JAXR Request:

POST /axis/services/BookPrice HTTP/1.1
Content-Type: text/xml; charset="utf-8"
Content-Length: 513
SOAPAction: ""
User-Agent: Java1.3.1_02
Host: flatbug
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

<?xml version="1.0" encoding="UTF-8"?> <env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://flatbug:8080/axis/services/BookPrice"
xmlns:ns1="FlatBug:deitel"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Body><ns0
:getPrice><isbn
xsi:type="xsd:string">01801</isbn></ns0:getPrice></env:Body></env:Envelope>

Axis Response:

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 865
Date: Mon, 29 Apr 2002 20:00:12 GMT
Server: Java Web Services Developer Pack/1.0-ea2 (HTTP/1.1 Connector)

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body>
  <ns1:getPriceResponse
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://flatbug:8080/axis/services/BookPrice">
   <getPriceResult href="#id0"/>
  </ns1:getPriceResponse>
  <multiRef id="id0" SOAP-ENC:root="0" xsi:type="ns2:PriceQuote"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="FlatBug:deitel">
   <price xsi:type="xsd:double">9.99</price>
   <isbn xsi:type="xsd:string">9999999ISBN</isbn>
   <storeID xsi:type="xsd:int">9999</storeID>
   <storeDescription
xsi:type="xsd:string">99999Description</storeDescription>
  </multiRef>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

*******************************************************
 Kyle Lomel?
 Software Developer
 Deitel & Associates, Inc.
 www.deitel.com

 Register now for the DEITEL BUZZ e-mail newsletter at
 http://www.deitel.net/newsletter/subscribe.html
*******************************************************


*******************************************************
 Kyle Lomel?
 Software Developer
 Deitel & Associates, Inc.
 www.deitel.com

 Register now for the DEITEL BUZZ e-mail newsletter at
 http://www.deitel.net/newsletter/subscribe.html
*******************************************************