SOAP to webservice

N

None

Dear All,

I am writing an application which needs to send some XML in a SOAP envelope
to a Java webservice. I have absolutely no idea where to begin. Can anyone
possibly point me to a good place to read about how to go about doing this?
I've not dealt with XML much in the past.

Also, instead of creating an XML document every time with nodes which are
the same, but some different values, is there a way of templating that XML?
ie. I store an XML document and replace some information in the XML before
sending. Is this a common practise?

Thanks in advance.

Steve
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

If the Java app builder has a WSDL file for their service, you can use
WSDL.exe to set up the interface and simply code as if you were coding
against a local method. This is the ideal.

If not, you can still set it up, but you will have to look at the parameters
and set up the WSDL yourself. One way to accomplish this is to mimic the
service on your side, matching the params. Dump your WSDL and change the web
address to the location of their service. You can then create your web
reference with WSDL.EXE and roll.

What I am saying is if the doc is something like this:

<values>
<userName>gbworld</username>
....
<values>

wrapped up in a SOAP envelope, you can allow .NET to control the creation of
SOAP and simply send the values you need. The less you have to mess with the
envelope creation, the better. This will not work in all cases, but you can
start with this method and see if it works, as it is much easier than hand
coding. As long as they use the standards, and have WSDL (or can create
WSDL), you are golden.

If you particularly like pain, you can also create your own SOAP wrapper
class and open a socket to send the SOAP envelope to the Java server. I am
not fond of this methodology, although the learning experience might make it
worthwhile. ;-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
S

Steve

Hi Greg,

Thanks for the information. Unfortunately they do not have the WSDL
available for me. I'm kinda blind on this. I know the exact information
required for the SOAP header etc. Do you know of any "SOAP wrapper"
resources on the internet I might be able to read up on? I've spent the
entire last week on this and I'm really stuck. I think I've been going up
the wrong path. I have been trying the HttpWebRequest class and sending an
XML document I've manually put together for testing, but I want to be able
to generate this a little more elegantly ;)

Any help would be greatly appreciated!!!

Steve
 

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