RE: Web service test page uses internal port

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thank you Steven! Using the links you provided I was able to fix most, but
not all, of my problems. Now that I understand the situation better I have
identified 3 issues, two of which I have resolved (documented below for
reference) and one that has not been resolved which I still need your help
with.

#1 - Port in test page
-------------------------------
I was able to fix this issue by copying the DefaultWsdlHelpGenerator.aspx
file from the current framework config sub directory to my website and adding
1 line of code to remove the port from the test page when it was posted to
our live server. I left it alone if the location was localhost so that I
could still develop using custom port numbers. Here is the line of code I
added:

if (!httpAddress.Location.StartsWith("http://localhost";))
{httpAddress.Location = httpAddress.Location.Replace("8000",
"80").ToString();}

I also had to add the following to the web config file in order to use the
custom test page:

<webServices>
<wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx"/>
</webServices>

#2 - Port in the WSDL for Soap
---------------------------------------------
I was able to fix this by adding a custom class to the App_Code directory:

Imports System
Imports System.Web.Services.Description

Public Class CustomSoapExtensionReflector
Inherits SoapExtensionReflector

Public Overloads Overrides Sub ReflectMethod()
'no-op
End Sub

Public Overloads Overrides Sub ReflectDescription()
Dim description As ServiceDescription =
ReflectionContext.ServiceDescription
For Each service As Service In description.Services
For Each port As Port In service.Ports
For Each extension As ServiceDescriptionFormatExtension In
port.Extensions
Dim binding As SoapAddressBinding = TryCast(extension,
SoapAddressBinding)
If binding IsNot Nothing Then
If Not
binding.Location.StartsWith("http://localhost";) Then
binding.Location =
binding.Location.Replace(":8000", "")
End If
End If
Next
Next
Next
End Sub
End Class

And also modifying the web.config to point to the new class:

<webServices>
<soapExtensionReflectorTypes>
<add type="CustomSoapExtensionReflector, App_Code"/>
</soapExtensionReflectorTypes>
</webServices>

#2 - Port in the WSDL for Http
--------------------------------------------
This issue has NOT been resolved. Although the solution to issue #2 solved
the first two items in the WSDL (see Soap & Soap12 below) it did not solve
the third item, HttpPost (see the port 8000 still in the WSDL file below). I
still need help figuring out how to change that one along with the others.

<wsdl:service name="MyWebServices">
<wsdl:port name="MyWebServicesSoap" binding="tns:MyWebServicesSoap">
<soap:address location="http://www.mydomain.com/MyWebServices.asmx"; />
</wsdl:port>
<wsdl:port name="MyWebServicesSoap12" binding="tns:MyWebServicesSoap12">
<soap12:address location="http://www.mydomain.com/MyWebServices.asmx"; />
</wsdl:port>
<wsdl:port name="MyWebServicesHttpPost" binding="tns:MyWebServicesHttpPost">
<http:address location="http://www.mydomain.com:8000/MyWebServices.asmx";
/>
</wsdl:port>
</wsdl:service>

Thanks in advance for any additional help!
.



Relevant Pages

  • RE: Web service test page uses internal port
    ... Currently it seems ASP.NET webservice handler has done the http GET/POST ... get is using a custom test page to invoke the webservice via http GET/POST. ... could still develop using custom port numbers. ... Public Overloads Overrides Sub ReflectDescription() ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: freebsd-current Digest, Vol 30, Issue 3
    ... >> I commited a fix that would have caused all of the jerky behaviors under ... > The port is broken on all architectures. ... > Rionda aka Matteo Riondato ...
    (freebsd-current)
  • [git patches] net driver fixes
    ... Fix return code in pci-skeleton.c ... struct adapter *adapter; ... int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, ... RMON counters into the port statistics. ...
    (Linux-Kernel)
  • Re: [9fans] Two suggestions for ape
    ... easier to fix ape than to convince maintaners of autoconf to fix on ... limitation in Plan9 awk may be more fundamental problem. ... these problems arise only if one wants to have a port for Plan9 ...
    (comp.os.plan9)
  • Re: Falcons Device 6 and 7 problem
    ... the infamous software patchs were created to ... Most Falcon owners probably know what I'm ... Is there a Hardware fix that one can do that would ... Some early Falcon's had a bug where the serial port would not work until the machine had been reset. ...
    (comp.sys.atari.st)