开发者社区> 问答> 正文

PHP怎么请求c#(.net 2.0)语言开发的Web Services接口。 400 请求报错 

最近在对接一个平台的进货接口,但该平台的接口是 c#(.net 2.0) 语言开发的 Web Services接口。请问PHP要怎么请求 c#(.net 2.0)语言开发的Web Services接口。越详细越好,最好有案例。谢谢各位了。 还有附加一个问题,本人刚入门PHP,因为本来就是java方向的。开始我用curl_init 请求该接口返回:soap:ReceiverServer was unable to process request. ---> Data at the root level is invalid. Line 1, position 1.  

展开
收起
kun坤 2020-05-28 16:05:35 845 0
1 条回答
写回答
取消 提交回答
  • 用PHP的SOAP啊######是否有案例给我看看,######大牛们,拜托帮帮忙######try

    <?php

    require 'nusoap/lib/nusoap.php'; $client = new nusoap_client('http://localhost/prs_point/prs_point.asmx?WSDL', 'WSDL');

    $error = $client->getError(); if ($error) { die("client construction error: {$error}\n"); }

    $param = array('inputData' => 'sample data'); $answer = $client->call('testAssignment', array('parameters' => $param), '', '', false, true);

    $error = $client->getError(); if ($error) { print_r($client->response); print_r($client->getDebug()); die(); }

    print_r($answer);

    ?>

    There are more details on http://php.net/manual/en/refs.webservice.php ######如果不使用wsdl模式,  SOAP Envelop 格式  能通过?

    2020-05-29 13:10:02
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Web应用系统性能优化 立即下载
高性能Web架构之缓存体系 立即下载
PWA:移动Web的现在与未来 立即下载