Foxtable(狐表)用户栏目专家坐堂 → [求助]webservice调用方法


  共有4209人关注过本帖树形打印复制链接

主题:[求助]webservice调用方法

帅哥哟,离线,有人找我吗?
狐作非为
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:456 积分:7267 威望:0 精华:0 注册:2012/2/6 12:27:00
[求助]webservice调用方法  发帖心情 Post By:2016/6/12 16:58:00 [只看该作者]

以下为C#调用方法:
private CAdxCallContext callContext;
        private CAdxWebServiceXmlCCClient _caService;
        private CAdxWebServiceXmlCCClient CaService
        {
            get
            {
                if (_caService == null)
                {
                    callContext = new CAdxCallContext();
                    //webservice调用完成后触发
                    callContext.codeLang = "CHI";  //cc.codeLang = "BRI";                        // Language code
                    callContext.codeUser = "ADMIN";                      // X3 user
                    callContext.password = "";                           // X3 password
                    var poolAlias = "LLTEST";// "LLTEST";//"YLLX3WS"; //cc.poolAlias = "WS_DEMOBRI";                // Pool name
                    var importModel = System.Configuration.ConfigurationManager.GetSection("importModel");
                    if (importModel != null)
                    {
                        var model = (System.Collections.IDictionary)importModel;
                        if (model["poolAlias"] != null)
                            poolAlias = model["poolAlias"] as string;
                    }
                    callContext.poolAlias = poolAlias;
                    callContext.requestConfig = @"adxwss.trace.on=on&adxwss.trace.size=16384
                    &adonix.trace.on=on&adonix.trace.level=3
                    &adonix.trace.size=8";  // Request configuration string
                    _caService = new CAdxWebServiceXmlCCClient();
                }
                return _caService;
            }
        }
新建方法
public CAdxResultXml NewX3Data(string publicName, string xml)
        {
            var result = this.CaService.save(callContext, publicName, xml);
            return result;
        }
调用新建的方法 //前面是接口名称 后面是xml格式 
var result = NewX3Data("YWMSMFG", qadTracking.DataBody);
//xml格式
<PARAM>
<GRP ID="MFG0_1" >
<FLD NAME="PLNFCY" TYPE="Char" >L01</FLD>
<FLD NAME="MFGFCY" TYPE="Char" >L01</FLD>
</GRP>
<GRP ID="MFG0_2" >
<FLD NAME="MFGSTA" TYPE="Integer" >1</FLD>
<FLD NAME="MFGMOD" TYPE="Integer" >1</FLD>
<FLD NAME="YWMSNUM" TYPE="Char" >C011605WMS00004196</FLD>
</GRP>
<GRP ID="MFG1_2" >
<FLD NAME="SCDMOD" TYPE="Integer" >1</FLD>
<FLD NAME="STRDAT" TYPE="Date" >20160401</FLD>
<FLD NAME="ENDDAT" TYPE="Date" >20160401</FLD>
</GRP>
<GRP ID="MFG1_3" >
<FLD NAME="MFGPIO" TYPE="Integer" >1</FLD>
<FLD NAME="MFGEXTQTY" TYPE="Decimal" >2</FLD>
</GRP>
<TAB DIM="10" ID="MFG1_1" SIZE="1" >
<LIN NUM="1" >
<FLD NAME="ITMREF" TYPE="Char" >21000202040001</FLD>
<FLD NAME="UOMEXTQTY" TYPE="Decimal" >2</FLD>
<FLD NAME="BOMALT" TYPE="Integer" >10</FLD>
</LIN>
</TAB>
</PARAM>


以下为WSDL:
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://www.adonix.com/WSS" xmlns:intf="http://www.adonix.com/WSS"xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.adonix.com/WSS">
<!--
WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.adonix.com/WSS">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="CAdxCallContext">
<sequence>
<element name="codeLang" nillable="true" type="xsd:string"/>
<element name="codeUser" nillable="true" type="xsd:string"/>
<element name="password" nillable="true" type="xsd:string"/>
<element name="poolAlias" nillable="true" type="xsd:string"/>
<element name="poolId" nillable="true" type="xsd:string"/>
<element name="requestConfig" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="CAdxMessage">
<sequence>
<element name="message" nillable="true" type="xsd:string"/>
<element name="type" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfCAdxMessage">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:CAdxMessage[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="CAdxTechnicalInfos">
<sequence>
<element name="busy" type="xsd:boolean"/>
<element name="changeLanguage" type="xsd:boolean"/>
<element name="changeUserId" type="xsd:boolean"/>
<element name="flushAdx" type="xsd:boolean"/>
<element name="loadWebsDuration" type="xsd:double"/>
<element name="nbDistributionCycle" type="xsd:int"/>
<element name="poolDistribDuration" type="xsd:double"/>
<element name="poolEntryIdx" type="xsd:int"/>
<element name="poolExecDuration" type="xsd:double"/>
<element name="poolRequestDuration" type="xsd:double"/>
<element name="poolWaitDuration" type="xsd:double"/>
<element name="processReport" nillable="true" type="xsd:string"/>
<element name="processReportSize" type="xsd:int"/>
<element name="reloadWebs" type="xsd:boolean"/>
<element name="resumitAfterDBOpen" type="xsd:boolean"/>
<element name="rowInDistribStack" type="xsd:int"/>
<element name="totalDuration" type="xsd:double"/>
<element name="traceRequest" nillable="true" type="xsd:string"/>
<element name="traceRequestSize" type="xsd:int"/>
</sequence>
</complexType>
<complexType name="CAdxResultXml">
<sequence>
<element name="messages" nillable="true" type="impl:ArrayOfCAdxMessage"/>
<element name="resultXml" nillable="true" type="xsd:string"/>
<element name="status" type="xsd:int"/>
<element name="technicalInfos" nillable="true" type="impl:CAdxTechnicalInfos"/>
</sequence>
</complexType>
<complexType name="CAdxParamKeyValue">
<sequence>
<element name="key" nillable="true" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfCAdxParamKeyValue">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:CAdxParamKeyValue[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ArrayOf_xsd_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="queryRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
<wsdl:part name="listSize" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="insertLinesResponse">
<wsdl:part name="insertLinesReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="getDataXmlSchemaResponse">
<wsdl:part name="getDataXmlSchemaReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="actionObjectKeysResponse">
<wsdl:part name="actionObjectKeysReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="deleteRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
</wsdl:message>
<wsdl:message name="runRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="inputXml" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="runResponse">
<wsdl:part name="runReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="queryResponse">
<wsdl:part name="queryReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="insertLinesRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
<wsdl:part name="blocKey" type="xsd:string"/>
<wsdl:part name="lineKey" type="xsd:string"/>
<wsdl:part name="lineXml" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="getDescriptionResponse">
<wsdl:part name="getDescriptionReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="deleteLinesRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
<wsdl:part name="blocKey" type="xsd:string"/>
<wsdl:part name="lineKeys" type="impl:ArrayOf_xsd_string"/>
</wsdl:message>
<wsdl:message name="getDataXmlSchemaRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="actionObjectRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="actionCode" type="xsd:string"/>
<wsdl:part name="objectXml" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="modifyRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
<wsdl:part name="objectXml" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="saveResponse">
<wsdl:part name="saveReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="getDescriptionRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="actionObjectKeysRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="actionCode" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
</wsdl:message>
<wsdl:message name="actionObjectResponse">
<wsdl:part name="actionObjectReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="deleteLinesResponse">
<wsdl:part name="deleteLinesReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="deleteResponse">
<wsdl:part name="deleteReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="saveRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectXml" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="readRequest">
<wsdl:part name="callContext" type="impl:CAdxCallContext"/>
<wsdl:part name="publicName" type="xsd:string"/>
<wsdl:part name="objectKeys" type="impl:ArrayOfCAdxParamKeyValue"/>
</wsdl:message>
<wsdl:message name="readResponse">
<wsdl:part name="readReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:message name="modifyResponse">
<wsdl:part name="modifyReturn" type="impl:CAdxResultXml"/>
</wsdl:message>
<wsdl:portType name="CAdxWebServiceXmlCC">
<wsdl:operation name="run" parameterOrder="callContext publicName inputXml">
<wsdl:input message="impl:runRequest" name="runRequest"/>
<wsdl:output message="impl:runResponse" name="runResponse"/>
</wsdl:operation>
<wsdl:operation name="save" parameterOrder="callContext publicName objectXml">
<wsdl:input message="impl:saveRequest" name="saveRequest"/>
<wsdl:output message="impl:saveResponse" name="saveResponse"/>
</wsdl:operation>
<wsdl:operation name="delete" parameterOrder="callContext publicName objectKeys">
<wsdl:input message="impl:deleteRequest" name="deleteRequest"/>
<wsdl:output message="impl:deleteResponse" name="deleteResponse"/>
</wsdl:operation>
<wsdl:operation name="read" parameterOrder="callContext publicName objectKeys">
<wsdl:input message="impl:readRequest" name="readRequest"/>
<wsdl:output message="impl:readResponse" name="readResponse"/>
</wsdl:operation>
<wsdl:operation name="query" parameterOrder="callContext publicName objectKeys listSize">
<wsdl:input message="impl:queryRequest" name="queryRequest"/>
<wsdl:output message="impl:queryResponse" name="queryResponse"/>
</wsdl:operation>
<wsdl:operation name="getDescription" parameterOrder="callContext publicName">
<wsdl:input message="impl:getDescriptionRequest" name="getDescriptionRequest"/>
<wsdl:output message="impl:getDescriptionResponse" name="getDescriptionResponse"/>
</wsdl:operation>
<wsdl:operation name="modify" parameterOrder="callContext publicName objectKeys objectXml">
<wsdl:input message="impl:modifyRequest" name="modifyRequest"/>
<wsdl:output message="impl:modifyResponse" name="modifyResponse"/>
</wsdl:operation>
<wsdl:operation name="actionObjectKeys" parameterOrder="callContext publicName actionCode objectKeys">
<wsdl:input message="impl:actionObjectKeysRequest" name="actionObjectKeysRequest"/>
<wsdl:output message="impl:actionObjectKeysResponse" name="actionObjectKeysResponse"/>
</wsdl:operation>
<wsdl:operation name="getDataXmlSchema" parameterOrder="callContext publicName">
<wsdl:input message="impl:getDataXmlSchemaRequest" name="getDataXmlSchemaRequest"/>
<wsdl:output message="impl:getDataXmlSchemaResponse" name="getDataXmlSchemaResponse"/>
</wsdl:operation>
<wsdl:operation name="deleteLines" parameterOrder="callContext publicName objectKeys blocKey lineKeys">
<wsdl:input message="impl:deleteLinesRequest" name="deleteLinesRequest"/>
<wsdl:output message="impl:deleteLinesResponse" name="deleteLinesResponse"/>
</wsdl:operation>
<wsdl:operation name="insertLines" parameterOrder="callContext publicName objectKeys blocKey lineKey lineXml">
<wsdl:input message="impl:insertLinesRequest" name="insertLinesRequest"/>
<wsdl:output message="impl:insertLinesResponse" name="insertLinesResponse"/>
</wsdl:operation>
<wsdl:operation name="actionObject" parameterOrder="callContext publicName actionCode objectXml">
<wsdl:input message="impl:actionObjectRequest" name="actionObjectRequest"/>
<wsdl:output message="impl:actionObjectResponse" name="actionObjectResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CAdxWebServiceXmlCCSoapBinding" type="impl:CAdxWebServiceXmlCC">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="run">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="runRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="runResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="save">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="saveRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="saveResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="delete">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="deleteRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="deleteResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="read">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="readRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="readResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="query">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="queryRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="queryResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDescription">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getDescriptionRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDescriptionResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="modify">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="modifyRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="modifyResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="actionObjectKeys">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="actionObjectKeysRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="actionObjectKeysResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getDataXmlSchema">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getDataXmlSchemaRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="getDataXmlSchemaResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="deleteLines">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="deleteLinesRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="deleteLinesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="insertLines">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="insertLinesRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="insertLinesResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="actionObject">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="actionObjectRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:input>
<wsdl:output name="actionObjectResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://www.adonix.com/WSS" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CAdxWebServiceXmlCCService">
<wsdl:port binding="impl:CAdxWebServiceXmlCCSoapBinding" name="CAdxWebServiceXmlCC">
<wsdlsoap:address location="http://192.168.0.17:28880/adxwsvc/services/CAdxWebServiceXmlCC"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
[此贴子已经被作者于2016/6/12 16:59:38编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/12 18:21:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
狐作非为
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:456 积分:7267 威望:0 精华:0 注册:2012/2/6 12:27:00
  发帖心情 Post By:2016/6/13 7:20:00 [只看该作者]

袍版,能否按照上面C#的方法,用FT调用写一个例子?确实是不知道怎么写,上面的例子我看了三天了也没有搞明白。

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/13 9:17:00 [只看该作者]

认认真真看2楼代码啊。

 

直接get、post请求,要填的参数写到地址里去就行啊。


 回到顶部
帅哥哟,离线,有人找我吗?
狐作非为
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:456 积分:7267 威望:0 精华:0 注册:2012/2/6 12:27:00
  发帖心情 Post By:2016/6/13 9:50:00 [只看该作者]

还有一个参数是XML文档,那应该怎么写呢?是真不会所以才求助的

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/13 9:53:00 [只看该作者]

用post请求,红色地方,写内容和参数

 

Dim msg As String = "context=" & FileSys.ReadAllText("d:\test.xml", Encoding.Default)
Dim req = System.Net.WebRequest.Create("http://192.168.1.83/EFWebS/EFWebService.asmx/U8WebXML")
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"     
Dim aryBuf As Byte() = Encoding.GetEncoding("UTF-8").GetBytes(msg)
req.ContentLength = aryBuf.Length
Dim writer = req.GetRequestStream()
writer.Write(aryBuf, 0, aryBuf.Length)
writer.Close()
writer.Dispose()

Dim pos = req.GetResponse
Dim stm As System.IO.Stream = pos.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim str As String = reader.ReadToEnd
pos.Close
stm.Close
reader.close

msgbox(str)


 回到顶部
帅哥哟,离线,有人找我吗?
狐作非为
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:456 积分:7267 威望:0 精华:0 注册:2012/2/6 12:27:00
  发帖心情 Post By:2016/6/13 11:50:00 [只看该作者]

好像使用不了

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/13 11:52:00 [只看该作者]

贴出你写的代码

 回到顶部
帅哥哟,离线,有人找我吗?
狐作非为
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:456 积分:7267 威望:0 精华:0 注册:2012/2/6 12:27:00
  发帖心情 Post By:2016/6/13 13:25:00 [只看该作者]

我不会写所以直接复制你的代码用的

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/6/13 14:17:00 [只看该作者]

汗,红色代码改成你自己的啊,比如。

 

不会做,就去就叫那个帮你写 webservice 的人教你怎么做。

 

Dim msg As String = "codeLang=CHI&codeUser=ADMIN"
Dim req = System.Net.WebRequest.Create("http://192.168.0.17:28880/adxwsvc/services/CAdxWebServiceXmlCC.asmx/CAdxCallContext")
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"     
Dim aryBuf As Byte() = Encoding.GetEncoding("UTF-8").GetBytes(msg)
req.ContentLength = aryBuf.Length
Dim writer = req.GetRequestStream()
writer.Write(aryBuf, 0, aryBuf.Length)
writer.Close()
writer.Dispose()

Dim pos = req.GetResponse
Dim stm As System.IO.Stream = pos.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim str As String = reader.ReadToEnd
pos.Close
stm.Close
reader.close

msgbox(str)


 回到顶部
总数 23 1 2 3 下一页