Hi you can also pass in... 2 parameters... userlogin.username and
userlogin.password, which is simpler if you don't want to expose the
GenericValue Object across the wire!

On Tue, Apr 1, 2008 at 8:51 AM, Nikita Shinde <[EMAIL PROTECTED]> wrote:

> Oops! its userLogin(GenericValue) not userLoginId :)
>
>
> -----Original Message-----
> From: Nikita Shinde [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2008 12:18 PM
> To: user@ofbiz.apache.org
> Subject: RE: Use Webservice inside
>
> Hi,
>
>        You have to pass the userLoginId too in the map
>
>        Map = local.runSync("createPartyRole",UtilMisc.toMap("userLoginId",
> userLoginId, ...);
>
>
> Thanks,
> Nikita Shinde.
> Amicon Technologies Pvt. Ltd.
> Mumbai.
>
>
> -----Original Message-----
> From: Yitao_Zhao [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 01, 2008 12:06 PM
> To: user@ofbiz.apache.org
> Subject: Use Webservice inside
>
> Hi all
>    I hope to get some hints about the webservice
>    I configured the service.xml in my project like below:
>     <service name="createPerson" engine="java">
>         <attribute name="firstName" type="String" mode="IN"
> optional="False"/>
>         <attribute name="lastName" type="String" mode="IN"
> optional="False"/>
>     </service>
>     <service name="createPartyRole" engine="simple">
>               <attribute name="partyId" type="String" mode="INOUT"
> optional="True"/>
>           <attribute name="roleTypeId" type="String" mode="IN"
> optional="False"/>
>     </service>
>
> Then I try to use the webservice in the java code for remote webservice
> like
> below:
>      @WebMethod
>      Public String createCustomer(String customer){
>           .
>           .
>           LocalDispatcher
> local=GenericDispatcher.getLocalDispatcher("projectName",
>
> GenericDelegator.getGenericDelegator(("default")));
>                   DispatchContext context=local.getDispatchContext();
>           Try{
>                  Map = local.runSync("createPerson",map);
>                  String partyId = map.get("partyId");
>                  Map = local.runSync("createPartyRole",UtilMisc.toMap
> (...);
>              }catch(Exception e){
>                Return e.getLocalMessage();
>                        }
>
> When I try to run createPartyRole webservice, it tell me "User
> authorization
> is required for this service: createPartyRole"
> How to add authentication to a webservice, any hints would be
> appreciate........
>
>
>
>

Reply via email to