We help IT Professionals succeed at work.
Get Started

My first SOAP client. I have constructed the XML message... how to send?

390 Views
Last Modified: 2016-05-26
I'm using C# to write something to make it easier to post my company's jobs.

One of the job boards allows us to upload jobs using a webservice, and we have to send it a SOAP envelope.

(see section "Create the XML Request" on page http://partner.monster.com/real-time-posting-devguide )

I have constructed my XML as a System.String based on user input in a form. I based it on the XML example given by the webservice provider.

I haven't used SOAP before so I thought I could just POST the XML to the URL using HttpWebRequest, as I did this with another more basic webservice (see earlier post: https://www.experts-exchange.com/questions/28708426/use-C-to-attach-to-a-URL-and-get-an-XML-feed.html). However I got a 400 error.

So I googled sending a SOAP message and I got this:
https://msdn.microsoft.com/en-us/library/aa529276.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-3
But it doesn't allow (or so it seems to me) to just append the *already formed* XML message and simply send it (or am I wrong).

(on top of that the SOAPClient class is in microsoft.web.services3.dll which aint on my machine)

So maybe looking for another way...

Any tips guys?
thanks
Comment
Watch Question
QA Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE