解决方案 »

  1.   

    参考下http://blog.csdn.net/u011619326/article/details/38342421
      

  2.   

    用soap,不是用curl。
    $servId = 'xxx';
    $secretKey = 'xxx';
    這兩處你改成你的賬號試試<?php
    try{  
        $client = new SOAPClient('http://mp.vservice.com.cn/service/OutWebService?wsdl');
      
        $servicename = 'OAuth';
        $servId = 'xxx';
        $secretKey = 'xxx';
        $xmlInfo = '<?xml version="1.0" encoding="UTF-8"?><BaseInfo><servId>333</servId><platform>weixin/yixin</platform><type>info/base</type><redirect_uri>uri</redirect_uri></BaseInfo>';    $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo);
        var_dump($result);
    }catch(SOAPFault $e){  
        echo $e->getMessage();  
    }  
    ?>
      

  3.   

    这个明明是webservice的调用,你为什么用curl
      

  4.   


    非常感谢你,但是我运行之后提示  Not enough message parts were received for the operation.
    不知该如何解决?
      

  5.   


    非常感谢你,但是我运行之后提示  Not enough message parts were received for the operation.
    不知该如何解决?我是按你提供的参数做的,看了wsdl文档发现少了些参数
    <xsd:element name="callService">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="1" name="in2" nillable="true" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="1" name="in3" nillable="true" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
      

  6.   

    按照我这个肯定好用,求分。try {
    $xml='xml数据';
    //地址
    $soap = new SoapClient ( "http://mp.vservice.com.cn/service/OutWebService?WSDL" );
    //请求参数 根据你的参数调整
    $param = array ('userName' => '*****', 'pwd' => '****', 'businessType' => 'SaleHouses', 'xmlContent' => $xml );
    //调用服务器端的方法 根据你的方法调整 我这里Import是方法名称
    $result = $soap->__soapCall ( 'Import', array ('parameters' => $param ) );
    print_r ( $result );
    } catch ( SoapFault $e ) {
    echo $e->getMessage ();
    } catch ( Exception $E ) {
    echo $E->getMessage ();
    }