简体   繁体   English

无法在WSO2 ESB上部署WSF / PHP WebService

[英]Unable to deploy WSF/PHP WebService on WSO2 ESB

few days ago I started to work on my own WebServices. 几天前,我开始使用自己的Web服务。 I decided to use WSO2 WSF/PHP framework and according to http://wso2.org/project/wsf/php/2.0.0/docs/manual.html created my first helloService. 我决定使用WSO2 WSF / PHP框架,并根据http://wso2.org/project/wsf/php/2.0.0/docs/manual.html创建了我的第一个helloService。 Here's code: 这是代码:

function greet($message) {
    $responsePayloadString = <<<XML
        <greetResponse>Hello Client!</greetResponse>
    XML;

    $returnMessage = new WSMessage($responsePayloadString);
    return $returnMessage;
}
$service = new WSService(array("operations" => array("greet")));
$service->reply();

I've deployed it on my server and tried to call it using simple helloClient (described in wso2 wsf/php manual) and SoapUI - everything works fine. 我已将其部署在服务器上,并尝试使用简单的helloClient(在wso2 wsf / php手册中进行了介绍)和SoapUI进行调用-一切正常。 Now I would try to deploy it on my WSO2 ESB, so I've defined new proxy service like this: 现在,我将尝试在WSO2 ESB上部署它,因此我定义了新的代理服务,如下所示:

<proxy name="helloService" transports="https http" startOnLoad="true" trace="disable">
    <target endpoint="helloService">
        <inSequence>
            <log level="full"/>
        </inSequence>
        <outSequence>
            <filter xpath="get-property('FAULT')">
                <then>
                    <log level="full" category="WARN" separator=",">
                        <property name="message" value="SOAP Fault detected"/>
                    </log>
                </then>
                <else/>
            </filter>
            <send/>
        </outSequence>
        <faultSequence>
            <log level="full">
                <property name="MESSAGE" value="Executing default 'fault' sequence"/>
                <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
                <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
            </log>
            <drop/>
        </faultSequence>
    </target>
    <publishWSDL uri="http://myAPIAddress/helloService.php?wsdl"/>
</proxy>
<endpoint name="helloService">
    <address uri="http://myAPIAddress/helloService.php" format="soap11"/>
</endpoint>

New service is visible on "Deployed services" list in ESB management console, I can get WSDL from myESBaddress:8280/services/helloService?wsdl and everything looks fine on the myESBaddress:8280/services list. 新服务在ESB管理控制台的“已部署服务”列表中可见,我可以从myESBaddress:8280 / services / helloService?wsdl获取WSDL,并且在myESBaddress:8280 / services列表上一切正常。 But, when I want to use "Try this service" option, there's timeout error. 但是,当我要使用“尝试此服务”选项时,会出现超时错误。 I tried to call my WS using SoapUI - the request to endpoint myESBaddress:8280/services/helloService looks like (the same request worked fine when I sent it to myAPIAddress/helloService.php) 我尝试使用SoapUI调用WS-终结点myESBaddress:8280 / services / helloService的请求看起来像(当我将其发送到myAPIAddress / helloService.php时,该请求也能正常工作)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.wso2.org/php/xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <greet>asdfasdfas</greet>
   </soapenv:Body>
</soapenv:Envelope>

Unfortunately, as a response, I've got a fault: 不幸的是,作为回应,我有一个错误:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>411</faultcode>
            <faultstring>Unexpected response received. HTTP response code : 411 HTTP status : Length Required exception : First Element must contain the local name, Envelope , but found html</faultstring>
            <detail>Unexpected response received. HTTP response code : 411 HTTP status : Length Required exception : First Element must contain the local name, Envelope , but found html</detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

What did I wrong? 我怎么了 I have feeling, that it's something completely stupid and obvious, so forgive me if it's newbie question but after few days of digging for solution I'm really desperate. 我觉得这完全是愚蠢而明显的,所以如果是新手问题,请原谅我,但是在寻找解决方案几天后,我真的很绝望。

PS. PS。 Sorry for my english, it's not my mother tongue 对不起,我的英语不是我的母语

Finally, I got it to work! 终于,我成功了! The problem was caused by version of HTTP. 该问题是由HTTP版本引起的。 Here's solution: 解决方法:

...
<inSequence>
    <log level="full"/>
    <property name="FORCE_HTTP_1.0" value="true" scope="axis2" type="BOOLEAN"/>
</inSequence>
...

Hope, it will be someday helpful for somebody. 希望对某人有帮助。

What's type of your php services ? 您的php服务类型是什么?

How to Invoke External PHP Web Services with WSO2 ESB 如何使用WSO2 ESB调用外部PHP Web服务

i have same problem with you, but i have changed my server to Apache, and problem is solved. 我与您有同样的问题,但是我将服务器更改为Apache,问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM