You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Vishy <rk...@yahoo.com> on 2006/01/26 15:57:20 UTC

Need Help on Document/Literal

Hi All,

I have a very simple web service that I am trying to
deploy and run.

It deploys fine, but when I try to test it (by sending
a SOAP message via HTTP Post), I get a <No Such
Operation 'submitOrder'> error.

I have read thru Anne's blog and her postings
regarding using document literal and document literal
wrapped. Since I couldn't have a method which is the
same as the qname, I was trying to include an
'operation' in the deploy.wsdd's service element to
map the qname to a method call. I don't have much of a
choice, but to use document literal. Can anyone see
any obvious problems in the configurations below?

Following are some details:
---------------------------
deploy.wsdd
 <service name="ClarifyTicketService"
provider="java:RPC" style="document" use="literal">
    <parameter name="className"
value="com.mycom.services.submit.SubmitOrder"/>
    <parameter name="allowedMethods" value="*"/>
    <operation name="submitDELLOrder"
               qname="submitDELLOrder"
               returnQName="submitDELLOrderResponse"
               returnType="xsd:string">
      <parameter name="od" type="ns0:submitOrder"
xmlns:ns0="http://mycom.com/schemas"/>
    </operation>

    <typeMapping
      xmlns:ns="http://mycom.com/schemas"
      qname="ns:submitOrder"
     
type="java:com.mycom.services.submit.OrderDetails"
     
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
     
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
      encodingStyle=""
    />
  </service>
-------------
Schema
-------
<xsd:element name="submitOrder"
type="ord:OrderDetails"/>
<xsd:complexType name="OrderDetails">
  <xsd:sequence>
    <xsd:element ref="ord:ItemName"/>
    <xsd:element ref="ord:Quantity"/>
  </xsd:sequence>
</xsd:complexType>
-------
Implementation of SubmitOrder
-----------------------------
public String submitDELLOrder(OrderDetails od) {
  String tmpStr = "<ItemName>" + od.getItemName() +
"</ItemName>";
  return tmpStr;
}
-------------------------------

The following message is what I am sending via HTTP
POST
--------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:ns1="http://mycom.com/schemas">
  <SOAP-ENV:Body xmlns:ns0="http://mycom.com/schemas">
           <ns0:submitOrder>
                <ItemName>xyz</ItemName>
                <Quantity>5</Quantity>
           </ns0:submitOrder>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
-------------------------------------

Any help would be HIGHLY appreciated.

Regards,
Vishy



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Need Help on Document/Literal

Posted by Vishy <rk...@yahoo.com>.
Hi Anne,

Thanks so much for your help....I have changed the
WSDD's operation element as you suggested...and I got
past that problem...

One question if you don't mind...can I invoke a
webservice as follows (from a standalone Java client)

Socket s = new Socket(HOST,PORT);
PrintWriter out = new
PrintWriter(s.getOutputStream());
out.println(request);
out.flush();

where 'request' has the necessary HTTP header and the
SOAP message (a SOAP message that I created as below)

