php wsdl新手

半醉人间 发布于 2013/04/28 09:45
阅读 524
收藏 1
PHP

@我不叫大脸猫 你好,想跟你请教个问题:

以下是客户给的接品方法,,他说是JAVA的。。我想知道php要怎么做。

他还给了一个URL地址,你就写http://www.aaa.com?wsdl

接口方法:
 <wsdl:operation name="saveSponsorUserContact">
      <soap:operation soapAction="" style="document" />
      <wsdl:input name="saveSponsorUserContact">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="saveSponsorUserContactResponse">
        <soap:body use="literal" />
      </wsdl:output>
</wsdl:operation>
接口:
@WebService
public interface SponsorUserContactInfoService {

 @WebMethod(operationName = "saveSponsorUserContact")
 @WebResult(name = "string")
 String saveSponsorUserContact(@WebParam(name = "jsontext") String[] jsontext);
}

例子1(以下字段必填项,都必须有值):jsontext=
[{"campaign_Code":"1GIG035RN1","name":"测试web","gender":"F","dOB":"1985-01-01","mobile":"15112522336","whereCallingFrom":"广东省深圳","emailAddress":"fangliangjin@124.com","iq_ID":"96000208","running_No":"CH20121015E0001","activity":"Contact","submission_Date":"20121212 12:23:00","remark":"年龄20岁"}]

 

加载中
0
我不叫大脸猫
我不叫大脸猫
你只需要使用它给的wsdl地址实例化一个soapclient对象,然后调用其中的方法传递必要的参数就可以了
0
半醉人间
半醉人间

引用来自“我不叫大脸猫”的答案

你只需要使用它给的wsdl地址实例化一个soapclient对象,然后调用其中的方法传递必要的参数就可以了
$post_data = array("campaign_Code" => "1GIG026RN1","name" =>"$username","gender" => "$gender","dOB" => "$dOB","mobile" => "$mobile","whereCallingFrom" => "$WhereCallingFrom","emailAddress" => "$email","iq_ID" => "91600001","running_No" => "$running_No","activity" => "Contact","submission_Date" => "$submission_Date","remark" => "$remark");
   
$url = " http://www.aaa.com?wsdl";
$client = new SoapClient($url,$post_data);
0
我不叫大脸猫
我不叫大脸猫
你能先看看php手册么
返回顶部
顶部