フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
Mikael Ovaskainen
Web service response empty
2012/05/08 1:03
答え

Mikael Ovaskainen

ランク: New Member

投稿: 11

参加年月日: 2012/05/06

最近の投稿

This is related to my previous question. I can now access the service WSDL and generate SOAP request for it with SoapUI. The only problem is that the service returns an empty response. I get only http headers from the response in SoapUI. I have a one simple method in my ServiceImpl class which returns com.liferay.portal.model.User object. I changed it to return com.liferay.portal.model.UserSoap but that didn't have any effect. The method executes fine and I get fetched user information printed on console but nothing to soap response. SoapUI receives response message from service if the method returns null but not if it returns object.

Here's my files:

XX_deploy.wsdd
 1<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 2    <service name="Plugin_x_VtUserDataService" provider="java:RPC" style="rpc" use="encoded">
 3        <operation xmlns:operNS="urn:http.service.vt.consultor.fi" xmlns:rtns="http://www.w3.org/2001/XMLSchema" name="getUserData" qname="operNS:getUserData" returnQName="getUserDataReturn" returnType="rtns:anyType" soapAction="">
 4            <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="ssn" type="tns:string"></parameter>
 5        </operation>
 6        <parameter name="allowedMethods" value="getUserData" />
 7        <parameter name="className" value="fi.consultor.vt.service.http.VtUserDataServiceSoap" />
 8        <parameter name="typeMappingVersion" value="1.2" />
 9        <parameter name="wsdlPortType" value="VtUserDataServiceSoap" />
10        <parameter name="wsdlServiceElement" value="VtUserDataServiceSoapService" />
11        <parameter name="wsdlServicePort" value="Plugin_x_VtUserDataService" />
12        <parameter name="wsdlTargetNamespace" value="urn:http.service.vt.consultor.fi" />
13    </service>
14</deployment>


server-config.wsdd
 1<service name="Plugin_x_VtUserDataService" provider="java:RPC" style="rpc" use="encoded">
 2        <operation xmlns:operNS="urn:http.service.vt.consultor.fi" xmlns:rtns="http://www.w3.org/2001/XMLSchema" name="getUserData" qname="operNS:getUserData" returnQName="getUserDataReturn" returnType="rtns:anyType" soapAction="">
 3            <parameter xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="ssn" type="tns:string"></parameter>
 4        </operation>
 5        <parameter name="allowedMethods" value="getUserData" />
 6        <parameter name="className" value="fi.consultor.vt.service.http.VtUserDataServiceSoap" />
 7        <parameter name="typeMappingVersion" value="1.2" />
 8        <parameter name="wsdlPortType" value="VtUserDataServiceSoap" />
 9        <parameter name="wsdlServiceElement" value="VtUserDataServiceSoapService" />
10        <parameter name="wsdlServicePort" value="Plugin_x_VtUserDataService" />
11        <parameter name="wsdlTargetNamespace" value="urn:http.service.vt.consultor.fi" />
12    </service>


VtUserDataServiceImpl.java
 1public class VtUserDataServiceImpl extends VtUserDataServiceBaseImpl {
 2    public UserSoap getUserData(String xx) {
 3        User user = null;
 4        try {
 5            user = VtLiferayUtil.getUserByXX(xx);
 6        } catch (NoSuchUserException e) {
 7            return null;  //TODO
 8        }
 9        return com.liferay.portal.model.UserSoap.toSoapModel(user);
10    }
11}