When I invoke the webservice as mentioned above, I get
a 
"could not find deserializer for type
{http://mycom.com/schemas}submitOrder" error. 

I really appreciate your help...

Thanks much!
Vishy


--- Anne Thomas Manes <at...@gmail.com> wrote:

> Your WSDL says that the name of the input element is
> "submitOrder", but your
> WSDD says to expect an element called
> "submitDELLOrder". Change the qname
> attribute in your <operation> definition in the WSDD
> to "ns0:submitOrder"
> and add a namespace declaration for the ns0
> namespace.
> 
> Anne
> 
> On 1/26/06, Vishy <rk...@yahoo.com> wrote:
> >
> >
> > Hi All,
> >
> > I have a very simple web service that I am trying
> to
> > deploy and run.
> >
> > It deploys fine, but when I try to test it (by
> sending
> > a SOAP message via HTTP Post), I get a <No Such
> > Operation 'submitOrder'> error.
> >
> > I have read thru Anne's blog and her postings
> > regarding using document literal and document
> literal
> > wrapped. Since I couldn't have a method which is
> the
> > same as the qname, I was trying to include an
> > 'operation' in the deploy.wsdd's service element
> to
> > map the qname to a method call. I don't have much
> of a
> > choice, but to use document literal. Can anyone
> see
> > any obvious problems in the configurations below?
> >
> > Following are some details:
> > ---------------------------
> > deploy.wsdd
> > <service name="ClarifyTicketService"
> > provider="java:RPC" style="document"
> use="literal">
> >     <parameter name="className"
> > value="com.mycom.services.submit.SubmitOrder"/>
> >     <parameter name="allowedMethods" value="*"/>
> >     <operation name="submitDELLOrder"
> >                qname="submitDELLOrder"
> >               
> returnQName="submitDELLOrderResponse"
> >                returnType="xsd:string">
> >       <parameter name="od" type="ns0:submitOrder"
> > xmlns:ns0="http://mycom.com/schemas"/>
> >     </operation>
> >
> >     <typeMapping
> >       xmlns:ns="http://mycom.com/schemas"
> >       qname="ns:submitOrder"
> >
> > type="java:com.mycom.services.submit.OrderDetails"
> >
> >
>
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> >
> >
>
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> >       encodingStyle=""
> >     />
> >   </service>
> > -------------
> > Schema
> > -------
> > <xsd:element name="submitOrder"
> > type="ord:OrderDetails"/>
> > <xsd:complexType name="OrderDetails">
> >   <xsd:sequence>
> >     <xsd:element ref="ord:ItemName"/>
> >     <xsd:element ref="ord:Quantity"/>
> >   </xsd:sequence>
> > </xsd:complexType>
> > -------
> > Implementation of SubmitOrder
> > -----------------------------
> > public String submitDELLOrder(OrderDetails od) {
> >   String tmpStr = "<ItemName>" + od.getItemName()
> +
> > "</ItemName>";
> >   return tmpStr;
> > }
> > -------------------------------
> >
> > The following message is what I am sending via
> HTTP
> > POST
> > --------------------------------
> > <?xml version="1.0" encoding="UTF-8"?>
> > <SOAP-ENV:Envelope
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >
> >
>
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> >
> >
>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >
> >
>
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
> >     xmlns:ns1="http://mycom.com/schemas">
> >   <SOAP-ENV:Body
> xmlns:ns0="http://mycom.com/schemas">
> >            <ns0:submitOrder>
> >                 <ItemName>xyz</ItemName>
> >                 <Quantity>5</Quantity>
> >            </ns0:submitOrder>
> >   </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> > -------------------------------------
> >
> > Any help would be HIGHLY appreciated.
> >
> > Regards,
> > Vishy
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Need Help on Document/Literal

Posted by Anne Thomas Manes <at...@gmail.com>.
Your WSDL says that the name of the input element is "submitOrder", but your
WSDD says to expect an element called "submitDELLOrder". Change the qname
attribute in your <operation> definition in the WSDD to "ns0:submitOrder"
and add a namespace declaration for the ns0 namespace.

Anne

On 1/26/06, Vishy <rk...@yahoo.com> wrote:
>
>
> Hi All,
>
> I have a very simple web service that I am trying to
> deploy and run.
>
> It deploys fine, but when I try to test it (by sending
> a SOAP message via HTTP Post), I get a <No Such
> Operation 'submitOrder'> error.
>
> I have read thru Anne's blog and her postings
> regarding using document literal and document literal
> wrapped. Since I couldn't have a method which is the
> same as the qname, I was trying to include an
> 'operation' in the deploy.wsdd's service element to
> map the qname to a method call. I don't have much of a
> choice, but to use document literal. Can anyone see
> any obvious problems in the configurations below?
>
> Following are some details:
> ---------------------------
> deploy.wsdd
> <service name="ClarifyTicketService"
> provider="java:RPC" style="document" use="literal">
>     <parameter name="className"
> value="com.mycom.services.submit.SubmitOrder"/>
>     <parameter name="allowedMethods" value="*"/>
>     <operation name="submitDELLOrder"
>                qname="submitDELLOrder"
>                returnQName="submitDELLOrderResponse"
>                returnType="xsd:string">
>       <parameter name="od" type="ns0:submitOrder"
> xmlns:ns0="http://mycom.com/schemas"/>
>     </operation>
>
>     <typeMapping
>       xmlns:ns="http://mycom.com/schemas"
>       qname="ns:submitOrder"
>
> type="java:com.mycom.services.submit.OrderDetails"
>
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>       encodingStyle=""
>     />
>   </service>
> -------------
> Schema
> -------
> <xsd:element name="submitOrder"
> type="ord:OrderDetails"/>
> <xsd:complexType name="OrderDetails">
>   <xsd:sequence>
>     <xsd:element ref="ord:ItemName"/>
>     <xsd:element ref="ord:Quantity"/>
>   </xsd:sequence>
> </xsd:complexType>
> -------
> Implementation of SubmitOrder
> -----------------------------
> public String submitDELLOrder(OrderDetails od) {
>   String tmpStr = "<ItemName>" + od.getItemName() +
> "</ItemName>";
>   return tmpStr;
> }
> -------------------------------
>
> The following message is what I am sending via HTTP
> POST
> --------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
>     xmlns:ns1="http://mycom.com/schemas">
>   <SOAP-ENV:Body xmlns:ns0="http://mycom.com/schemas">
>            <ns0:submitOrder>
>                 <ItemName>xyz</ItemName>
>                 <Quantity>5</Quantity>
>            </ns0:submitOrder>
>   </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> -------------------------------------
>
> Any help would be HIGHLY appreciated.
>
> Regards,
> Vishy
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>