Solved

what does .net web service not having web.config entry has to do with sending emails?

Posted on 2009-05-05
1
451 Views
Last Modified: 2013-11-30
I am getting the following errors:
No connection could be made because the target machine actively refused it 127.0.0.1:4455
WebException: Unable to connect to the remote server
 The explanation I got from the seniors is that there is a web service used by the web application. That web service did not have an entry in the web.config file for a specific port. Therefore, in the disco file the web service defaults to 4455.

Why does no web.config entry in a web service manifest itself in a send email problem?
Why does the email target itself to port 4455?  (there is not specific code or config entry to use port 4455).  


Dim client As New SmtpClient
           ' SmtpClient is from System.Net.Mail
 
           ' client.Host = "smtpmail.wegmans.com"
            client.Host = "localhost"
            ' I tried both smtpmail.wegmans.com and localhost. both gave me the same error
             client.Send(myMessage)
            'in the try catch, client.Send result in the error. See attachment for error info
 
PO.disco (sample entry)
<discovery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/disco/">
  <contractRef ref="http://localhost:4455/PO.asmx?wsdl" docRef="http://localhost:4455/PO.asmx" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
  <soap address="http://localhost:4455/PO.asmx" xmlns:q1="http://webservices.myCOM.com/PO/" binding="q1:POSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
  <soap address="http://localhost:4455/PO.asmx" xmlns:q2="http://webservices.myCOM.com/PO/" binding="q2:POSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>

Open in new window

emailProblem.bmp
0
Comment
Question by:THBA
1 Comment
 
LVL 1

Accepted Solution

by:
THBA earned 0 total points
ID: 24309182
OK. I understand. The function is calling the webservice.
in the web.config file for the web application site (the ASP .NET application),  there is supposed to be an entry for the web service.

<add key="POWebService.PurchaseOrders" value="https://webservices.myCo.com/PO.asmx"/>
Because there was no entry, it takes the default in the Webreference, PO.disco. On the test server (not personal, localhost), it tries to call the service. Hence, target machine actively refused it. (no connection can be made).
 

 Dim vendorRulesEmailData As POWebService.VendorRulesEmail() = POService.GetVendorRulesEmailByBbrAndType(vendorRuleNum, "V")
 
Where POService is the web service
POService  = New POWebService.PurchaseOrders
 
It is actually erring out on that call, not Client.send

Open in new window

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question