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 fa...@de9.ime.eb.br on 2005/09/08 18:20:17 UTC

How to collect a SOAP Message

Hello all,

Is there a way to implement a web service that can collect all the SOAPBody from
a SOAP Message? For instance, I have a client that sends the soap message to my
Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is most
important. And then, parse it as a XML file. 

I don't know how it could be possible. Because as I know, web services receives
the SOAP Message, but takes only the data type required. 

How my web service could be implemented to receives all the SOAPBody and
manually I could extract the information inside it? And the client? How does it
call this specific web service?

Thanks a lot for all the help,

Fabrício.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Re: How to collect a SOAP Message

Posted by fa...@de9.ime.eb.br.
Yes, I really need the SOAP Body.

I was studying the use of SOAP Handlers to achieve my intention. And it was:

1. I would create a web service with a generic input. (String)
2. I would create a server SOAP Handler to receive all messages going to my web
service.
3. The SOAP Handler would transform the SOAP Body content in a String to keep
up
with web service input. So, in my imagination, I could send any complex types
(Person: [Name,  age,  salary] ; Address: [street, city, state, coutry] ;
product: [Name, price] ;) from different clients. My Handler would get these
complex types and change them to a string and pass to web service as a String
now.

4. My web service would receive the Sting (but the content of it is a complex
type structure originally sent) and transform it to a Document (DOM) and them
extracts the information. As I want to arrive. 

So I would have a web service that could receive any complex type... without a
previously knowledge about the type being receiving and without changes client
method calls. The same client can pass a Person Java Bean, a String, a Adress
Java Bean to this my web service. 

But in my studies I noticed that the web service still needs a (DE)Serializer
for a type. I implemented my web service with a handler and sent a String form
client. Works fine. But,  when I sent a Person Java Bean an error saying:

No serializer found for class Person ...

was sent... And my Handler didn't receive anything as I track.

So, my intentions to transform a complex type to String inside the Handler
falled down.

I think I must abandon my idea, and make a web service to treat a single data
type, or make a web service that extract information from XML, but ensuring
that all my clients will sent only native XML documents, inside the SOAP Body.

I would like to thank all of you who help me with my crazy questions.

:-)

Fabrício.


Citando Linus Kamb <li...@iris.washington.edu>:

