Testing a C# Web Service Connection to a Salesforce Outbound Message
Tags: salesforce, outboundmessages, soapui, putsreq
Published: 2019-02-24 12:49:01

---
title: Testing a C# Web Service Connection to a Salesforce Outbound Message
published: true
description: Part two of my three part Salesforce series - I walk the reader step by step through the process of testing their connection with the web service they created in Part 1.
tags: Salesforce, Outbound Messages, SOAPUI, PutsReq
series: Salesforce SOAP API Services
---

Welcome to Part 2 of my Salesforce Outbound Messages series! At this point, I am going to assume you have an Outbound Message in Salesforce that fails when you create a new Quote and a Web Service that compiles successfully. If you don't have both of those ready, go back to Part 1 so you can get up to speed (don't worry, we'll wait!): [Salesforce Outbound Messages Part 1](https://dev.to/rachelsoderberg/salesforce-outbound-messages-part-1---integrating-salesforce-workflow-outbound-messages-and-net-visual-studio-2017-1fna)

---

The first thing you'll need to connect your Web Service and Outbound Message is an endpoint - since our service isn't processing actual data yet we'll technically need two "endpoints." If that sounds confusing, don't worry, it's more simple than you think.

First load your web service project and run your service; in my case this is called QuoteService.svc. If you've done everything correctly, the WCF Test Client should launch. Copy the localhost address that looks something like http://localhost:63881/QuoteService.svc. Note: Keep the WCF Test Client running.

![WCF Test Client](https://thepracticaldev.s3.amazonaws.com/i/h3l0pwy0mr2huwiccnjf.png)

Launch SoapUI and create a New SOAP Project, pasting the web service address you just copied into the Initial WSDL field with ?wsdl at the end like so: http://localhost:63881/QuoteService.svc?wsdl
Check Create Requests and click OK. You'll find your new Soap Envelope a few levels down in the navigation bar, called Request 1.

![SoapRequest](https://thepracticaldev.s3.amazonaws.com/i/6lkg0ew1fkel9ssyislv.png)

Leave the Soap Envelope as-is for now and navigate to [PutsReq.com](https://putsreq.com/). If you aren't familiar with PutsReq, it is a website that lets you record HTTP requests and fake responses, and forward requests. This allows us to see the data that would have been passed from our Salesforce Outbound Message to our Web Service if it were completely set up. Create a PutsReq and copy the provided PutsReq URL at the top. Paste this URL into your Salesforce Outbound Message Endpoint URL in place of the dummy URL you provided in Part 1. Note: If you click the PutsReq URL, it should take you to an otherwise empty page that says "Hello World" in the top left corner.

![PutsReq URL](https://thepracticaldev.s3.amazonaws.com/i/zp41ynaaj2w0kcbytrl6.png)

Create a new Quote in Salesforce. If you used the NOT( ISBLANK( Order_XML__c ) ) Rule Criteria for your Workflow Rule, be sure to set the Order XML field on the new Quote to something (I set mine to "NOT BLANKVALUE"). This Quote will still show up as failed in the Outbound Messaging Delivery Status, but you should see a new Request on PutsReq.

Along with this new Request, there should be a POST section at the bottom of PutsReq with a Soap Envelope:

![PutsReq Post](https://thepracticaldev.s3.amazonaws.com/i/gsrp5mnrnzr5z0fxozao.png)

You may have noticed this Soap Envelope looks much like the one that was generated in SoapUI a few steps ago. You are correct! Copy this and paste it into SoapUI, replacing their boilerplate code.

Hopefully your WCF Test Client is still running in the background - if it's not you'll get errors with the Soap Request, so go run your Web Service again. Click submit (the little Play button) on your Soap Request and wait a few moments. If everything is set up correctly, you will be notified in the right panel with a True Ack.

![Final Soap Request](https://thepracticaldev.s3.amazonaws.com/i/9wtn039k1khptfzg3w4l.png)

---

The next step, which I'll take you through in Part 3 of this series, is adding more fields so your Outbound Message can be more useful.