How to design a client object???

hello,Michael Wooten
thank for your help, now I know the list of Java data types for the parameters
and return values, and their corresponding SOAP data types.
but how to design a client object, f.e: this object is value Object in ejb, their
have some gets and sets methods, these set methods, their return type is void
in java, but now in web service,how to deal with these prolem?
like ejb, we have ejb's design pattern, for web service, do we have their design
pattern also?
thanks :-)

Hi littlehill,
In general, you want to think of the input parameters (and return values) for
a web service method as "hierarchical state", not objects :-)
The main motivation for taking this approach is to reduce the likelihood of interoperability
issues with other (noteably non-Java) SOAP packages. The JavaBean model provides
a simple, easy to implement mechanism for creating "hierarchical state", because
it allows nesting. Using this nested JavaBean approach, you should be able to
create an object graph that represents your "value object", but again the key
here is to not thinking of them (the value objects) as objects, but state ;-)
Each SOAP (or Web Services) toolkit will have a different approach and API for
writing SOAP clients, unless it supports JAX-RPC. This being the case, it is a
bit difficult to come up with an "across the board" design for a web service client
;-) In the case of Java-based SOAP toolkits, most developers prefer to "stay in
the object world" as opposed to dealing with XML parsing APIs. To accommodate
this desire, most Java-based SOAP toolkits have a "XML-to-Java, Java-to-XML" type
mapping mechanism to handle the complexities of this task. If you don't want to
muck around with type mappings, you should look around for a product that can
generate Java classes from XML Schema, and vis-versa. WLS 7.0 does a better good
of this than WLS 6.1, so you might want to check it out. I've also had a fair
amount of success with the Exolab Castor data binding package (http://castor.exolab.org/sourcegen.html).
It has a very comprehensive implementation of "XML Schema Part 1: Structures"
and "XML Schema Part 2: Datatypes", is open-source, and works quite well. When
you get down to it, a good XML Schema processor is key to saving yourself lots
of frustration and coding.
Regards,
Mike Wooten
"littlehill lee" <[email protected]> wrote:
>
hello,Michael Wooten
thank for your help, now I know the list of Java data types for the parameters
and return values, and their corresponding SOAP data types.
but how to design a client object, f.e: this object is value Object in
ejb, their
have some gets and sets methods, these set methods, their return type
is void
in java, but now in web service,how to deal with these prolem?
like ejb, we have ejb's design pattern, for web service, do we have their
design
pattern also?
thanks :-)

