Web service question? passing object - urgent

hi there
i have create a web service that takes a javabean as argument. the bean contains three strings. it is supported by the jax-rpc. when i try it, i keeping getting this error message:
java.rmi.ServerException: Internal Server Error (deserialization error: unexpect
ed XML reader state. expected: END but found: START: productDescription)
at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.ja
va:346)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:221
at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.j
ava:54)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:259)
at c2.main(c2.java:67)
i am using tomcat as the server. i followed the tutorial from sun. but it did not work. i was wondering if anyone o your experts can help me. thanks.

The class files need to exist on the target machine. For example if I serialize MyClass and send it as a stream to machine B, machine B needs MyClass.class on the CLASSPATH to deserialize it.
Also, make sure all machines working with the serialized stream have the same version of Java installed. (e.g., v1.2 does not play nice with v1.4, etc)

Similar Messages

  • Web Services with Complex Objects (Urgent !!)

    Hi,
    My last post was on a problem using IBM-RAD (Service) and AXIS2 (Client) in "New to Java" Forum. That is one of the trial scenarios I'm working on nowadays. Hope, I'll get some useful reply soon.
    Now, I need a suggestion about the application I'm working upon. It is as follows:
    (i) The application (i.e. Service Class) takes some primitive,String and/or some bean object as input
    (ii) It returns a bean object [or an array (can use collection class also if possible) of bean objects].
    (iii) The bean properties are primitive,String , other bean objects, and/or some collection object(Vector / ArrayList etc.) i.e. it should handle complex objects.
    (iv) The Service should run on Websphere and Client on Tomcat.
    A pictorial representation is given below:
    [primitive/String/bean object (Input arg)]
    [(Contains  primitive/String/other bean objects/collection class)] Bean <---------> Service <----------------------- Client
    [Calls bean] |===============> Client
    [Returns bean (or array of beans / collection object)]
    I'm now trying (by building test applications) a combination of IBM-RAD (Service) and AXIS2 (Client), but facing problems in handling array of beans and/or collection classes either on Service or on the Client side.
    So, I need some suggestions on whether I'm going the right way, or need to change my approach (or technology). Any suggestion would be appreciated.
    Please reply ASAP, it is urgent.
    Thanks in advance,
    Suman

    no problem for me, so it's not urgent.
    Request for help denied.

  • Web service question [qualitative]

    .....The cross-platform nature of Java facilitates distributed applications running on multiple hardware and operating system platforms. If all of the components of a distributed application are written in Java, then using EJBs with Java RMI is a good choice. However, web services are a great choice for integrating applications that are written in various languages, because most major platforms have support for SOAP, which is the protocol used in web services for passing object data from one application to another. This enables, for example, an application developed in Java to use the web service operations of an application developed in Perl......
    the last statement "This enables, for example, an application developed in Java to use the web service operations of an application developed in Perl".
    i have a question on this last statement.
    does it mean perl professionals can also make web service ? but using what ?
    For example, java professional can make web service using soap.jar and the server APACHE AXIS.
    How perl professional can make their web service(is it possible at all ? but it seems they can do also from the above statement) ? can they use soap.jar ? can they use APACHE AXIS server ? umm....i dont know.
    same question for also .NET people.
    the question is basically whether web service developement is exclusive for only java professionals or not ?
    because when i see any web service tutorial i get to see APACHE AXIS, java,soap etc ......so , i started thinking that java poeple can only develope web service......... .NET,PERL people can not make it. if they really can make it whats the server do they use ?
    thanks

    you can implement web services in any language, has nothing to do with java, just google 'webservices' and 'perl'
    Iggy

  • Binding xml from web service to java objects

    I would appreciate if someone can tell me where can i get information regarding
    binding of xml from web service to java objects in weblogic 6.1 .
    Thanks,
    ag

    Hi Ag,
    To my knowledge, the only information on this topic is whatever you find in the
    documentation. What exactly do you want to know?
    Can you post a set of specific questions?
    Regards,
    Mike Wooten
    "ag" <[email protected]> wrote:
    >
    I would appreciate if someone can tell me where can i get information
    regarding
    binding of xml from web service to java objects in weblogic 6.1 .
    Thanks,
    ag

  • Beginner's Web Service Question

    Can an argument to a method in a web service be an object?
    For instance, I would have to pass about 8 parameters to a method, but if I have a java object that contains those elements, can that be the parameter in a web service method call?
    class Person {
       private String fname;
       private String lname;
       private String addr;
       private String city;
       private String state;
       private String zip;
       private String phone;
       private String email;
    // Web service method
    public void processAccount(Person p){
    }

    Can an argument to a method in a web service be an
    object?yes, and web services would be quite useless otherwise

  • Exposing Web Services as Callable Objects

    Hello!
    I have SAP NetWeaver 04s SP7. How can I expose Web Services as Callable Objects?
    According to "Exposing Web Services as Callable Objects" (http://help.sap.com/saphelp_nw2004s/helpdata/en/44/4758351fcb1193e10000000a155369/frameset.htm), I should start with choosing type of CO "Service -> Web Service".
    Actually, I haven't this entry in CO type list!
    According to integrate Web Services with GP, this type appeared in SP8. What are the alternatives in SP7?
    "Background execution" and "External service" seem to be the best candidates...
    What is the best solution?
    Thanx in advance!

    Hello, Jan!
    I have SAP NWDS 7.0.07, and I cannot find there an option to create a CAF project. I can create Web service, EJB, Web DynPro, and something else - but not a CAF project. In documentation I did not find the connection points between NWDS and External Services, except some plug-ins.
    Maybe I've misunderstood you, sorry - I'm a newbie in SAP
    Actually, I've made a simple EJB, created a Web service from it, and deployed the WS to portal. Maybe, EJB instead of Web service can be somehow used in CAF?
    I've tried to create a CO of type Composite Application Service, but there was necessary to configure endpoint aliases. I've read the manual "Configuring Endpoint Aliases", but didn't succeed to make one for EJB remote call... I've defined the name, URL (http://<host_of_portal>:<portal_port>), user and pwd - but I've got an exception when tried to use the created alias:
    com.sap.caf.core.gp.servicelocator.exception.MetaModelBrowserException: Exception while trying to get InitialContext. at com.sap.caf.core.gp.servicelocator.CAFMetaModelBrowser.getAllApplications(CAFMetaModelBrowser.java:77) at com.sap.caf.core.gp.ui.backgroundco.admin.VSelect.browseCAFCore(VSelect.java:305) at com.sap.caf.core.gp.ui.backgroundco.admin.VSelect.onActionSelectEptAlias(VSelect.java:750) at com.sap.caf.core.gp.ui.backgroundco.admin.wdp.InternalVSelect.wdInvokeEventHandler(InternalVSelect.java:287) at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at
    Maybe, the easiest way is to upgrade the versions of SAP and NWDS?
    Are there some manuals that could provide me some help about:
    1) creating CAS from the deployed Web service (from its creation in NWDS till its use in CAF, step-by-step)
    2) binding Web Dynpro apps and Web services, using CAF and GP.
    Or maybe I should attend SAP courses?
    I have SAP NetWeaver 04s SP7 and NWDS ver. 7.0.07.
    Sorry for the messy post, I did my best
    Message was edited by:
            Kirill Shepitko

  • Process Web Services and BPM Objects

    Hi,
    I try to expose a web service for a specific process (not PAPI-WS) for process creation. Works well but only if I use only simple types like String, etc. as input arguments. But when I try to use an BPM object, I get an error like 'Undefined variable 'arg1''.
    So, is it not possible to use such a process web service using BPM objects as arguments?
    Regards
    Matthias

    Yes it's true but Netbeans uses one of the existing SOAP implementations to do it. I'm almost sure that it uses one of the most popular implementations JAX-WS RI or Axis by default.
    Regards,
    S&#322;awomir Wojtasiak

  • PL/SQL web service: question about stub

    hello,
    I'm currently learning how to work with PL/SQL Web Services.
    I have a question about stubs. The point is, I can deploy a web service to the OC4J server and it works. It also works when I create a stub following the WSDL I made with creating the PL/SQL web service. If I go to the endpoint in my webbrowser, the functionality is the same, with or without using a stub.
    My question is: what is the function of the stub?

    A stub is leveraged by a client application to communicate with a corresponding server side object (in this case, the web service implementation). If you think back to CORBA or RMI applications they follow a similar pattern.
    In the case of a web service you would use the stub to write a client application that could invoke the methods of the remote service and return the responses as java data types. The methods the stub class offers are the same as the methods of the web service interface. It's a common way for providing RPC like functionality.

  • Web Services with complext objects as method parameters

    Can anyone point me to an example of web services that accept complex objects as parameters, using annotations?
    Appreciate it.

    - For NetBeans related questions, nbusers mailing list is more suited. It is often visited by NetBeans experts.
    http://www.netbeans.org/community/lists/top.html
    ...[email protected]
    The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.... (There is a 'Subscribe' button next to the above that you can use to subscribe to the list).
    Can you try posting this question on nbusers list?
    - SJSE 8.1 is based on an older version of NB (NB5.0).
    You should definitely continue with NetBeans, since all development is now being done in NetBeans; all the major JSE modules have been moved to opensource at netbeans.org and are all being developed there. There are as yet no future plans to work on further releases for JSE.
    Please check out http://www.netbeans.org for more details.

  • How to send JSON data in HTTPService to PHP web service question

    I'm using Flex 4 and a mx:HTTPService to send a JSON request to a php web service. I'm not sure if I'm sending the request correctly. Could someone look at the code below to see what I'm doing wrong?
    thanks
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   width="100%" height="100%">
        <fx:Declarations>
            <mx:HTTPService id="service" url="https://my web service url/"
                            method="POST" resultFormat="text" result="onResult(event)" fault="onFault(event)">
            </mx:HTTPService>
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import com.adobe.serialization.json.JSON;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.utils.Base64Encoder;
                [Bindable]private var username:String = "[email protected]";
                [Bindable]private var password:String = "the password";
                [Bindable]private var accountNumber:String = "49055";
                [Bindable]private var anticipatedDeliveryDate:Number = 20101115;
                [Bindable]private var purchaseOrder:String = "#123 for retailer";
                [Bindable]private var detailRecords:Array = new Array();
                [Bindable]private var key:String = "abc123";
                private function populateService():void {
                    populateProducts();   
                    setRequestHeader();
                    setRequestData();
                    service.send();   
                private function setRequestHeader():void {
                    var encoder:Base64Encoder = new Base64Encoder();
                    encoder.insertNewLines = false;
                    encoder.encode(key);               
                    service.headers["Authorization"] = "VIP " + key;
                    service.headers["Content-Type"] = "application/json";
                private function setRequestData():void {
                    service.request.username = username;
                    service.request.password = password;
                    service.request.accountNumber = accountNumber;
                    service.request.anticipatedDeliveryDate = anticipatedDeliveryDate;
                    service.request.purchaseOrder = purchaseOrder;
                    service.request.detailRecords = detailRecords;
                    // caching test
                    var rnd : Number = Math.round(Math.random()*1000);
                    service.request.cacheOff = rnd;
                private function populateProducts():void {
                    var prod1:Object = new Object();
                    prod1.itemCodeOrUPC = "00241";
                    prod1.itemDescription = "Budweiser Keg 1/2 BBL";
                    prod1.quantityOrdered = 2;
                    prod1.orderUOM = "Keg";
                    var prod2:Object = new Object();
                    prod2.itemCodeOrUPC = "00219";
                    prod2.itemDescription = "Budweiser 24/12 OZ CAN";
                    prod2.quantityOrdered = 4;
                    prod2.orderUOM = "Case";
                    detailRecords.push(prod1);
                    detailRecords.push(prod2);
                private function onResult(event:ResultEvent):void
                    var json:Object = JSON.decode(event.result as String);
                private function onFault(event:FaultEvent):void
                    trace("Fault: " + event.fault.faultString);
            ]]>
        </fx:Script>
        <mx:Panel width="95%" height="100%" color="#000000">
            <mx:HBox width="100%">
                <mx:Button label="Submit" click="{populateService()}"/>
            </mx:HBox>   
        </mx:Panel>
    </s:Application>

    Have you think abut using ActionScript in your Flex application? Or, you can write javascript to be proxy between your flash app and backend PHP web service?
    Also, it seems that you will allow every customer's flash player to have a copy of secret code. I think it is dangerous design because an flv file can be easity decompiled. Therefore, you secret code can be found if it is not input by your end user and it is populated on your serverside script.

  • Help need in Java Web Service method receiving object values as null

    Below is my web method and Package is the object received from dotnet client as a consumer. I have also defined the Package object structure. Now when I receive the data from dotnet I get only identifier value, but I get ownerid and price as null, even both values are sent by Dotnet client. I want to know whether only primitive datatype in java web service works or I need to do some configuration changes in order to have build in Wrapper class datatypes? It would be a great help if somebody explains.
    @WebMethod
    @WebResult(name = "PackageId")
    public long createNewPackage(@WebParam(name = "Package") com.db.radar.wl.data.Package data1,@WebParam(name = "PackageDetail") PackageDetail data2,@WebParam(name = "PackageTrade") PackageTrade data3);
    public class Package {
    Long ownerid;
    Double price;
    long identifier;
    }

    Hi ,
    I am getting the same error. I am running my application on jboss-4.0.4.GA. Please let me know the version of jboss that you to got it working.
    Thanks
    Viv

  • Web Service portlet in PDK (Urgent!!!)

    I have a .NET web service I would like to consume in the portal and present as a portlet. For several reason I do not want to use OMNI (not the least of the reasons is after 3 weeks of working with oracle tech support on a corresponding I still can’t get OMNI and WebClipping running)
    Either way, the WS consumption system with xsl/xslt controlled presentation as seen in Web Services sample provide in the PDK suits my needs a lot better.
    Now as I mentioned I have a .NET service running and well tested.
    I can indeed consume it and even apply XSL, what I can’t do however is to pass parameters to web service.
    I define portlet with something like:
    <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
              <id>25</id>
              <name>Listings</name>
              <title>Listings Web Service Portlet</title>
              <shortTitle>Phone Listings</shortTitle>
              <description>Web Service demonstration portlet.</description>
              <timeout>100</timeout>
              <timeoutMessage>portlet timed out</timeoutMessage>
              <acceptContentType>text/html</acceptContentType>
              <renderer class="oracle.portal.provider.v2.render.RenderManager">
              <contentType>text/html</contentType>
              <charSet>UTF-8</charSet>
              <showPage class="oracle.portal.provider.v2.webservice.DocWebServiceRenderer">
                   <contentType>text/html</contentType>
                   <logging>true</logging>
                   <endpointURL>http://myserver.com/webservices/listings.asmx</endpointURL>
                   <soapAction>http://myserver.com/webservices/getPerson</soapAction>
                   <literal class="oracle.portal.provider.v2.webservice.LiteralXML"
                   handler="oracle.portal.provider.v2.webservice.LiteralXML$Handler">
                   <element name="getPerson">
                        <attribute name="xmlns">http://myserver.com/webservices/</attribute>
                        <element name="inputStr"
                        bind="urlParams/lname"
                        default="Yu"
                        prompt="Please enter last name"/>
                   </element>
                   </literal>
                   <escapeOutput>false</escapeOutput>
              <responseXSL>listings.xsl</responseXSL>
              </showPage>
              </renderer>
         </portlet>
    This actually seem to work and in the …_literal.xml log file I can see something like that:
    <getPerson xmlns="http://myserver.com/webservices/">
    <inputStr xmlns="http://myserver.com/webservices/">Yukh</inputStr >
    </getPerson >
    (Yukh – is what I passed as urlParam)
    The problem however is that service that should run a query with “WHERE lname LIKE ‘<inputStr>%’” returns the whole datatable rather then only those records that starts with Yukh in the lname column. In short request parameter is ignored by web service (or not passed)
    The only difference between my portlet and samples (most of which don’t work as advertised by the way) is that oracle …_literal.xml log file doesn’t have xmlns in the sub elements
    <WhoIs xmlns="http://tempuri.org/">
    <DomainName>oracle.com</DomainName>
    </WhoIs>
    (I have no idea why mine does (I define no attributes for inputStr element)
    If you have any idea what I might be missing or doing wrong please let me know!!! I’ll greatly appreciate.

    We tried using Omniportlet. It expects the resultset in ROWSET/ROW format. Our .Net Webservice doesn't return in rowset/row. We tried transforming using XSL, but even then it didn't work.
    Thanks

  • How to create web services with complex objects as parameters

    Hi,
    Not sure if this is the right place, but...
    I'm using Netbeans 5.5 and trying to learn web services.
    Creating a simple web service with simple parameters like strings and integers is nice and easy. I'm now trying to take the next step, and create a web service with a more complex schema as a parameter.
    I've tried two approaches, and hit dead ends on both:
    (1) Define my complex schema as an xsd file, and then create a WSDL file. Creating the schema and saving it in my EFB project works fine; when I try to create a new WSDL file, the IDE gives me a button to import external schemas - which is where the problem is: the Browse simply won't find my newly created schema file.
    (2) Define a Java class (in this case, it's a fairly simple example containing a single ArrayList), and then use the IDE to generate a web service from Java. The IDE does this fine, but I now have no idea how to consume or test the web service - I don't know where to look for the WSDL that has presumably been generated, and I'm also a bit iffy over what answers to give the WSDL creator about port names etc.
    Ideally, I'd prefer to get approach 1 to work - can someone point me in the direction of a sensible tutorial for these things?
    (Happy to carry on using Netbeans 5.5 or to revert to Sun Studio Enterprise, which I was playing with before.)
    All help appreciated, Thanks

    - For NetBeans related questions, nbusers mailing list is more suited. It is often visited by NetBeans experts.
    http://www.netbeans.org/community/lists/top.html
    ...[email protected]
    The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.... (There is a 'Subscribe' button next to the above that you can use to subscribe to the list).
    Can you try posting this question on nbusers list?
    - SJSE 8.1 is based on an older version of NB (NB5.0).
    You should definitely continue with NetBeans, since all development is now being done in NetBeans; all the major JSE modules have been moved to opensource at netbeans.org and are all being developed there. There are as yet no future plans to work on further releases for JSE.
    Please check out http://www.netbeans.org for more details.

  • 9.0.3 two web services questions

    OK, I'm trying to get web services to work and having two problems.
    The (hopefully) simple one: I want to install a web service on the local OC4J, and I can't seem to get the connection to work. Getting connection refused. Not sure why. Didn't see any problems like this with 9.0.2, but we mostly installed them on 9iAS.
    The more complex one: I started working with a PLSQL web service. While I can't execute it yet (see above), I can create one with a simple return type. For example, something like f_seq_to_name (i_seq in number) return varchar2. And the stub is pretty easy.
    But if I want to return a rowtype, for example
    f_seq_to_row (i_seq in number) return facility_table%rowtype,
    the routine is grayed out because JDev decides there is an out parameter of type "null". I could explicitly include each individual parameter, but that seems like a waste of developer effort. And this happens for both rowtypes and ref cursors, so it will be pretty hard to move any significant amount of data. So am I missing something, or is this a bug? If it's a bug, will it be fixed in 9.0.3 production?
    Of course, I can go over to BC4J and try this there with view objects. But I'm looking to see which of the tools are usable.
    -- jim

    Here is some pointers that might help:
    1. A PL/SQL Web Services Tutorial using Oracle9i JDeveloper 9.0.3 including the setup necessary to configure OC4J. As you will see you don't have to actually create a SOAP connection in JDev; for PL/SQL you simply need to have an app server connection as per the writeup. See:
    http://otn.oracle.com/tech/webservices/htdocs/series/plsql/content.html
    2. To see what data types are supported for PL/SQL take a look at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/web.902/a95453/plsqlservices.htm#1030045
    ROWTYPE and REFCURSOR are not supported. This does not appear to change between 9.0.3 preview and 9.0.3 production. There are some other approaches to consider, though your milage may vary. For example, VARRAYS and abstract datatypes are supported - you can see the ADT support in the above tutorial and try VARRAYs by tweaking it to return an array of employees rather than a single employee.
    Hope this gets you going.
    Mike.

  • Web service problem serializing objects?

    JDeveloper Studio Edition Version 10.1.3.2.0.4066
    I deployed a web service developed with JDeveloper to OAS 10.1.3.1.0
    I generated a web service client proxy in JDeveloper to call the web service.
    I get an exception (below). I tried regenerating the proxy code. Same exception when I try running it. I tried regenerating the web service and redeploying. Same exception.
    It seems like the WSDL is correct, but the XML produced by the web service drops some letters from the schema types?
    Has anyone else seen this? Here is the exception I'm getting:
    unexpected element type: expected={http://edu.apollogrp.selfservice/ISelfService.xsd}edu_apollogrp_selfservice_SelfServiceResults, actual={http://edu.apollogrp.selfservice/ISelfService.xsd}edu_apollog_SelfServiceResults
    at oracle.j2ee.ws.common.encoding.SerializerBase.verifyType(SerializerBase.java:168)
    at oracle.j2ee.ws.common.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:170)
    at oracle.j2ee.ws.common.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:147)
    at customerservice.proxy.runtime.SelfServiceBinding_Main_RespS__SOAPSerializer.doDeserialize(SelfServiceBinding_Main_RespS__SOAPSerializer.java:44)
    at oracle.j2ee.ws.common.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:180)
    at customerservice.proxy.runtime.SelfServiceBinding_Stub._deserialize_Main(SelfServiceBinding_Stub.java:193)
    at customerservice.proxy.runtime.SelfServiceBinding_Stub._readFirstBodyElement(SelfServiceBinding_Stub.java:176)
    at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:333)
    at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
    at customerservice.proxy.runtime.SelfServiceBinding_Stub.main(SelfServiceBinding_Stub.java:81)
    at customerservice.proxy.SelfServicePortClient.mainExt(SelfServicePortClient.java:44)
    at customerservice.SelfService.getSSData(SelfService.java:116)
    at customerservice.SelfService.Test(SelfService.java:93)
    at customerservice.SelfService.main(SelfService.java:109)

    Yeah. You need a deserialize class to deserialize (cast) the Complex Data Type (object). But the orignal class is not necessary. Also, it is impossible to use the orignal class if you write a client on J2EE platform to consume a service on .NET platform. Your can use the WSDL file to generate a tub using some tool. The stub can handle the remote calls and de/serialization (cast).
    Hope this can help you. Cheers
    Shaun

Maybe you are looking for