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 Bruno Negrao <bn...@gmail.com> on 2006/07/06 02:52:28 UTC

Urgent Help - Newbie

Hi guys,

I'm new to SOAP and I need (quickly) to access a SOAP server. I need to use
the axis classes to create a SOAP post just like this one bellow and I dont
know how to do it:

POST /pfappspabxutils HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Host: pfdesenv.planetarium.com.br:8080
User-Agent: SOAP::Lite/Perl/0.67
Content-Length: 1116
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa"

<?xml version="1.0" encoding="UTF-8"?>
   <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" soap:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
         <AgendaPesquisa xmlns="http://172.16.10.103:8080/AgendaPesquisa">
            <tipo>C</tipo>
            <dono xsi:nil="true" />
            <posicao xsi:nil="true" />
            <nome xsi:nil="true" />
            <ramal xsi:nil="true" />
            <tel_comercial_ddi xsi:nil="true" />
            <tel_comercial_ddd xsi:nil="true" />
            <tel_comercial xsi:nil="true" />
            <tel_residencial_ddi xsi:nil="true" />
            <tel_residencial_ddd xsi:nil="true" />
            <tel_residencial xsi:nil="true" />
            <tel_celular_ddi xsi:nil="true" />
            <tel_celular_ddd xsi:nil="true" />
            <tel_celular xsi:nil="true" />
            <empresa xsi:nil="true" />
            <cargo xsi:nil="true" />
            <setor xsi:nil="true" />
            <endereco xsi:nil="true" />
            <bairro xsi:nil="true" />
            <cidade xsi:nil="true" />
            <estado xsi:nil="true" />
            <pais xsi:nil="true" />
            <cep xsi:nil="true" />
            <email xsi:nil="true" />
         </AgendaPesquisa>
      </soap:Body>
   </soap:Envelope>

Can someone just write a sample code of how to do this and send to me?

Thank you very much,
bruno

Re: Urgent Help - Newbie

Posted by Bruno Negrao <bn...@gmail.com>.
ERRATA: the contact objects go inside the
<ListaContatosPesquisa>...</ListaContatosPesquisa> tags.

sorry.

I need to create a contact object for each
<ListaContatosPesquisa></ListaContatosPesquisa> returned from the
server.

thank you,
bruno

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Urgent Help - Newbie

Posted by Bruno Negrao <bn...@gmail.com>.
Guys, thank you very much for the explanations.

I'm already using tcpmon, very helpful. Bellow is the message sent
from the server, the one I have to deserialize. The method I called
was "AgendaPesquisa". It's a method to search in a contacts catalog
for a contact(a person) with some characterisctic. The server then
returns a list of contacts that matched the search. The contact
objects are contained inside the <AgendaPesquisa> ...
</AgendaPesquisa> tags.
thank you for any help.

HTTP/1.0 200 OK
Content-length: 1750

<?xml version="1.0"?>
   <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
         <AgendaPesquisa>
            <status>0</status>
            <ListaContatosPesquisa>
               <tipo>C</tipo>
               <dono>1920</dono>
               <posicao>1</posicao>
               <nome>Eu</nome>
               <ramal>1900</ramal>
               <tel_comercial_ddi></tel_comercial_ddi>
               <tel_comercial_ddd></tel_comercial_ddd>
               <tel_comercial></tel_comercial>
               <tel_residencial_ddi></tel_residencial_ddi>
               <tel_residencial_ddd></tel_residencial_ddd>
               <tel_residencial></tel_residencial>
               <tel_celular_ddi></tel_celular_ddi>
               <tel_celular_ddd></tel_celular_ddd>
               <tel_celular></tel_celular>
               <empresa></empresa>
               <cargo></cargo>
               <setor></setor>
               <endereco></endereco>
               <bairro></bairro>
               <cidade></cidade>
               <estado></estado>
               <pais></pais>
               <cep></cep>
               <email></email>
            </ListaContatosPesquisa>
            <ListaContatosPesquisa>
               <tipo>C</tipo>
               <dono>1931</dono>
               <posicao>1</posicao>
               <nome>Bla2</nome>
               <ramal></ramal>
               <tel_comercial_ddi></tel_comercial_ddi>
               <tel_comercial_ddd></tel_comercial_ddd>
               <tel_comercial></tel_comercial>
               <tel_residencial_ddi></tel_residencial_ddi>
               <tel_residencial_ddd></tel_residencial_ddd>
               <tel_residencial></tel_residencial>
               <tel_celular_ddi></tel_celular_ddi>
               <tel_celular_ddd></tel_celular_ddd>
               <tel_celular></tel_celular>
               <empresa></empresa>
               <cargo></cargo>
               <setor></setor>
               <endereco></endereco>
               <bairro></bairro>
               <cidade></cidade>
               <estado></estado>
               <pais></pais>
               <cep></cep>
               <email></email>
            </ListaContatosPesquisa>
         </AgendaPesquisa>
      </soap:Body>
   </soap:Envelope>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Urgent Help - Newbie

