axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Rajkovic <eric.rajko...@oracle.com>
Subject Re: FW: another doc/literal issue
Date Thu, 10 Jul 2003 23:51:47 GMT
Cory,

With .Net, there are two flavors of document/literal requests you can generate. Once you
have genereted the web reference, you can look at the generated code
(Web Reference\com.travelnow.test\Reference.cs) to figure out which style is in use.

Look at the value for the ParameterStyle attribute (last parameter of System.Web.Services.Protocols.SoapDocumentMethodAttribute()).

It could be either System.Web.Services.Protocols.SoapParameterStyle.Bare or
System.Web.Services.Protocols.SoapParameterStyle.Wrapped

In addition to your two examples, you have the following option for wire format.
*******
DOC/LITERAL/Wrapped
*******
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <soap:Body>
         <addNumbers xmlns="http://test.travelnow.com">
             <x>5</x>
             <y>2</y>
         </addNumbers>
     </soap:Body>
</soap:Envelope>

Without to see the WSDL generated in you case, it's hard to tell if your service is expected
to get a wrapper with the operation name, is relying on the SOAPAction header attribute
to perform the message dispatching or can dispatch messages based on the QName of the first
element inside the <soap:Body>.

hth,
eric


Cory Wilkerson wrote:

> Sorry, premature send...that should read "com.travelnow.test" down there and not "com.corywilkerson...".
 Still an issue here -- just a typo when composing the email.
> 
> ----------------
> 
> 
> Using 1.1 final, I've implemented a VERY rudimentary doc/literal service for the sake
of testing doc/literal services.  The following fails with a .NET client -- but, if I remove
the style/use attributes -- the service executes without issue.  This serivce does *not* throw
a subclass of exception (which was an issue with an earlier doc/literal approach of mine)
-- can anyone explain why this service isn't being invoked?
> 
> ---------------------------
> service implementation
> ---------------------------
> package com.corywilkerson.test;
> 
> public class SomeService {
>     public int addNumbers(int x, int y) {
>         return x + y;
>     }
> }
> 
> -------------------------
> server-config.wsdd entry
> -------------------------
> <service name="TestService" provider="java:RPC" style="document" use="literal">
>  <parameter name="allowedMethods" value="*"/>
>  <parameter name="scope" value="request"/>
>  <parameter name="className" value="com.travelnow.test.SomeService"/>
> </service>
> 
> 
> -------------------------
> .NET client SOAPMessage via currentMessage/getSOAPPartAsString
> -------------------------
> 
> *******
> DOC/LITERAL
> *******
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>     <soap:Body>
>         <x xmlns="http://test.travelnow.com">5</x>
>         <y xmlns="http://test.travelnow.com">2</y>
>     </soap:Body>
> </soap:Envelope>
> 
> *******
> ENCODED
> *******
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
>     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
>     xmlns:tns="http://dev.travelnow.com/services/TestService" 
>     xmlns:types="http://dev.travelnow.com/services/TestService/encodedTypes" 
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 
>     <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>         <q1:addNumbers xmlns:q1="http://test.travelnow.com">
>             <x xsi:type="xsd:int">5</x>
>             <y xsi:type="xsd:int">2</y>
>         </q1:addNumbers>
>     </soap:Body>
> </soap:Envelope>
> 



Mime
View raw message