RE: Web service test page uses internal port
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Tue, 13 Nov 2007 02:55:57 GMT
Thanks for your reply Ben,
Yes, the 3rd question is also what I have mentioned in last reply.
Currently it seems ASP.NET webservice handler has done the http GET/POST
test page rendering itself and doesn't provide any means to customize it.
I've met some one encountering the same problem before. So far what we can
get is using a custom test page to invoke the webservice via http GET/POST.
You will also need to replace the test page link in the WSDL document
display page.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
-------------------->
References: <BE87A28A-CA22-4DDC-84E6-247A81B068EE@xxxxxxxxxxxxx><5KbSaoOJIHA.4200@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Web service test page uses internal portbut
Date: Mon, 12 Nov 2007 11:46:01 -0800
Thank you Steven! Using the links you provided I was able to fix most,
not all, of my problems. Now that I understand the situation better Ihave
identified 3 issues, two of which I have resolved (documented below foradding
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
1 line of code to remove the port from the test page when it was posted tosolved
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
the first two items in the WSDL (see Soap & Soap12 below) it did not solveI
the third item, HttpPost (see the port 8000 still in the WSDL file below).
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>binding="tns:MyWebServicesHttpPost">
<wsdl:port name="MyWebServicesHttpPost"
<http:addresslocation="http://www.mydomain.com:8000/MyWebServices.asmx"
/>
</wsdl:port>
</wsdl:service>
Thanks in advance for any additional help!
.
- Follow-Ups:
- RE: Web service test page uses internal port
- From: Steven Cheng[MSFT]
- RE: Web service test page uses internal port
- References:
- Web service test page uses internal port
- From: Ben M
- RE: Web service test page uses internal port
- From: Steven Cheng[MSFT]
- RE: Web service test page uses internal port
- From: Ben M
- Web service test page uses internal port
- Prev by Date: Re: Generate WSDL from command line
- Next by Date: Re: Generate WSDL from command line
- Previous by thread: RE: Web service test page uses internal port
- Next by thread: RE: Web service test page uses internal port
- Index(es):
Relevant Pages
|