Wse Problems thru firewalls.
I have been working on web services using WSE2, and today while doing a test deployment to the outside world, I encountered a huge show-stopper problem.
private void btnbutton1_Click(object sender, System.EventArgs e)
{
WSETest.TestWse proxy = new WSETest.TestWse();
this.lbllabel1.Text = proxy.HelloWorld();
}
<appSettings>
<!--
<add key="WSETestClient.WSETest.Test" value="http://irc-devserver1/testing/WSEtest/test.asmx"/>
-->
<add key="WSETestClient.WSETest.Test" value="http://yaddayadda.imaginets.com/testing/WSEtest/test.asmx"/>
</appSettings>
[Microsoft.Web.Services2.Messaging.SoapActor("soap://imaginets.com/WSETest")]
public class WSETest: System.Web.Services.WebService
When I do that, the next exception is as follows:
Microsoft.Web.Services2.Addressing.AddressingFault: Destination Unreachable ---> System.Exception: WSE817: The <To> header must match the Actor attribute on this receiver. The <To> header contained "http://yaddayadda.imaginets.com/testing/WSEtest/test.asmx" whereas the Actor attribute was "soap://imaginets.com/WSETest".
Here is the question:
What is the easiest way to change the SOAPheader <To> to use the Actor attribute above, by configuring the client proxy?
The WSE documentation says that you can create a different proxy class using the WseWsdl2.exe tool.
C:\Program Files\Microsoft WSE\v2.0\Tools\Wsdl>wsewsdl2 http://localhost/wsetest/test.asmx?wsdl -name "soap://imaginets.com/WSETest" WSeTestsoap.cs
There are some problems with the resulting proxy class (WSeTestsoap.cs):
1. You have to also add a reference to System.Web (minor)
2. The proxy class is much different than the auto-generated classes when you add a web reference via the VS.IDE. Very much unlike the proxy classes created in the IDE, where there is a WSETest proxy and a WSETestWse proxy that are very similar in nature.
3. The URL for the endpoint is set in the constructor, so I suspect it will be difficult to change after.
I would prefer to use the proxy class generated by the VS.IDE and not the wsewsdl2.exe tool. Is it possible?
I think the answer lies in the WSETestWse.RequestSoapContext class and its sub-classes, but I'm unsure of how to do that.
(Aside: the root of this problem is that the SoapActor attribute is not described anywhere in the WSDL, so the wsdl proxy generators, neither the VS.IDE nor the WseWsdl2.exe, cannot determine that the proxy classes must set the appropriate Actor. They have added a command line switch for it to WseWsdl2.exe, but the resulting proxy classes are not similar enough to the IDE's proxies to be immediately useful.)
Anyone got any suggestions for me?
Mike