drqvsx1228 2019-04-05 18:14 采纳率: 0%
浏览 40

PHP Soap Request标头与变量无法正常工作?

I've been trying to create a concatenated url to use in a SOAPAction POST using php curl.

I've encountered an intersting issue with the SOAP Api i'm trying to access.

If i use the httpheaders array as:

$header = array(
    "Content-Type: text/xml",
    "SOAPAction: http://tempuri.org/IProductsService/getProduct"
);

I have no issues. It goes through and the response is exactly what i would expect.

However, if i use it like this:

$A = "ProductsService";
$B = "getProduct";
$soapAction = "SOAPAction: http://tempuri.org/I" . $A . "/" . $B;

$headerTest = array(
    "Content-Type: text/xml",
    $soapAction
);

It doesn't work. (yes there is an I on the soap action i need to use) I've tried various different ways of doing this. With soap action in the array, without soap action in the array. Syntatically in PHP it IS correct. However i keep getting the response from the api stating "ActionNotSupported". It says it cannot be processed due to a contractFilter mismatch at the endpointDispatcher.

Does anyone know why? And what i might be doing wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 目详情-五一模拟赛详情页
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b