亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 5739 | 回復(fù): 2
打印 上一主題 下一主題

java調(diào)用vb .net webservice 有問(wèn)題!! [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2005-11-02 13:10 |只看該作者 |倒序?yàn)g覽
使用axis調(diào)用.net webservice 為什么服務(wù)端取不到我傳的參數(shù)啊?webservice本機(jī)測(cè)試是好的!why?
java client 端代碼如下:
package MyWebServiceJavaClient;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;

import javax.xml.namespace.QName;
import java.lang.Integer;
import javax.xml.rpc.ParameterMode;

public class testService {
    public testService() {
    }

    public static void main(String[] args) {
        try {
            String xh = "40401001";
            String endpoint = "http://202.115.112.139/jwxt/jwxt/jws/jws.asmx?wsdl";
            Service service = new Service();
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(new java.net.URL(endpoint));
            call.setOperationName(new QName("http://tempuri.org/JWXT/JWS", "test");
            call.addParameter("a", 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://tempuri.org/JWXT/JWS/test";

            String k = (String) call.invoke(new Object[]{xh});
            System.out.println("result is " + k);

        } catch (Exception e) {
            System.err.println(e.toString());
        }
    }

}

webservice信息如下:
test
測(cè)試方法,傳入字符串參數(shù),直接返回

測(cè)試
測(cè)試窗體只能用于來(lái)自本地計(jì)算機(jī)的請(qǐng)求。
SOAP
下面是一個(gè) SOAP 請(qǐng)求和響應(yīng)示例。所顯示的占位符需要由實(shí)際值替換。

POST /jwxt/jwxt/jws/jws.asmx HTTP/1.1
Host: 202.115.112.139
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/JWXT/JWS/test"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xmlnssd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/JWXT/JWS" xmlns:types="http://tempuri.org/JWXT/JWS/encodedTypes" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:test>
      <s xsi:type="xsd:string">string</s>
    </tns:test>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlnssi="http://www.w3.org/2001/XMLSchema-instance" xmlnssd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/JWXT/JWS" xmlns:types="http://tempuri.org/JWXT/JWS/encodedTypes" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:testResponse>
      <testResult xsi:type="xsd:string">string</testResult>
    </tns:testResponse>
  </soap:Body>
</soap:Envelope>


請(qǐng)高手指點(diǎn)!謝謝

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2005-11-02 14:30 |只看該作者

問(wèn)題解決!

問(wèn)題出在兩個(gè)地方:
1。 call.addParameter("a", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); 開(kāi)始認(rèn)為“a”是隨便定義,和webservice沒(méi)什么關(guān)系,后來(lái)發(fā)現(xiàn)必須和webservice提供的參數(shù)一致!如: <s xsi:type="xsd:string">string</s>所以把“a”改為“s”
2。在書(shū)寫(xiě)。net webservice時(shí)要在方法頭增加這一行<WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> 還沒(méi)搞清楚為啥!感覺(jué)象是聲明可以soap訪問(wèn)?有那位大俠知道?謝謝!

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2005-11-02 17:27 |只看該作者

補(bǔ)充

3。同時(shí)要注意序列化問(wèn)題。
這樣的化就應(yīng)該沒(méi)有問(wèn)題了!感謝提供資料和幫助我朋友們!
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP