Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

PAT, SoapActor and WebServicesClientProtocol

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas S. Trias - 25 Feb 2005 23:11 GMT
Here's a brief overview of the architecture we have in place:
WSE 2.0 SP2
Web Service on http://localmachine:8080/Service.asmx
PAT Firewall with HTTP fixup at externaladdr 80 => localmachine 8080
Proxy inherited from Microsoft.Web.Services2.WebServicesClientProtocol (also
behind another PAT firewall,but that shouldn't matter)
Automatically Issued SCT, the request / response for which are signed and
encrypted so as to firmly establish the identity of the client and service.

Online research led me to using the SoapActor attribute on the web service.
However, indications were that I would also need to use an EndpointReference
as my Destination, with the SoapActor specified as the Address and the
actual transport URL as the Via.  When I setup the Destination = new
EndpointReference(new Uri("urn:test"), new
Uri("http://target/service.asmx")), I get the following error attempting to
connect:

WSE808: The following transport scheme is not supported: urn.

The Url property is "urn:test"!  Correct me if I'm wrong, but I thought the
transport information would be copied from the Via portion of the endpoint!
Just to be thorough, I switched the order in the constructor and got the
following.  As I expected, I get the following error trying to create the
EndpointReference:

WSE635: An Invalid Transport Address is specified.

I also tried setting the SoapActor to be the external URL and just using the
Url property on the proxy, but I continued to get WSE816 errors, even though
the SoapActor and wsa:To now matched.

Help!

Thomas S. Trias
Senior Developer
Afni Insurance Services
http://www.afniinc.com/
Dilip Krishnan - 01 Mar 2005 01:19 GMT
Have you tried setting the Via in Addressing headers the with the actual
address?

> Here's a brief overview of the architecture we have in place:
> WSE 2.0 SP2
[quoted text clipped - 33 lines]
> Afni Insurance Services
> http://www.afniinc.com/

Signature

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

Thomas S. Trias - 01 Mar 2005 16:11 GMT
I tried setting the Via to the externally visible address through

.Destination = New EndpointReference(New Uri(strSoapActorRef), New
Uri(strExternalUrl))

Should I be setting the Via to the internal address?  If so,then I must be
REALLY confused about the Via semantics...

Here's the result of the various permutations with the external and internal
addresses:

Dim uriInternal As Uri = New Uri("http://target:8080/MyService.asmx")
Dim uriExternal As Uri = New Uri("http://target/MyService.asmx")

MyBase.Destination = New EndpointReference(uriInternal, uriExternal)
' MyBase.Url = uriInternal
' Connectivity fails

MyBase.Destination = New EndpointReference(uriExternal, uriInternal)
' MyBase.Url = uriExternal
' WSE816

MyBase.Destination = New EndpointReference(uriInternal, uriInternal)
' MyBase.Url = uriInternal
' Connectivity fails

MyBase.Destination = New EndpointReference(uriExternal, uriExternal)
' MyBase.Url = uriExternal
' WSE816

Base Class is Microsoft.Web.Services2.WebServicesClientProtocol.  Is there a
bug in the Destination property for this class?  When I set the Destination
to uriInternal, uriExternal, shouldn't the Url property be the EXTERNAL (Via)
reference?

Thomas S. Trias
Senior Developer
Afni Insurance Services
http://www.afniinc.com/

> Have you tried setting the Via in Addressing headers the with the actual
> address?
[quoted text clipped - 36 lines]
> > Afni Insurance Services
> > http://www.afniinc.com/
Dilip Krishnan - 01 Mar 2005 16:37 GMT
Hello Thomas,
 I think the semantics may be confusing. This [0] might be helpful

[0] - http://www.dynamic-cast.com/mt-archives/cat_wsaddressing.html
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> I tried setting the Via to the externally visible address through
>
[quoted text clipped - 81 lines]
>> dkrishnan at geniant dot com
>> http://www.geniant.com
Thomas S. Trias - 01 Mar 2005 17:51 GMT
I've read through Hervey's blog entry on EndpointReference.Via.  Here's an
entry that seems pretty unequivocal regarding semantics:

-----------------------------------
* urn:MyService
* soap.tcp://mycomputer/MyService

The first URI becomes the EndpointReference.Address, the second
EndpointReference.Via
-----------------------------------

Since the first URI doesn't specify an actual transport, the Via MUST be the
specifier for the ACTUAL network location to which the proxy will connect.

Out of desperation, I gave up on using the EnpointReference constructor and
set the Via explicitly:

Private Shared Function DumpAddr(ByVal oAddr As Address) As String
 If oAddr Is Nothing Then
   Return "Addr = NOTHING"
 Else
   Return "Addr = " & oAddr.Value.ToString()
 End If
End Function

Private Shared Function DumpAddr(ByVal oAddr As Via) As String
 If oAddr Is Nothing Then
   Return "Via = NOTHING"
 Else
   Return "Via = " & oAddr.Value.ToString()
 End If
End Function

Public Sub New()
 MyBase.New()

 Dim uriInternal As Uri = New Uri("http://target:8080/MyService.asmx")
 Dim uriExternal As Uri = New Uri("http://target/MyService.asmx")

 MyBase.Url = uriInternal.ToString()
 MyBase.Destination.Via = New Via(uriExternal)
 MsgBox("URL = " & MyBase.Url & ", " & DumpAddr(MyBase.Destination.Address)
& ", " & DumpAddr(MyBase.Destination.Via))
End Sub

The message box reports:

URL = http://target:8080/MyService.asmx, Addr =
http://target:8080/MyService.asmx, Via = http://target/MyService.asmx

All looks as it should?!?  But the actual connection attempt is made to
target:8080 (NOT REACHABLE) and NOT target:80 as specified by the Via?  Maybe
WebServicesClientProtocol uses URL above all else?  Fine, here's another try:

     MyBase.Url = uriExternal.ToString()
     MyBase.Destination.Address = New Address(uriInternal)
     MyBase.Destination.Via = New Via(uriExternal)
     MsgBox("URL = " & MyBase.Url & ", " &
DumpAddr(MyBase.Destination.Address) & ", " &
DumpAddr(MyBase.Destination.Via))

The message box reports:

URL = http://target:8080/MyService.asmx, Addr =
http://target:8080/MyService.asmx, Via = http://target/MyService.asmx

Darn, setting the Address property overwrote the Url property!  Connection
failed!

Okay, how about this:

     MyBase.Url = uriExternal.ToString()
     MyBase.Destination.Address = New Address(uriInternal)
     MyBase.Url = uriExternal.ToString()
     MyBase.Destination.Via = New Via(uriExternal)
     MsgBox("URL = " & MyBase.Url & ", " &
DumpAddr(MyBase.Destination.Address) & ", " &
DumpAddr(MyBase.Destination.Via))

The message box reports:

URL = http://target/MyService.asmx, Addr = http://target/MyService.asmx, Via
= http://target/MyService.asmx

Darn, setting the Url property overwrote the Address property! WSE816!

THERE IS NO WAY TO GET THE URL TO BE THE CORRECT TRANSPORT WITHOUT
DESTROYING THE "TO" HEADER IN THE DESTINATION ADDRESS!  THIS IS A BUG IN
Microsoft.Web.Services2.WebServicesClientProtocol!

So, what are my alternatives?

Thomas S. Trias
Senior Developer
Afni Insurance Services
http://www.afniinc.com/

> Hello Thomas,
>   I think the semantics may be confusing. This [0] might be helpful
[quoted text clipped - 42 lines]
> > Afni Insurance Services
> > http://www.afniinc.com/
Dilip Krishnan - 02 Mar 2005 03:23 GMT
Hello Thomas,
   You would need to set the Via in the request soap context. NOT in the
Destination

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> I've read through Hervey's blog entry on EndpointReference.Via.
> Here's an entry that seems pretty unequivocal regarding semantics:
[quoted text clipped - 135 lines]
>>> Afni Insurance Services
>>> http://www.afniinc.com/

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.