> Do you really need the SOAP Body, or do you just want a way to send arbitrary
> XML documents?
> 
> You can do the latter by having a doc/lit(wrapped) service that takes
> xsd:anyType (or 
> apachesoap:Element if you don't care about interoperability).  That produces
> a service 
> interface method signature of:
> 
> <return msg type> serviceMethod(org.w3c.dom.Element parameter);
> 
> If you use xsd:anyType in the wsdl, you need to add a type mapping in the
> wsdd from 
> xsd:anyType to Element using
> org.apache.axis.encoding.ser.Element(De)SerializerFactory.
> 
> fabricio@de9.ime.eb.br wrote:
> > Hello all,
> > 
> > Is there a way to implement a web service that can collect all the SOAPBody
> from
> > a SOAP Message? For instance, I have a client that sends the soap message
> to my
> > Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is
> most
> > important. And then, parse it as a XML file. 
> > 
> > I don't know how it could be possible. Because as I know, web services
> receives
> > the SOAP Message, but takes only the data type required. 
> > 
> > How my web service could be implemented to receives all the SOAPBody and
> > manually I could extract the information inside it? And the client? How
> does it
> > call this specific web service?
> > 
> > Thanks a lot for all the help,
> > 
> > Fabrício.
> > 
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> 


 

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Re: How to collect a SOAP Message

Posted by Linus Kamb <li...@iris.washington.edu>.
Do you really need the SOAP Body, or do you just want a way to send arbitrary XML documents?

You can do the latter by having a doc/lit(wrapped) service that takes xsd:anyType (or 
apachesoap:Element if you don't care about interoperability).  That produces a service 
interface method signature of:

<return msg type> serviceMethod(org.w3c.dom.Element parameter);

If you use xsd:anyType in the wsdl, you need to add a type mapping in the wsdd from 
xsd:anyType to Element using org.apache.axis.encoding.ser.Element(De)SerializerFactory.

fabricio@de9.ime.eb.br wrote:
> Hello all,
> 
> Is there a way to implement a web service that can collect all the SOAPBody from
> a SOAP Message? For instance, I have a client that sends the soap message to my
> Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is most
> important. And then, parse it as a XML file. 
> 
> I don't know how it could be possible. Because as I know, web services receives
> the SOAP Message, but takes only the data type required. 
> 
> How my web service could be implemented to receives all the SOAPBody and
> manually I could extract the information inside it? And the client? How does it
> call this specific web service?
> 
> Thanks a lot for all the help,
> 
> Fabrício.
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.

Re: How to collect a SOAP Message

Posted by Steve Viens <sv...@gmail.com>.
Fabrício, this might help:
  Take a look at the doPost method.
 
http://cvs.apache.org/viewcvs.cgi/ws-juddi/src/java/org/apache/juddi/registry/AbstractService.java?view=markup
 Steve

 On 9/8/05, Stefan Schuster <ss...@pironet-ndh.com> wrote: 
> 
> The projects WSIF and JROM may be just what you want. Take a look,
> 
> best regards,
> 
> Stefan
> 
> fabricio@de9.ime.eb.br wrote:
> 
> >Yeah,
> >
> >it sounds strange, but I think by this way I could realize my dream about 
> make a
> >web service that can receive any complex type. I could extract the 
> information
> >about those analysing the SOAPMessage. It's being hard to achieve it! :-/
> >
> >Thanks a lot.
> >
> >Fabricio.
> >
> >Citando Stefan Schuster <ss...@pironet-ndh.com>:
> >
> >
> >
> >>Hi,
> >>
> >>take a look at MessageContext.getMessage() -> should allow access to the
> >>SOAP
> >>message. But think about it if you really want to do this, sounds like
> >>reinventing the wheel...
> >>
> >>You may also be interessted in the service styles (wrapped, document,
> >>etc,...) some
> >>of them may give you an XML-document inside the service impl.
> >>
> >>Best Regards,
> >>
> >>Stefan
> >>
> >>fabricio@de9.ime.eb.br wrote:
> >>
> >>
> >>
> >>>Hello all,
> >>>
> >>>Is there a way to implement a web service that can collect all the 
> SOAPBody
> >>>
> >>>
> >>from
> >>
> >>
> >>>a SOAP Message? For instance, I have a client that sends the soap 
> message to
> >>>
> >>>
> >>my
> >>
> >>
> >>>Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is 
> most
> >>>important. And then, parse it as a XML file.
> >>>
> >>>I don't know how it could be possible. Because as I know, web services
> >>>
> >>>
> >>receives
> >>
> >>
> >>>the SOAP Message, but takes only the data type required.
> >>>
> >>>How my web service could be implemented to receives all the SOAPBody 
> and
> >>>manually I could extract the information inside it? And the client? How 
> does
> >>>
> >>>
> >>it
> >>
> >>
> >>>call this specific web service?
> >>>
> >>>Thanks a lot for all the help,
> >>>
> >>>Fabrício.
> >>>
> >>>----------------------------------------------------------------
> >>>This message was sent using IMP, the Internet Messaging Program.
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
> >----------------------------------------------------------------
> >This message was sent using IMP, the Internet Messaging Program.
> >
> >
> 
> 
>

Re: How to collect a SOAP Message

Posted by Stefan Schuster <ss...@pironet-ndh.com>.
The projects WSIF and JROM may be just what you want. Take a look,

best regards,

Stefan

fabricio@de9.ime.eb.br wrote:

>Yeah,
>
>it sounds strange, but I think by this way I could realize my dream about make a
>web service that can receive any complex type. I could extract the information
>about those analysing the SOAPMessage. It's being hard to achieve it! :-/
>
>Thanks a lot.
>
>Fabricio.
>
>Citando Stefan Schuster <ss...@pironet-ndh.com>:
>
>  
>
>>Hi,
>>
>>take a look at MessageContext.getMessage() -> should allow access to the 
>>SOAP
>>message. But think about it if you really want to do this, sounds like
>>reinventing the wheel...
>>
>>You may also be interessted in the service styles (wrapped, document, 
>>etc,...) some
>>of them may give you an XML-document inside the service impl.
>>
>>Best Regards,
>>
>>Stefan
>>
>>fabricio@de9.ime.eb.br wrote:
>>
>>    
>>
>>>Hello all,
>>>
>>>Is there a way to implement a web service that can collect all the SOAPBody
>>>      
>>>
>>from
>>    
>>
>>>a SOAP Message? For instance, I have a client that sends the soap message to
>>>      
>>>
>>my
>>    
>>
>>>Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is most
>>>important. And then, parse it as a XML file. 
>>>
>>>I don't know how it could be possible. Because as I know, web services
>>>      
>>>
>>receives
>>    
>>
>>>the SOAP Message, but takes only the data type required. 
>>>
>>>How my web service could be implemented to receives all the SOAPBody and
>>>manually I could extract the information inside it? And the client? How does
>>>      
>>>
>>it
>>    
>>
>>>call this specific web service?
>>>
>>>Thanks a lot for all the help,
>>>
>>>Fabrício.
>>>
>>>----------------------------------------------------------------
>>>This message was sent using IMP, the Internet Messaging Program.
>>> 
>>>
>>>      
>>>
>>    
>>
>
>
>
>
>----------------------------------------------------------------
>This message was sent using IMP, the Internet Messaging Program.
>  
>



Re: How to collect a SOAP Message

Posted by fa...@de9.ime.eb.br.
Yeah,

it sounds strange, but I think by this way I could realize my dream about make a
web service that can receive any complex type. I could extract the information
about those analysing the SOAPMessage. It's being hard to achieve it! :-/

Thanks a lot.

Fabricio.

Citando Stefan Schuster <ss...@pironet-ndh.com>:

> Hi,
> 
> take a look at MessageContext.getMessage() -> should allow access to the 
> SOAP
> message. But think about it if you really want to do this, sounds like
> reinventing the wheel...
> 
> You may also be interessted in the service styles (wrapped, document, 
> etc,...) some
> of them may give you an XML-document inside the service impl.
> 
> Best Regards,
> 
> Stefan
> 
> fabricio@de9.ime.eb.br wrote:
> 
> >Hello all,
> >
> >Is there a way to implement a web service that can collect all the SOAPBody
> from
> >a SOAP Message? For instance, I have a client that sends the soap message to
> my
> >Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is most
> >important. And then, parse it as a XML file. 
> >
> >I don't know how it could be possible. Because as I know, web services
> receives
> >the SOAP Message, but takes only the data type required. 
> >
> >How my web service could be implemented to receives all the SOAPBody and
> >manually I could extract the information inside it? And the client? How does
> it
> >call this specific web service?
> >
> >Thanks a lot for all the help,
> >
> >Fabrício.
> >
> >----------------------------------------------------------------
> >This message was sent using IMP, the Internet Messaging Program.
> >  
> >
> 
> 




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Re: How to collect a SOAP Message

Posted by Stefan Schuster <ss...@pironet-ndh.com>.
Hi,

take a look at MessageContext.getMessage() -> should allow access to the 
SOAP
message. But think about it if you really want to do this, sounds like
reinventing the wheel...

You may also be interessted in the service styles (wrapped, document, 
etc,...) some
of them may give you an XML-document inside the service impl.

Best Regards,

Stefan

fabricio@de9.ime.eb.br wrote:

>Hello all,
>
>Is there a way to implement a web service that can collect all the SOAPBody from
>a SOAP Message? For instance, I have a client that sends the soap message to my
>Web Service (WSA). My WSA must collects the SOAP Message, SOAP Body is most
>important. And then, parse it as a XML file. 
>
>I don't know how it could be possible. Because as I know, web services receives
>the SOAP Message, but takes only the data type required. 
>
>How my web service could be implemented to receives all the SOAPBody and
>manually I could extract the information inside it? And the client? How does it
>call this specific web service?
>
>Thanks a lot for all the help,
>
>Fabrício.
>
>----------------------------------------------------------------
>This message was sent using IMP, the Internet Messaging Program.
>  
>



RE: How to collect a SOAP Message

Posted by Zheng Li <zl...@it.swin.edu.au>.
The SOAP monitor can intercept the SOAP messages for a web service. After
get the SOAP message, just use a XML parser to extract the info you want. I
just programmed a SOAPMonitorClient which can get the SOAP request and
respond messages for a service and extract the operation and parameters from
SOAP body. It's easy, mate.

-----Original Message-----
From: fabricio@de9.ime.eb.br [mailto:fabricio@de9.ime.eb.br] 
Sent: 2005年9月9日 2:20
To: axis-user@ws.apache.org
Subject: How to collect a SOAP Message


Hello all,

Is there a way to implement a web service that can collect all the SOAPBody
from a SOAP Message? For instance, I have a client that sends the soap
message to my Web Service (WSA). My WSA must collects the SOAP Message, SOAP
Body is most important. And then, parse it as a XML file. 

I don't know how it could be possible. Because as I know, web services
receives the SOAP Message, but takes only the data type required. 

How my web service could be implemented to receives all the SOAPBody and
manually I could extract the information inside it? And the client? How does
it call this specific web service?

Thanks a lot for all the help,

Fabrício.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.