开发者

add users to liferay from .net using liferay webservices

I have some users in csv files to be imported into liferay. I don't have any idea about Hypersonic s开发者_如何学运维ql. So thought of inserting the users from .net.

I tried calling getUserById() to test. It gives me this error.

RPC Message updateUserRequest1 in operation updateUser1 has an invalid body name updateUser. It must be updateUser1

Any idea how to do this? or any other better approach to insert users into liferay. I know sql server and C#, no java


I realize that this response is not particularly timely, but I just ran into this same issue, which I had to figure out to keep working.

The message you received is caused by a problem in the proxy classes generated by the tool:

RPC Message updateUserRequest1 in operation updateUser1 has an invalid body name updateUser. It must be updateUser1

You can go into the source code generated, Reference.cs, and look for the partial class definition of updateUserRequest1:

    [System.ServiceModel.MessageContractAttribute(WrapperName="updateUser", 
WrapperNamespace="urn:http.service.portal.liferay.com", IsWrapped=true)]
public partial class updateUserRequest1 {

and change the WrapperName value to "updateUser1":

    [System.ServiceModel.MessageContractAttribute(WrapperName="updateUser1", 
WrapperNamespace="urn:http.service.portal.liferay.com", IsWrapped=true)]
public partial class updateUserRequest1 {

This will get you past that issue. There is another problem in the generated proxy class for the UserService, but it can be fixed in the same way.

I ran into a couple of other gotchas beyond this, so created this blog post. There's a link there to a full VS2010 .Net solution if you need it. Good luck.


You first need to add a Web Reference to the specific web service in you .net project. for users you are specifically looking for the Portal_UserService web serice. If you are running Liferay locally for testing purposes, the complete address for the web service should look like this:

http://127.0.0.1:8080/tunnel-web/axis/Portal_UserService?wsdl

Otherwise, you can still point to a live installation by following the correct URL to the web service.

Now, as far as your project goes, once you have added the Web Reference to the project you should be able to call it and its methods/interfaces/classes and do all the coding in C#. Here is a small example:

name_of_your_web_reference.UserServiceSoapService proxy = new name_of_your_web_reference.UserServiceSoapService();
proxy.addUser("testUser",...);

All you should have to do is read through your cvs file and use the method to add the users in.

Here is also a reference to their most current API documents. You can look up the methods there if you have any additional problems calling them.

Liferay 6.0.5 API Portal Services

Hope it helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