我在网上搜索,但我没有得到它如何将自定义标题从flex发送到c#中的Web服务?
这是我的Flex代码:
private function callWS():void{
var ws:WebService = new WebService();
//changed this
ws.addHeader(new SOAPHeader(new QName("uri","header1"),{AUTH:"bla"}));
ws.loadWSDL("http://localhost:49548/test/WebService1.asmx?WSDL");
ws.HelloWorld.addEventListener(ResultEvent.RESULT, onResult);
ws.HelloWorld.addEventListener(FaultEvent.FAULT, onFault);
ws.HelloWorld();
}
private function onResult(e:ResultEvent):void{
}
private function onFault(e:FaultEvent):void{
}
,这是我的C#代码(老一套的默认值):
[WebMethod]
public string HelloWorld()
{
//what to do here?
return "Hello World";
}
如何在c#中使用auth?
你从哪里获得WebService类? – greggreg 2009-11-12 21:23:35
本地计算机,用ASP.NET开发服务器调试visual studio – sergiogx 2009-11-12 23:47:29