Solved

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

Posted on 2009-05-05
1
446 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
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 demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now