Sachin,

I've attached the e-mails I've received from Davanum Srinivas regarding this.

-Swamy


-----Original Message-----
From: Sachin [mailto:[EMAIL PROTECTED]
Sent: Monday, June 30, 2003 11:56 PM
To: Axis userList (E-mail)
Subject: Creating message-style services


Hi All,
        well i have posted two problem related to XML Document handling via
web Services but got no response.

but After some study on net and help of some users.I am able to find that
for this i have to create message-style service Axis has given four methods
for it
public Element [] method(Element [] bodies)
public SOAPBodyElement [] method (SOAPBodyElement [] bodies)
public Document method(Document body)
public void method(SOAPEnvelope req, SOAPEnvelope resp)

but only example of public Element [] method(Element [] bodies) is given so
if i have to look for more example
then where should i go

Axis Site has very little mentioning About it so more documentation need to
be provided on these topics or
Anyone can suggest me about it.

Thanks




--- Begin Message ---
Try this...

--- Anjaneya Swamy Varada <[EMAIL PROTECTED]> wrote:
> Hi Bhanu,
> 
> Were you able to create a "message" style service using the below signature:
> 
> org.w3c.dom.Document parseData(org.w3c.dom.Document doc){
>       // logic processed
>       return doc;
> }
> 
> When I am trying to invoke the server I get the following error:
> 
> java.io.IOException: No serializer found for class 
> org.apache.xerces.dom.DeferredDocumentImpl in
> registry [EMAIL PROTECTED]
>         at
>
org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1273)
>         at
> org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:787)
>         at
>
org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(SerializationContextImpl.java:858)
>         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:155)
>         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:413)
>         at org.apache.axis.message.MessageElement.output(MessageElement.java:779)
>         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
>         at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:483)
>         at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:375)
>         at org.apache.axis.Message.getContentType(Message.java:400)
>         at 
> org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:341)
>         at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122)
>         at 
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
>         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
>         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2526)
>         at org.apache.axis.client.Call.invoke(Call.java:2515)
>         at org.apache.axis.client.Call.invoke(Call.java:2210)
>         at org.apache.axis.client.Call.invoke(Call.java:2133)
>         at org.apache.axis.client.Call.invoke(Call.java:1656)
>         at messages.TestLogMsgWithDocument.doit(TestLogMsgWithDocument.java:49)
>         at messages.TestLogMsgWithDocument.main(TestLogMsgWithDocument.java:62)
> 
> Any ideas?
> 
> Thanks
> Swamy
> 
> 
> -----Original Message-----
> From: Bhanu Pabreja [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 05, 2003 7:43 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Document Style web service bug
> 
> 
> Great idea I will try to implement it tommorow but I hope it will process to
> do this method ...
> 
> org.w3c.dom.Document parseData(org.w3c.dom.Document doc){
>       // logic processed
>       return doc;
> }
> 
> -----Original Message-----
> From: Rajal Shah [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 05, 2003 6:44 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Document Style web service bug
> 
> 
> Dumdum (BP)
> 
> You don't really need to create a WSDL, (look at my sample I provided you)..
> The service in my example code it good enough to be deployed as is.. You can
> deploy it and get the WSDL definition directly using the ?WSDL query on your
> service.
> 
> --
> Rajal
> 
> 
> -----Original Message-----
> From: dumdum 420 [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 05, 2003 3:14 PM
> To: [EMAIL PROTECTED]
> Subject: Document Style web service bug
> 
> 
> I have generated a wsdl file using Java2WSDL utility :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="urn:firmTaxonomy"
> xmlns="http://schemas.xmlsoap.org/wsdl/";
> xmlns:apachesoap="http://xml.apache.org/xml-soap";
> xmlns:impl="urn:firmTaxonomy" xmlns:intf="urn:firmTaxonomy"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> <wsdl:types>
>   <schema targetNamespace="" xmlns="http://www.w3.org/2001/XMLSchema";>
>    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>    <element name="in0" type="xsd:string"/>
>    <element
> name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReturn"
> type="xsd:string"/>
>    <element name="in0" type="xsd:string"/>
>    <element name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDReturn"
> type="xsd:string"/>
>    <element name="in0" type="xsd:string"/>
>    <element name="in1" type="xsd:string"/>
>    <element name="fetchTaxonomyPreferredTermBranchReturn"
> type="xsd:string"/>
>    <element name="in0" type="xsd:string"/>
>    <element name="in1" type="xsd:string"/>
>    <element name="fetchTaxonomyPreferredTermReturn" type="xsd:string"/>
>    <element name="fetchFirmTaxonomyReturn" type="xsd:string"/>
>   </schema>
> </wsdl:types>
> 
>    <wsdl:message name="fetchTaxonomyPreferredTermBranchResponse">
> 
>       <wsdl:part element="fetchTaxonomyPreferredTermBranchReturn"
> name="fetchTaxonomyPreferredTermBranchReturn"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message
> name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDRequest">
> 
>       <wsdl:part element="in0" name="in0"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="fetchFirmTaxonomyRequest">
> 
>    </wsdl:message>
> 
>    <wsdl:message name="fetchTaxonomyPreferredTermResponse">
> 
>       <wsdl:part element="fetchTaxonomyPreferredTermReturn"
> name="fetchTaxonomyPreferredTermReturn"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message
> name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDResponse">
> 
>       <wsdl:part
> element="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReturn"
> name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReturn"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="fetchFirmTaxonomyResponse">
> 
>       <wsdl:part element="fetchFirmTaxonomyReturn"
> name="fetchFirmTaxonomyReturn"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message
> name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDRequest">
> 
>       <wsdl:part element="in0" name="in0"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message
> name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDResponse">
> 
>       <wsdl:part
> element="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDReturn"
> name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDReturn"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="fetchTaxonomyPreferredTermBranchRequest">
> 
>       <wsdl:part element="in0" name="in0"/>
> 
>       <wsdl:part element="in1" name="in1"/>
> 
>    </wsdl:message>
> 
>    <wsdl:message name="fetchTaxonomyPreferredTermRequest">
> 
>       <wsdl:part element="in0" name="in0"/>
> 
>       <wsdl:part element="in1" name="in1"/>
> 
>    </wsdl:message>
> 
>    <wsdl:portType name="FirmTaxonomyModel">
> 
>       <wsdl:operation
> name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermID"
> parameterOrder="in0">
> 
>          <wsdl:input
> message="intf:fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReques
> t"
> name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDRequest"/>
> 
=== message truncated ===

=====
Davanum Srinivas - http://webservices.apache.org/~dims/

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Attachment: deploy.wsdd
Description: deploy.wsdd

import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Document;

import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import java.io.ByteArrayInputStream;

public class MessageClient {
    public static void main(String[] args) throws Exception {
        Options opts = new Options(args);
        args = opts.getRemainingArgs();
        Service service = ServiceFactory.newInstance().createService(null);
        Call call = service.createCall();
        call.setTargetEndpointAddress("http://localhost:8080/axis/services/Message";);
        call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        call.setProperty(org.apache.axis.AxisEngine.PROP_SEND_XSI, Boolean.FALSE);
        call.setOperationName(new QName("http://message.test/";, "parseData"));
        call.addParameter("in0", XMLType.SOAP_DOCUMENT, ParameterMode.IN);
        call.setReturnType(XMLType.SOAP_DOCUMENT);
        String xml = "<hello>test</hello>";
        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
        Document doc = XMLUtils.newDocument(bais);
        Document result = (Document) call.invoke(new Object[]{doc});
        System.out.println(XMLUtils.DocumentToString(result));
    }
}
public class MessageService {
    public org.w3c.dom.Document parseData(org.w3c.dom.Document doc) {
        return doc;
    }
}

--- End Message ---
--- Begin Message ---
yes, use latest nightly build.

--- Anjaneya Swamy Varada <[EMAIL PROTECTED]> wrote:
> Hi Srinivas,
> 
> Thaks for the response. 
> 
> I am using Axis 1.1 RC2 and it looks like in 1.1 RC2 
> org.apache.axis.encoding.XMLType doesn't
> has "SOAP_DOCUMENT" as a field. Can we make this to work with 1.1 RC2? should I get 
> recent
> nightly build? Do you know the stable version of recent nightly builds?
> 
> Thanks
> Swamy
> 
> 
> -----Original Message-----
> From: Davanum Srinivas [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 11, 2003 2:27 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: Document Style web service bug
> 
> 
> Try this...
> 
> --- Anjaneya Swamy Varada <[EMAIL PROTECTED]> wrote:
> > Hi Bhanu,
> > 
> > Were you able to create a "message" style service using the below signature:
> > 
> > org.w3c.dom.Document parseData(org.w3c.dom.Document doc){
> >     // logic processed
> >     return doc;
> > }
> > 
> > When I am trying to invoke the server I get the following error:
> > 
> > java.io.IOException: No serializer found for class 
> > org.apache.xerces.dom.DeferredDocumentImpl
> in
> > registry [EMAIL PROTECTED]
> >         at
> >
>
org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImpl.java:1273)
> >         at
> > org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java:787)
> >         at
> >
>
org.apache.axis.encoding.SerializationContextImpl.outputMultiRefs(SerializationContextImpl.java:858)
> >         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:155)
> >         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:413)
> >         at org.apache.axis.message.MessageElement.output(MessageElement.java:779)
> >         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
> >         at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:483)
> >         at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:375)
> >         at org.apache.axis.Message.getContentType(Message.java:400)
> >         at 
> > org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:341)
> >         at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:122)
> >         at 
> > org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
> >         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
> >         at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
> >         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
> >         at org.apache.axis.client.Call.invokeEngine(Call.java:2526)
> >         at org.apache.axis.client.Call.invoke(Call.java:2515)
> >         at org.apache.axis.client.Call.invoke(Call.java:2210)
> >         at org.apache.axis.client.Call.invoke(Call.java:2133)
> >         at org.apache.axis.client.Call.invoke(Call.java:1656)
> >         at messages.TestLogMsgWithDocument.doit(TestLogMsgWithDocument.java:49)
> >         at messages.TestLogMsgWithDocument.main(TestLogMsgWithDocument.java:62)
> > 
> > Any ideas?
> > 
> > Thanks
> > Swamy
> > 
> > 
> > -----Original Message-----
> > From: Bhanu Pabreja [mailto:[EMAIL PROTECTED]
> > Sent: Monday, May 05, 2003 7:43 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Document Style web service bug
> > 
> > 
> > Great idea I will try to implement it tommorow but I hope it will process to
> > do this method ...
> > 
> > org.w3c.dom.Document parseData(org.w3c.dom.Document doc){
> >     // logic processed
> >     return doc;
> > }
> > 
> > -----Original Message-----
> > From: Rajal Shah [mailto:[EMAIL PROTECTED]
> > Sent: Monday, May 05, 2003 6:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Document Style web service bug
> > 
> > 
> > Dumdum (BP)
> > 
> > You don't really need to create a WSDL, (look at my sample I provided you)..
> > The service in my example code it good enough to be deployed as is.. You can
> > deploy it and get the WSDL definition directly using the ?WSDL query on your
> > service.
> > 
> > --
> > Rajal
> > 
> > 
> > -----Original Message-----
> > From: dumdum 420 [mailto:[EMAIL PROTECTED]
> > Sent: Monday, May 05, 2003 3:14 PM
> > To: [EMAIL PROTECTED]
> > Subject: Document Style web service bug
> > 
> > 
> > I have generated a wsdl file using Java2WSDL utility :
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> > <wsdl:definitions targetNamespace="urn:firmTaxonomy"
> > xmlns="http://schemas.xmlsoap.org/wsdl/";
> > xmlns:apachesoap="http://xml.apache.org/xml-soap";
> > xmlns:impl="urn:firmTaxonomy" xmlns:intf="urn:firmTaxonomy"
> > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> > <wsdl:types>
> >   <schema targetNamespace="" xmlns="http://www.w3.org/2001/XMLSchema";>
> >    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> >    <element name="in0" type="xsd:string"/>
> >    <element
> > name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReturn"
> > type="xsd:string"/>
> >    <element name="in0" type="xsd:string"/>
> >    <element name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDReturn"
> > type="xsd:string"/>
> >    <element name="in0" type="xsd:string"/>
> >    <element name="in1" type="xsd:string"/>
> >    <element name="fetchTaxonomyPreferredTermBranchReturn"
> > type="xsd:string"/>
> >    <element name="in0" type="xsd:string"/>
> >    <element name="in1" type="xsd:string"/>
> >    <element name="fetchTaxonomyPreferredTermReturn" type="xsd:string"/>
> >    <element name="fetchFirmTaxonomyReturn" type="xsd:string"/>
> >   </schema>
> > </wsdl:types>
> > 
> >    <wsdl:message name="fetchTaxonomyPreferredTermBranchResponse">
> > 
> >       <wsdl:part element="fetchTaxonomyPreferredTermBranchReturn"
> > name="fetchTaxonomyPreferredTermBranchReturn"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message
> > name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDRequest">
> > 
> >       <wsdl:part element="in0" name="in0"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message name="fetchFirmTaxonomyRequest">
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message name="fetchTaxonomyPreferredTermResponse">
> > 
> >       <wsdl:part element="fetchTaxonomyPreferredTermReturn"
> > name="fetchTaxonomyPreferredTermReturn"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message
> > name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDResponse">
> > 
> >       <wsdl:part
> > element="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReturn"
> > name="fetchTaxonomyPreferredTermBranchOnBasisOfPreferredTermIDReturn"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message name="fetchFirmTaxonomyResponse">
> > 
> >       <wsdl:part element="fetchFirmTaxonomyReturn"
> > name="fetchFirmTaxonomyReturn"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message
> > name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDRequest">
> > 
> >       <wsdl:part element="in0" name="in0"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message
> > name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDResponse">
> > 
> >       <wsdl:part
> > element="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDReturn"
> > name="fetchTaxonomyPreferredTermOnBasisOfPreferredTermIDReturn"/>
> > 
> >    </wsdl:message>
> > 
> >    <wsdl:message name="fetchTaxonomyPreferredTermBranchRequest">
> 
=== message truncated ===


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

--- End Message ---

Reply via email to