當前位置:編程學習大全網 - 網站源碼 - .net webservice方法參數問題

.net webservice方法參數問題

c#寫的service接口,部署測試正常。{註釋必須有,不然無法獲取xml字符串}

using System;

using System.Web;

using System.Web.Services;

using System.Web.Services.Protocols;

using System.Web.Services.Description;

[WebService(Namespace = "ment the following line if using designed components

//InitializeComponent();

}

//下面的引用關系必須加----begin

[SoapRpcMethod(Action = ".URL(endpoint));

//設置要調用的方法

call.setOperationName( new QName( "http://hoteamsoft.org/T","HelloWorld1" ));

//設置該方法需要的參數

call.addParameter("obj" , org.apache.axis.encoding.XMLType.XSD_STRING,

javax.xml.rpc.ParameterMode.IN);

//設置方法返回值的類型 call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);

call.setUseSOAPAction(true);

//調用該方法

call.setSOAPActionURI("http://hoteamsoft.org/HelloWorld1");

String backStr = (String) call.invoke(new Object[] { xmlString });

System.out.println("sss"+backStr);

} catch (Exception e) {

e.printStackTrace();

return e.toString();

}

}

  • 上一篇:jquery js 求壹個10秒後廣告DIV層自動消失的JS, 鼠標放上去要停止消失,鼠標離開後繼續執行消失
  • 下一篇:網頁源代碼button按鈕的超鏈接,怎麽讓它新開壹個窗口呢?
  • copyright 2024編程學習大全網