Posted by robert lazarski <ro...@gmail.com>.
You do not need a WSDL, but in situations like these it is helpful
because seemingly your only reference how to make the call is in perl
. Now if you're familair with how the perl code is doing things,
that'll help.

First advice: use axis2 . At least in my case you're more likely to
get help. Those deserializing errors don't happen in axis2 - or at
least are rare.

Looking at your the envelope, it's in português. Vou tentar ajudar!

Download the axis2-std-SNAPSHOT-src.zip  and
axis2-std-SNAPSHOT-bin.zip from the nightlies here:

http://people.apache.org/dist/axis2/nightly/

Now you don't need a server, just a client. In the source dir, follow
this example , ignoring the server as you just want to the client -
try testEchoBean()  .

modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java

For debugging, you're going to need something like tcpmon to see what
you are sending in case you get errors.

HTH,
Robert
http://www.braziloutsource.com/

On 7/6/06, Bruno Negrao <bn...@gmail.com> wrote:
> I don't have it. Would I need it? the server is not java.
> There's a soap client here running in perl using SOAP::Lite that doesn't
> need any bureaucracy.
> Now i can send a post that the server successfully answers. But I cannot
> deserialize it. The answer the server sends is a list of Person objects (in
> xml, of course).
>
> What't the problem in deserializing it? is the an not-bureaucratic java
> class I can use to deserialize it? would I ever need a DTD or WSDL
> available? (in perl i don't need nothing of these...)
>
> thank you,
>  bruno
>
>
> On 7/6/06, robert lazarski <ro...@gmail.com> wrote:
> >
>  You can use jmeter to send this exact message, and then you'll have a
> response.
>
> How to do that programatically is a much bigger question. Do you have a wsdl
> ?
>
> HTH,
> Robert
>  http://www.braziloutsource.com/
>
> On 7/5/06, Bruno Negrao <bn...@gmail.com> wrote:
> > Hi guys,
> >
> > I'm new to SOAP and I need (quickly) to access a SOAP server. I need to
> use
> > the axis classes to create a SOAP post just like this one bellow and I
> dont
> > know how to do it:
> >
> >  POST /pfappspabxutils HTTP/1.1
> > TE: deflate,gzip;q=0.3
> > Connection: TE, close
>  > Accept: text/xml
> > Accept: multipart/*
> >  Accept: application/soap
> > Host: pfdesenv.planetarium.com.br:8080
> > User-Agent: SOAP::Lite/Perl/0.67
> > Content-Length: 1116
> > Content-Type: text/xml; charset=utf-8
> > SOAPAction: "
> > http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa "
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >    <soap:Envelope
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > xmlns:soapenc="
> http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema "
> > soap:encodingStyle="
> > http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/">
> >       <soap:Body>
> >          <AgendaPesquisa xmlns="
> > http://172.16.10.103:8080/AgendaPesquisa ">
> >             <tipo>C</tipo>
> >             <dono xsi:nil="true" />
> >             <posicao xsi:nil="true" />
> >             <nome xsi:nil="true" />
> >             <ramal xsi:nil="true" />
> >             <tel_comercial_ddi xsi:nil="true" />
> >              <tel_comercial_ddd xsi:nil="true" />
> >             <tel_comercial xsi:nil="true" />
> >              <tel_residencial_ddi xsi:nil="true" />
> >             <tel_residencial_ddd xsi:nil="true" />
> >             <tel_residencial xsi:nil="true" />
> >              <tel_celular_ddi xsi:nil="true" />
> >             <tel_celular_ddd xsi:nil="true" />
> >              <tel_celular xsi:nil="true" />
> >             <empresa xsi:nil="true" />
> >             <cargo xsi:nil="true" />
> >             <setor xsi:nil="true" />
> >             <endereco xsi:nil="true" />
> >             <bairro xsi:nil="true" />
> >             <cidade xsi:nil="true" />
> >             <estado xsi:nil="true" />
> >             <pais xsi:nil="true" />
> >             <cep xsi:nil="true" />
> >             <email xsi:nil="true" />
> >          </AgendaPesquisa>
> >       </soap:Body>
> >    </soap:Envelope>
> >
> >  Can someone just write a sample code of how to do this and send to me?
> >
> > Thank you very much,
> > bruno
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Urgent Help - Newbie

Posted by Anne Thomas Manes <at...@gmail.com>.
A WSDL file is always a useful thing to have when exchanging SOAP
messages. It tells you exactly what the messages are supposed to look
like. It has nothing to do with whether or not the server is written
in Java. The reason you want the WSDL is to allow any client to talk
to the service, regardless of the type of language you want to use.

If you had a WSDL file, you could generate the Java client using
WSDL2Java. It would automatically generate a proxy that maps the XML
types to Java types, and automatically constructs/parses the incoming
and outgoing SOAP messages.

Perl is a dandy language for string manipulation, therefore it's
pretty trivial to construct and parse XML. Java is not so good at
string manipulation, so it's easier if you can convert the XML to Java
objects. But if you prefer, you can use JAXP to construct/parse the
SOAP messages programmatically. But without a WSDL, you'll have a lot
more difficulty processing the return message. (Did they give you a
sample of a return message?)

Java is a strongly typed language, therefore it really wants to know
what type of data it is receiving. The sample document--in which all
elements are null-- gives no clue regarding the types of each of the
elements. If you can't get a WSDL--or at least an XML Schema of the
message formats--I guess you can just treat them all as strings.

Anne



On 7/6/06, Bruno Negrao <bn...@gmail.com> wrote:
> I don't have it. Would I need it? the server is not java.
> There's a soap client here running in perl using SOAP::Lite that doesn't
> need any bureaucracy.
> Now i can send a post that the server successfully answers. But I cannot
> deserialize it. The answer the server sends is a list of Person objects (in
> xml, of course).
>
> What't the problem in deserializing it? is the an not-bureaucratic java
> class I can use to deserialize it? would I ever need a DTD or WSDL
> available? (in perl i don't need nothing of these...)
>
> thank you,
>  bruno
>
>
> On 7/6/06, robert lazarski <ro...@gmail.com> wrote:
> > You can use jmeter to send this exact message, and then you'll have a
> response.
> >
> > How to do that programatically is a much bigger question. Do you have a
> wsdl ?
> >
> > HTH,
> > Robert
> > http://www.braziloutsource.com/
> >
> > On 7/5/06, Bruno Negrao <bn...@gmail.com> wrote:
> > > Hi guys,
> > >
> > > I'm new to SOAP and I need (quickly) to access a SOAP server. I need to
> use
> > > the axis classes to create a SOAP post just like this one bellow and I
> dont
> > > know how to do it:
> > >
> > >  POST /pfappspabxutils HTTP/1.1
> > > TE: deflate,gzip;q=0.3
> > > Connection: TE, close
> > > Accept: text/xml
> > > Accept: multipart/*
> > >  Accept: application/soap
> > > Host: pfdesenv.planetarium.com.br:8080
> > > User-Agent: SOAP::Lite/Perl/0.67
> > > Content-Length: 1116
> > > Content-Type: text/xml; charset=utf-8
> > > SOAPAction: "
> > > http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa
> "
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >    <soap:Envelope
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> > > xmlns:soapenc="
> http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema "
> > > soap:encodingStyle="
> > > http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:soap="
> http://schemas.xmlsoap.org/soap/envelope/">
> > >       <soap:Body>
> > >          <AgendaPesquisa xmlns="
> > > http://172.16.10.103:8080/AgendaPesquisa ">
> > >             <tipo>C</tipo>
> > >             <dono xsi:nil="true" />
> > >             <posicao xsi:nil="true" />
> > >             <nome xsi:nil="true" />
> > >             <ramal xsi:nil="true" />
> > >             <tel_comercial_ddi xsi:nil="true" />
> > >              <tel_comercial_ddd xsi:nil="true" />
> > >             <tel_comercial xsi:nil="true" />
> > >              <tel_residencial_ddi xsi:nil="true" />
> > >             <tel_residencial_ddd xsi:nil="true" />
> > >             <tel_residencial xsi:nil="true" />
> > >              <tel_celular_ddi xsi:nil="true" />
> > >             <tel_celular_ddd xsi:nil="true" />
> > >              <tel_celular xsi:nil="true" />
> > >             <empresa xsi:nil="true" />
> > >             <cargo xsi:nil="true" />
> > >             <setor xsi:nil="true" />
> > >             <endereco xsi:nil="true" />
> > >             <bairro xsi:nil="true" />
> > >             <cidade xsi:nil="true" />
> > >             <estado xsi:nil="true" />
> > >             <pais xsi:nil="true" />
> > >             <cep xsi:nil="true" />
> > >             <email xsi:nil="true" />
> > >          </AgendaPesquisa>
> > >       </soap:Body>
> > >    </soap:Envelope>
> > >
> > >  Can someone just write a sample code of how to do this and send to me?
> > >
> > > Thank you very much,
> > > bruno
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Urgent Help - Newbie

Posted by Bruno Negrao <bn...@gmail.com>.
I don't have it. Would I need it? the server is not java.
There's a soap client here running in perl using SOAP::Lite that doesn't
need any bureaucracy.
Now i can send a post that the server successfully answers. But I cannot
deserialize it. The answer the server sends is a list of Person objects (in
xml, of course).

What't the problem in deserializing it? is the an not-bureaucratic java
class I can use to deserialize it? would I ever need a DTD or WSDL
available? (in perl i don't need nothing of these...)

thank you,
bruno

On 7/6/06, robert lazarski <ro...@gmail.com> wrote:
>
> You can use jmeter to send this exact message, and then you'll have a
> response.
>
> How to do that programatically is a much bigger question. Do you have a
> wsdl ?
>
> HTH,
> Robert
> http://www.braziloutsource.com/
>
> On 7/5/06, Bruno Negrao <bn...@gmail.com> wrote:
> > Hi guys,
> >
> > I'm new to SOAP and I need (quickly) to access a SOAP server. I need to
> use
> > the axis classes to create a SOAP post just like this one bellow and I
> dont
> > know how to do it:
> >
> >  POST /pfappspabxutils HTTP/1.1
> > TE: deflate,gzip;q=0.3
> > Connection: TE, close
> > Accept: text/xml
> > Accept: multipart/*
> >  Accept: application/soap
> > Host: pfdesenv.planetarium.com.br:8080
> > User-Agent: SOAP::Lite/Perl/0.67
> > Content-Length: 1116
> > Content-Type: text/xml; charset=utf-8
> > SOAPAction: "
> > http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa"
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >    <soap:Envelope
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > soap:encodingStyle="
> > http://schemas.xmlsoap.org/soap/encoding/"
> > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> >       <soap:Body>
> >          <AgendaPesquisa xmlns="
> > http://172.16.10.103:8080/AgendaPesquisa">
> >             <tipo>C</tipo>
> >             <dono xsi:nil="true" />
> >             <posicao xsi:nil="true" />
> >             <nome xsi:nil="true" />
> >             <ramal xsi:nil="true" />
> >             <tel_comercial_ddi xsi:nil="true" />
> >              <tel_comercial_ddd xsi:nil="true" />
> >             <tel_comercial xsi:nil="true" />
> >              <tel_residencial_ddi xsi:nil="true" />
> >             <tel_residencial_ddd xsi:nil="true" />
> >             <tel_residencial xsi:nil="true" />
> >              <tel_celular_ddi xsi:nil="true" />
> >             <tel_celular_ddd xsi:nil="true" />
> >              <tel_celular xsi:nil="true" />
> >             <empresa xsi:nil="true" />
> >             <cargo xsi:nil="true" />
> >             <setor xsi:nil="true" />
> >             <endereco xsi:nil="true" />
> >             <bairro xsi:nil="true" />
> >             <cidade xsi:nil="true" />
> >             <estado xsi:nil="true" />
> >             <pais xsi:nil="true" />
> >             <cep xsi:nil="true" />
> >             <email xsi:nil="true" />
> >          </AgendaPesquisa>
> >       </soap:Body>
> >    </soap:Envelope>
> >
> >  Can someone just write a sample code of how to do this and send to me?
> >
> > Thank you very much,
> > bruno
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Urgent Help - Newbie

Posted by robert lazarski <ro...@gmail.com>.
You can use jmeter to send this exact message, and then you'll have a response.

How to do that programatically is a much bigger question. Do you have a wsdl ?

HTH,
Robert
http://www.braziloutsource.com/

On 7/5/06, Bruno Negrao <bn...@gmail.com> wrote:
> Hi guys,
>
> I'm new to SOAP and I need (quickly) to access a SOAP server. I need to use
> the axis classes to create a SOAP post just like this one bellow and I dont
> know how to do it:
>
>  POST /pfappspabxutils HTTP/1.1
> TE: deflate,gzip;q=0.3
> Connection: TE, close
> Accept: text/xml
> Accept: multipart/*
>  Accept: application/soap
> Host: pfdesenv.planetarium.com.br:8080
> User-Agent: SOAP::Lite/Perl/0.67
> Content-Length: 1116
> Content-Type: text/xml; charset=utf-8
> SOAPAction: "
> http://172.16.10.103:8080/AgendaPesquisa#AgendaPesquisa"
>
> <?xml version="1.0" encoding="UTF-8"?>
>    <soap:Envelope
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> soap:encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>       <soap:Body>
>          <AgendaPesquisa xmlns="
> http://172.16.10.103:8080/AgendaPesquisa">
>             <tipo>C</tipo>
>             <dono xsi:nil="true" />
>             <posicao xsi:nil="true" />
>             <nome xsi:nil="true" />
>             <ramal xsi:nil="true" />
>             <tel_comercial_ddi xsi:nil="true" />
>              <tel_comercial_ddd xsi:nil="true" />
>             <tel_comercial xsi:nil="true" />
>              <tel_residencial_ddi xsi:nil="true" />
>             <tel_residencial_ddd xsi:nil="true" />
>             <tel_residencial xsi:nil="true" />
>              <tel_celular_ddi xsi:nil="true" />
>             <tel_celular_ddd xsi:nil="true" />
>              <tel_celular xsi:nil="true" />
>             <empresa xsi:nil="true" />
>             <cargo xsi:nil="true" />
>             <setor xsi:nil="true" />
>             <endereco xsi:nil="true" />
>             <bairro xsi:nil="true" />
>             <cidade xsi:nil="true" />
>             <estado xsi:nil="true" />
>             <pais xsi:nil="true" />
>             <cep xsi:nil="true" />
>             <email xsi:nil="true" />
>          </AgendaPesquisa>
>       </soap:Body>
>    </soap:Envelope>
>
>  Can someone just write a sample code of how to do this and send to me?
>
> Thank you very much,
> bruno
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org