how to make a SOAP/WSDL client?


J

jms

I want to build a client to consume some webservices.
The SOAP payload is quite simple:

<mns:getList xmlns:mns="urn:asbws" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<parm1 xsi:type="xsd:string">12345</parm1>
<parm2 xsi:type="xsd:string">unix</parm2>
<parm3 xsi:type="xsd:string">test</parm3>
<parm4 xsi:type="xsd:int">911</parm4>
</mns:getList>

So I do not need tools to create this. I can make a simple HTTP POST over an HttpURLConnection.
But if there is a lightweight tool...ok.

The resulting XML is a bit more tricky because it contains multiRef-tags.

So the question is: which toolbox/API should I use for constructing and parsing the XML?

(I do not prefer tool collections which have a few MB when the task can be done with telnet :)

Or is it ok to do it with javax.xml ?

Martin
 
Ad

Advertisements

A

Arne Vajhøj

I want to build a client to consume some webservices.
The SOAP payload is quite simple:

<mns:getList xmlns:mns="urn:asbws"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<parm1 xsi:type="xsd:string">12345</parm1>
<parm2 xsi:type="xsd:string">unix</parm2>
<parm3 xsi:type="xsd:string">test</parm3>
<parm4 xsi:type="xsd:int">911</parm4>
</mns:getList>

So I do not need tools to create this. I can make a simple HTTP POST
over an HttpURLConnection.
But if there is a lightweight tool...ok.

The resulting XML is a bit more tricky because it contains multiRef-tags.

So the question is: which toolbox/API should I use for constructing and
parsing the XML?

(I do not prefer tool collections which have a few MB when the task can
be done with telnet :)

Or is it ok to do it with javax.xml ?

Rule number one when starting to learn web services: forget
that the wire format is XML based.

Drop (explicit) HttpURLConnection and XML parser and
use a web service toolkit instead.

Arne
 
J

jms

Am 26.03.2011 01:25, schrieb Arne Vajhøj:
Rule number one when starting to learn web services: forget
that the wire format is XML based.

Drop (explicit) HttpURLConnection and XML parser and
use a web service toolkit instead.

I constructed the request with a StringBuffer and POSTed it to the URL with
the little help of the HttpURLConnection. I then used SaxParser to parse the reponse
into a document. That's it. It works.

Why use a cnc machine if a screw driver does it?

Jens Martin Schlatter
 
L

Lew

Am 26.03.2011 01:25, schrieb Arne Vajhøj:

I constructed the request with a StringBuffer and POSTed it to the URL with
the little help of the HttpURLConnection. I then used SaxParser to parse the
reponse
into a document. That's it. It works.

Why use a cnc machine if a screw driver does it?

False analogy.

You'll be fine until you try to build an entire skyscraper with that
screwdriver, and no hammers, saws, ladders, glue, nails, boards, left-handed
stembolts, assistants, ...

Web services involve a whole lot more than parsing XML.

Number theorists can never pass calculus exams because they've only just
re-invented the fundamental theorem by the end of the hour. "Why do I need a
CNC machine (?) when I can derive one?"

If it's so easy for you, why are you here?

Most XML frameworks, in particular web-service frameworks, *are* lightweight!
You press a button, it generates the code, and Bob's your uncle. How much
more lightweight do you need?
 
Ad

Advertisements

A

Arne Vajhøj

Am 26.03.2011 01:25, schrieb Arne Vajhøj:

I constructed the request with a StringBuffer and POSTed it to the URL with
the little help of the HttpURLConnection. I then used SaxParser to parse
the reponse
into a document. That's it. It works.

Why use a cnc machine if a screw driver does it?

Because the CNC machine is faster

A web service toolkit that can generate a stub makes it as easy to
call a web service as to call method in a class.

Arne
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top