Similar Messages

  • How to design socket client-server app for 2-way communication

    Hi, I am writing a client-server application. I have a single server and many clients. Each client will need the ability to send information to the server at any time. The server will also need the ability to send information to a client at any time. Its this second part that I am not sure how to design. Would I need to create a SocketServer on each client to accept incoming messages, or is there a better way? Thanks

    scranchdaddy wrote:
    Don't my requirements sound a lot like an IM application, where a chat server might need to send a message to a chat client at any time?Not really. If that is what you are designing
    in my opinion one could easily be forgiven for thinking you were deliberately obfuscating your goal...
    How does the server know where the client is? Does it know the IP address of the client?I would imagine the server would contain a directory of IPs? I'm not sure.
    What happens if the client is not running?Then I guess the message would not get delivered.
    What happens if the client is behind a firewall that does not allow incoming connections?How do IM chat clients work? How have people solved this in the past?Typically the server would only care about clients currently connected to the server.
    Maybe you should re-think your design. I don't really have a design, just requirements, that's why I'm writing this post.Your subject says "+How to *design* socket client-server app for 2-way communication+".
    Are you saying you expect someone else to do the design for you?

  • How to impersonate in client Object model?

    Hii,
    I am using client Object Model Programming in WCF service which is hosted on IIS. I have created separate APP pool in IIS which has windows authentication enabled. This App pool account will be dealing with the sharepoint server. Now I am stuck at one point.when
    I upload a file, I want to set the actual logged in user as the author or editor of the file not the app pool account. Means I want to impersonate. How can I do this?
    I have visited this link
    http://stackoverflow.com/questions/949340/getting-networkcredential-for-current-user-c but didnt work out as expected. Can any one provide some input please?
    Thanks and Regards,
    PraTech

    Hi I have tried both the options.
    The first option works fine.It impersonates all the user calls. But I wan to use serviceaccount and useraccount at times. Coule you please look in the below code and let me know why it is failing?
    teh problem is described below.
    I have an IIS app pool account to interact with the sharepoint server. but there are cases when I need to use the logged in users credentials instead of appPool account when doing some operations like uploading a document. So I decided to impersonate. I
    added the below code in the web.config file so that all  server calls are impersonated.
    <serviceBehaviors>
    <behavior name="ImpersonatedBehavior">
    <serviceMetadata httpGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
    <serviceAuthorization impersonateCallerForAllOperations="true"
    </behavior >
    </serviceBehaviors>
    and then i have a file uplaod method as given below
    public string UploadFile(objDocument)
    using (ClientContext clientContext = new ClientContext(objDocument.workspaceUrl))
    Site site = clientContext.Site;
    clientContext.Load(site, s => s.Url); //need url for some reasons
    clientContext.ExecuteQuery(); //Exception :UnAuthorized
    File.SaveBinaryDirect(clientContext, urlpart+ "/" + FileName, stream, true);
    clientContext.ExecuteQuery();
    the very first call to ExecuteQuery was throwing exception "UnAuthorized".actually  the user has full control on the particluar workspace.then I add the below piece of code ( just before the clientContext object initilaiztion )so that clientcontext
    object is created using the serviceAccount(appPool Account). then it was working fine. but failing at File.SaveBinaryDirect() method call.
    WindowsImpersonationContext ctx = null;
    if (!WindowsIdentity.GetCurrent().IsSystem)
          ctx = WindowsIdentity.Impersonate(System.IntPtr.Zero);
    using (ClientContext clientContext = new ClientContext(objDocument.workspaceUrl))
      Site site = clientContext.Site;
      clientContext.Load(site, s => s.Url); //need url for some reasons
      clientContext.ExecuteQuery();  //Working Fine now.
    if (ctx != null)
    ctx.Undo();// co'z while uploading the file we dont need appPool account.but need users account.
    File.SaveBinaryDirect(clientContext, urlpart+ "/" + FileName,  stream, true);
    clientContext.ExecuteQuery();//Exception
    finally
                        if (ctx != null)
                            ctx.Undo();
    Now it is throwing exception at the File.SaveBinaryDirect() saying "401:Unauthorized".

  • How to design a client-editable document?

    Hello there,
    I'm a graphic designer who, like many others (I hope), loathes working with the Microsoft Office applications to complete or edit any designs. Getting a Word doc from a client as their 'print-ready proof' will lead to my undoing someday.
    I would like to know if there is a way for me to create my designs using the Adobe CS programs (Photoshop, Illustrator, and, namely, InDesign), and also give my client the ability to make text edits once the design is complete without having to use the native Adobe CS program it was built in for editing. To be able to edit the document directly in Acrobat Reader, for example, or something similar.
    I'm not well versed, nor do I plan to be, in designing in Microsoft Office applications, and am trying to find a way to bridge that gap between designer and client-in-control.
    Many thanks in advance,
    -Jonathan W. Eitel

    Jonathan,
    Which application may be suitable for a given task depends on the amount and nature of the (non text) artwork, and on the number of pages to be made.
    InDesign is limited in artwork but strong in multiple pages.
    Illustrator (especially vector artwork) and Photoshop (especially raster artwork) are strong in (their different kinds of) artwork but weak in multiple pages.
    For some tasks it is convenient, or even necessary, to use at least two applications for the best result.
    A certain text editing can be done in Adobe Reader/Acrobat (Acrobat is the full version, Reader now has Adobe as the family name).
    Over time/versions, the text editing options in Reader/Acrobat and the multipage options in Illustrator/Photoshop have increased.
    You should know that bringing text from Worst into any of those applications means reprocessing it completely. Maybe especially in connexion with Illustrator it is advisable/necessary to get rid of coding, so stripping it in a raw text editor may be the (only) way.

  • Not able to use Client Object Model in Visual Webpart SandBox Solution?

    Hi,
    I am trying to use client object model in visual webpart in sandbox solution but i am getting unexpected error but if i remove client object model code webpart works fine?
    any help is appreciated.
    Regards,
    Gaurav Verma

    Check this article for your answer
    How to leverage the Client Object Model in a Sandbox Visual Web Part
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • Client Object Model in Visual Webpart

    Hi
    I am new to Client Object Model.I've to create a visual web part in SharePoint 2013 via Client Object Model using
    SandBoxed solution.
    i did following.
    1-Created empty sharepoint project
    2-added two dlls for Client Object Model in the project
    Microsoft.SharePoint.Client
    Microsoft.SharePoint.Client.Runtime
    3-in the visual webpart .ascx file i just created asp label as  below
    <asp:Label ID="label1" runat="server"></asp:Label>
    4- in the visual webpart .cs file i write a client object model code to show title items in the label from the "Test" list as below.
    5-when i deploy the code it deploys successfully,but when i try to insert this web-part on to the page it shows errors
    as below.
    Please tell me what am i doing wrong.Urgent help required.

    Yes,deployed as sandbox solution.Actually i want to create a visual webpart in Sharepoint 2013 using Client Object Model. How can i do this,i followed below steps.
    1-Created empty sharepoint project
    2-added two dlls for Client Object Model in the project
    Microsoft.SharePoint.Client
    Microsoft.SharePoint.Client.Runtime
    3-in the visual webpart .ascx file i just created asp label as  below
    <asp:Label ID="label1" runat="server"></asp:Label>
    4- in the visual webpart .cs file i write a client object model code to show title items in the label from the "Test" list as below.
    using Microsoft.SharePoint.Client;
    using System;
    using System.ComponentModel;
    using System.Web.UI.WebControls.WebParts;
    namespace SharePointProject2.VisualWebPart1
        [ToolboxItemAttribute(false)]
        public partial class VisualWebPart1 : WebPart
            // Uncomment the following SecurityPermission attribute only when doing Performance Profiling on a farm solution
            // using the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
            // for production. Because the SecurityPermission attribute bypasses the security check for callers of
            // your constructor, it's not recommended for production purposes.
            // [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
            public VisualWebPart1()
            protected override void OnInit(EventArgs e)
                base.OnInit(e);
                InitializeControl();
            protected void Page_Load(object sender, EventArgs e)
                ClientContext context = new ClientContext("http://spsiteURL");
                List testList = context.Web.Lists.GetByTitle("Test");
                CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
                ListItemCollection items = testList.GetItems(query);
                context.Load(items);
                context.ExecuteQuery();
                foreach (ListItem listItem in items)
                    label1.Text = label1.Text + ", " + listItem["Title"];
    If this is not the correct way then how can i  use client object model to get sharepoint list items.Please mention.

  • How to find the hidden objects in Webi Rich client  report 4.0 sp 04 ?

    Hi,
    How to find the hidden objects in Webi Rich client  report  at BI 4.0 sp 04 ?
    Best Regards,
    ASR

    Hi Sai,
    Go to Report Element Tab-->There you have a Tab Cell Behaviors.
    When you flip between 'With Data' and 'Structure Only' under 'Design' Tab,you can see the some cells will be hide/Un hide behavior,if hiding of cells applied.
    Select that cell and then Under 'Cell Behaviors'-->'Hide' Tab-->and choose Show Option.
    Regards,
    Venkat P

  • How to get all previous versions page contents of a publishing page using SharePoint Client Object Model 2010

    How to get all previous versions page contents and other field values of a publishing page using SharePoint Client Object Model 2010?
    Thanks,
    Osmita

    Hi Osmita,
    Greetings.
    Here are the links that helps you. It has code attached to it.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/a0d2ab40-99ba-4368-8505-1dc559ef6469/get-content-of-previous-version-of-page-sharepoint-2010?forum=sharepointgeneralprevious
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/faaf419f-997e-4150-9911-48cc375c3b46/how-to-get-previous-published-versions-of-publishing-pages-in-sharepoint-2010?forum=sharepointdevelopmentprevious
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How can I get an item and it's attachments from the current list using SP's JavaScript Client Object Model on newform.aspx?

    I only recently learned/read about SharePoint's JavaScript Client Object Model. I'm reading online trying to figure this out but not having much luck.
    On newform.aspx (and dispform.aspx) I want to get the
    current list,
    the last item created, and it's attachments. I now the CAML query I need to get the last item created, but first I have to get the current list and I am not sure how to do that.
    I tried this but it returns null:
    SP.ListOperation.Selection.getSelectedList()

    Hi,
    For your issue, you can get the list name from the new form url and retrieve the list last created item :
    https://social.msdn.microsoft.com/Forums/office/en-US/b90a64f8-2255-41b0-9d91-78335dd4a4cf/get-list-name-from-list-url-through-javascript?forum=sharepointdevelopmentprevious
    http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to Enable Ratings on SharePoint List using Client Object Model for Office 365 SharePoint Site.

    How to Enable Ratings on SharePoint List using Client Object Model code for Office 365 SharePoint Site.
    Thanks in Advance
    Rajendra K

    Hi Rajendra,
    here you are the code and the blog, let me know if this helps
    using (ClientContext ctx = new ClientContext(https://yourSiteUrl))
    Web w = ctx.Web;
    List l = w.Lists.GetByTitle("yourListName");
    ctx.Load(l, info => info.Id);
    ctx.ExecuteQuery();
    string ListID = l.Id.ToString();
    Microsoft.Office.Server.ReputationModel.Reputation.SetRating(ctx, ListID, 1, 5);
    ctx.ExecuteQuery();
    http://blogs.technet.com/b/speschka/archive/2013/07/08/how-to-use-csom-with-ratings-in-sharepoint-2013.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Through SharePoint Client Object model, how to make color coded events on Sharepoint Calendar

    Hi,
    Through SharePoint Client Object model, how to make color coded events on Sharepoint Calendar.
    Plese share your knowledge.
    Regards
    Tharak

    Hi,
    According to your post, my understanding is that you wanted to make a color events Calendar.
    We can achieve it using the OOB method by creating the Calendars Overlay.
    http://summit7systems.com/color-code-calendar-events-in-sharepoint/
    You can also use the JavaScript to achieve it.
    http://spsawyer.wordpress.com/2013/07/18/sharepoint-color-calendar/
    http://www.planetwilson.co.uk/sharepoint-2013-colour-calendar-v2/
    more reference:
    http://usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/Color-Coding-Calendar-List.aspx
    http://blog.pathtosharepoint.com/2010/04/06/tutorial-add-color-coding-to-your-sharepoint-2007-calendar-in-15-minutes/#comment-7231
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to see version history of changes of a design or configuration object.

    Hi All,
    Is it possible to see a version history of the changes of a particular design or configuration object?
    If so then please let me know, how we look that?
    Regards,
    Soorya

    Hi,
    U have to check all the versions,modified date ,type(created,change) in all the developed objects history.Select any developed object like data type,message type, mapping,interface mapping in IR   and also in ID Objects.Select developed object,then go to its menu ,then select __History__.it shows all the information about that object.
    Thanks
    Ravi

  • How to execute XML batch commands using SharePoint Web services or Client Object Model

    Hi,
    I have a requirement to execute some batch commands to update SharePoint View Style, how can i do it using SharePoint webservices or SharePoint Client Object model.
          I need to execute the following Batch command over a particular web.
    <Method ID="UpdateView">
      <SetVar Name="Cmd">UpdateView</SetVar>
      <SetList Scope="Request">{GUID of List}</SetList>
      <SetVar Name="View">{GUID of View}</SetVar>  
      <SetVar Name="ViewStyle">6</SetVar>
      <SetVar Name="RowLimit">100</SetVar>
      <SetVar Name="Paged">TRUE</SetVar>
    </Method>

    Hi
    I tried it already... But UpdateView Method in the Views.asmx and Lists.asmx, both are not supporting for updating the style of the view (like Boxed, Newsletter...).
    If you have any code sample which will do this job with any of the SharePoint web services, please share it..

  • How do design database object

    Please let me know how to designed table,index,views,sysnonyms,sequence
    1. What is considered to design those object from bussiness point of view and how it influnced it?
    2. What are the oracle paremeter need to be considered to design those object and how it benifit/degrade?
    3. Anything which you think it is important?
    4. Do we have any tool to do this JOB?
    Please help me understanding this.
    Thank you.

    Hi,
    go through the following link.It may be helpful to u.
    http://stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10799/adobjdes.htm
    Thank you

  • How to get list of users who all are having full access in sharepoint site using client object model c#

    Hi,
    I want to fetch the list of users who all are having full access to the sharepoint list using client object model with .Net
    Please let me know if any property for the user object or any other way to get it.
    Thanks in advance.

    Here you are complete code i created from some years it lists all groups and users, you can just add a check in the permissions loop to see if it is equal to Full Control.
    Private void GetData(object obj)
    MyArgs args = obj as MyArgs;
    try
    if (args == null)
    return; // called without parameters or invalid type
    using (ClientContext clientContext = new ClientContext(args.URL))
    // clientContext.AuthenticationMode = ClientAuthenticationMode.;
    NetworkCredential credentials = new NetworkCredential(args.UserName, args.Password, args.Domain);
    clientContext.Credentials = credentials;
    RoleAssignmentCollection roles = clientContext.Web.RoleAssignments;
    ListViewItem lvi;
    ListViewItem.ListViewSubItem lvsi;
    ListViewItem lvigroup;
    ListViewItem.ListViewSubItem lvsigroup;
    clientContext.Load(roles);
    clientContext.ExecuteQuery();
    foreach (RoleAssignment orole in roles)
    clientContext.Load(orole.Member);
    clientContext.ExecuteQuery();
    //name
    //MessageBox.Show(orole.Member.LoginName);
    lvi = new ListViewItem();
    lvi.Text = orole.Member.LoginName;
    lvsi = new ListViewItem.ListViewSubItem();
    lvsi.Text = orole.Member.PrincipalType.ToString();
    lvi.SubItems.Add(lvsi);
    //get the type group or user
    // MessageBox.Show(orole.Member.PrincipalType.ToString());
    if (orole.Member.PrincipalType.ToString() == "SharePointGroup")
    lvigroup = new ListViewItem();
    lvigroup.Text = orole.Member.LoginName;
    // args.GroupsList.Items.Add(lvigroup);
    DoUpdate1(lvigroup);
    Group group = clientContext.Web.SiteGroups.GetById(orole.Member.Id);
    UserCollection collUser = group.Users;
    clientContext.Load(collUser);
    clientContext.ExecuteQuery();
    foreach (User oUser in collUser)
    lvigroup = new ListViewItem();
    lvigroup.Text = "";
    lvsigroup = new ListViewItem.ListViewSubItem();
    lvsigroup.Text = oUser.LoginName;
    lvigroup.SubItems.Add(lvsigroup);
    //args.GroupsList.Items.Add(lvigroup);
    DoUpdate1(lvigroup);
    // MessageBox.Show(oUser.LoginName);
    RoleDefinitionBindingCollection roleDefsbindings = null;
    roleDefsbindings = orole.RoleDefinitionBindings;
    clientContext.Load(roleDefsbindings);
    clientContext.ExecuteQuery();
    //permission level
    lvsi = new ListViewItem.ListViewSubItem();
    string permissionsstr = string.Empty;
    for (int i = 0; i < roleDefsbindings.Count; i++)
    if (i == roleDefsbindings.Count - 1)
    permissionsstr = permissionsstr += roleDefsbindings[i].Name;
    else
    permissionsstr = permissionsstr += roleDefsbindings[i].Name + ", ";
    lvsi.Text = permissionsstr;
    lvi.SubItems.Add(lvsi);
    // args.PermissionsList.Items.Add(lvi);
    DoUpdate2(lvi);
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    finally
    DoUpdate3();
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

Maybe you are looking for

  • How to add values in a List item using code

    Hi all, I want to populate a list item at run time with the values of my choice. im using this add_list_element('list34',1, 'Name','Smith'); or add_list_element('list34',1, 'Name',:emp.txtname); where emp is my data block and txtname is a text field

  • Adding attached images to iPhoto

    The ability to add attached images to iPhoto from Mail by choosing Save and Add to iPhoto doesn't work.

  • Doubt with primary key

    How can we update the primary key column in the master table and referential integrity in the child table , while i am deleting the master table column i am having this error... update item_master set item_id=replace(item_id,322,007) ERROR at line 1:

  • Best way to do a 4:3 pan & scan in terms of resolution?

    Brethren, I need to deliver a broadcast quality version of my project in 4:3 pan-and-scan. The project is made up of five 20 minute long pieces, usually holding about 1 or 2 layers of video, sometimes 3 or 4. I've read a few other threads on this top

  • AVCHD editing with CS4 works fine for me

    I saw a couple of threads discussing AVCHD with CS4. I was waiting quite a long time for Premiere Pro CS4 - tried some other applications in the meantime with no success - but now I can say it was worth waiting. I have a Quad Core Intel 2,4 GHz, 8 GB