How to build complex object to be sent to a RESTful web service?
Hi,
I'm working with RESTful web services on J2EE 1.6.
I create the database, generate the entities and generate the web services.
I must implement Javascript clients and I don't want to use any open source for that.
I have a simple example that works just fine. For the database :
CREATE TABLE Shopper(
shopperId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
firstName VARCHAR(40),
lastName VARCHAR(40),
phone VARCHAR(40),
email VARCHAR(50) NOT NULL,
receiveEmailNotification ENUM('Y', 'N'),
index(email)
I create this xml information with javascript :
*<shopper>*
*<email>c</email>*
*<firstName>c</firstName>*
*<lastName>c</lastName>*
*<phone>c</phone>*
*<receiveEmailNotification>Y</receiveEmailNotification>*
*</shopper>*
and it is saved in the database. I have a more complex application with relationships between entites. For this database :
CREATE TABLE Shopper(
shopperId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
firstName VARCHAR(40),
lastName VARCHAR(40),
phone VARCHAR(40),
email VARCHAR(50) NOT NULL,
receiveEmailNotification ENUM('Y', 'N'),
index(email)
CREATE TABLE Address(
addressId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
street VARCHAR(60),
streetNo VARCHAR(20),
postalCode VARCHAR(30),
city VARCHAR(40),
country VARCHAR(40),
otherInfo TEXT,
shopperId MEDIUMINT NOT NULL,
foreign key (shopperId) REFERENCES shopper(shopperId) ON DELETE CASCADE,
index(shopperId)
I was expecting that xml information sent from the browser should be:
*<address>*
*<city>c</city>*
*<country>c</country>*
*<otherInfo>c</otherInfo>*
*<postalCode>c</postalCode>*
*<street>c</street>*
*<streetNo>c</streetNo>*
*<shopper>*
*<email>c</email>*
*<firstName>c</firstName>*
*<lastName>c</lastName>*
*<phone>c</phone>*
*<receiveEmailNotification>Y</receiveEmailNotification>*
*</shopper>*
*</address>*
but I keep on getting errors.
I want to send one XML structure that will be stored in two tables according to the foreign key relation.
Does the RESTful web services code generated by Netbeans or Eclipse support this?
Is my XML structure not built correctly?
Kevin,
My object base class is Abstract and class I am using in Flex 3 is class inheriting abstract class. But when calling webservice Flex creating soap message of base class and I am getting error in .Net web services that "Can not create instance of Abstract class".
Below is the soap message difference calling same WCF method from .Net and Flex. For example Constraint is the base class and JobConstraint is the class which inherit Constraint class. But flex send message forming only Constraint while .Net soap is specifying i:type="JobConstraint".
Part of soap message Calling from .Net
<
Constraints><
Constraint i:type="JobConstraint"><Position
>true</Position><
Rank>2</Rank><
Requirement>true</Requirement></
Constraint></
Constraints>
Part of Soap message calling from Flex 3
<ns0:Constraints>
<ns0:Constraint>
<ns0:Position>true</ns0:Position>
<ns0:Rank>2</ns0:Rank>
<ns0:Requirement>true</ns0:Requirement>
</ns0:Constraint>
</ns0:Constraints>
Similar Messages
-
How to Integrate HRMS with a 3rd party application via restful web services?
Hi All,
I am new to Oracle network and wanted to know how we can integrate Oracle HRMS with our external website via web services. I have already looked in PL/SQL APIs but that is not what i need but i want the integration to be web based like SOAP/XML or JSON.
Thanks,
AqeelHi
Yes we have implemented SSO with 3rd party application running on IIS server (running on Windows 2003 server).
Here you go the link
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/security/s-u/using sap logon tickets for sso to microsoft-based web applications.pdf
forum
/thread/11711 [original link is broken]
DEMO
https://www.sdn.sap.com/irj/sdn/developerareas/ep?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798
Cheers
Jawahar Govindaraj
PS:Reward pts -
Complex object as parameter from BPEL PM to Web Service
Hello,
I'm having a problem with being able to invoke a method on my web service from BPEL PM. It's a 'create' method, so I'm sending a complex object as the input parameter of the method.
I'm encountering the same kind of problems I have at different stages in the project I'm on: SOA works really well as long as you don't use complex objects. As soon as you do, SimpleDeserializer exceptions seem to be thrown all over the place. In this case, the error I'm getting is:
<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
<part name="code">
<code>Server.userException</code>
</part>
<part name="summary">
<summary>when invoking endpointAddress 'http://covarm.tvu.ac.uk/validationEvent/services/validationEventSOAP', org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</summary>
</part>
<part name="detail">
<detail>AxisFault faultCode: {http://xml.apache.org/axis/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:188) at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:893) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:207) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:265) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:190) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:276) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:126) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:437) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:316) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:701) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:335) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:866) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)</detail>
</part>
</remoteFault>
The WSDL is at:
http://covarm.tvu.ac.uk/validationEvent/wsdl/validationEventSOAP.wsdl
I'm invoking the 'createEvent' method. I know the service works okay because I've tested it with Rational Software Architect and Eclipse's Web Services Explorer, and also with standalone code and JUnit tests.
The problem seems to be getting the mapping from BPEL PM to the Web Service. I'm sending the object as a message type that's defined in the WSDL of the service:
<xsd:element name="createEventRequest" type="tns:event" />
- <xsd:complexType name="event">
- <xsd:sequence>
<xsd:element name="event-detail" type="tns:event-detail" />
<xsd:element name="proposed-dates" type="tns:proposed-dates" />
<xsd:element name="panel" type="tns:panel" />
<xsd:element name="development-team" type="tns:development-team" />
<xsd:element name="minute" type="xsd:string" />
<xsd:element name="feedback-list" type="tns:feedback-list" />
</xsd:sequence>
</xsd:complexType>
Is this something that's
a) fixable?
b) workaroundable?
c) a known issue?
Thanks,
DanBefore I start crying at my own impotence, how can I configure the bpel.xml file (for obtunnel_ when it looks like this?
<?xml version = '1.0' encoding = 'UTF-8'?>
<BPELSuitcase>
<BPELProcess id="RunValidationEvent" src="RunValidationEvent.bpel">
<partnerLinkBindings>
<partnerLinkBinding name="client">
<property name="wsdlLocation">RunValidationEvent.wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="validationEvent">
<property name="wsdlLocation">validationEventSOAPRef.wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="notification">
<property name="wsdlLocation">notificationSOAPRef.wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="TaskManagerService">
<property name="wsdlLocation">TaskManagerService.wsdl</property>
<property name="wsdlRuntimeLocation">${domain_url}/TaskActionHandler/TaskManagerService.wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="TaskRoutingService">
<property name="wsdlLocation">TaskRoutingService.wsdl</property>
<property name="wsdlRuntimeLocation">${domain_url}/TaskActionHandler/TaskRoutingService.wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="TaskActionHandler">
<property name="wsdlLocation">TaskActionHandler.wsdl</property>
<property name="wsdlRuntimeLocation">${domain_url}/TaskActionHandler/TaskActionHandler?wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="IdentityService">
<property name="wsdlLocation">LocalIdentityService.wsdl</property>
</partnerLinkBinding>
<partnerLinkBinding name="processParticipant">
<property name="wsdlLocation">processParticipantSOAPRef.wsdl</property>
</partnerLinkBinding>
</partnerLinkBindings>
<activationAgents>
<activationAgent className="oracle.tip.pc.services.hw.task.impl.TaskActivationAgent" partnerLink="TaskManagerService"/>
</activationAgents>
</BPELProcess>
</BPELSuitcase>
Or is it that I'm using local wsdl refs when I should be defining a partner likk in my web service wsdl? -
How to connect Businnes Object Enterprise XI R2 to Sharepoint 2007 web-part
Dear all,
How to connect Businnes Object Enterprise XI R2 to Sharepoint 2007 web-part?
We've connected the SQL Server Analysis Services (OLAP) with Voyager, but how to create the dashboard/reporting/pivot-table/KPI with the web-part created with Business Object Enterprise?
Thank you,
Julius FenataI am also looking at:
1. Saving Webi reports on a SharePoint server.
2. Launching BOBJ report viewer from the SharePoint server using SOA to view these reports.
Has anyone done something similar? Any ideas and/or documentation available on this?
Thanks,
Kashif -
How to register Rest web services in Cold Fusion 9 administration console?
I am building a Rest web service using Cold Fusion 9 and Cold Fusion Builder 3 and now I want to register it on Cold Fusion 9 admin console, but I didn't see any option there as in CF 10 and CF 11 Data Services ---> Rest Web service. So, please tell me how to register my Rest web service in CF 9 either through admin console or through code?
Simple answer: you can't. REST services were a new feature released with CF10. Alternatively, you can use a community-supported framework to provide REST services, such as:
Taffy (a dedicated REST framework)
FW/1 (an MVC framework with REST capabilities)
ColdBox (an MVC framework with REST capabilities)
-Carl V. -
How to register Rest web services in Cold Fusion 9 ?
I am building a Rest web service using Cold Fusion 9 and Cold Fusion Builder 3 and now I want to register it on Cold Fusion 9 admin console, but I didn't see any option there as in CF 10 and CF 11 Data Services ---> Rest Web service. So, please tell me how to register my Rest web service in CF 9 either through admin console or through code?
You've posted this question twice. Please delete this one and people can respond to the other one.
-Carl V. -
How to schedule Webi Documents with Prompts with RESTful Web Services
Hello,
I am trying to schedule Webi Documents with Prompts using RESTful Web Services with prompts. I am using Simple Rest Client app provided by Google Chrome. We have Business Objects SP6 Patch 1.
However the documentation for RESTful Web Services has only examples for the following
1. Schedule Documents without any Prompts to various destinations and recurrences.
2. Refresh Documents with Prompts.
Is there any example for scheduling documents with prompts? Please advise
Thanks in advanceHi Peter,
With Rest Client, on BI4.0 SP6, you can schedule Webi documents with prompts using the following:
URL: http://<servername>:6405/biprws/raylight/v1/documents/<docid>/schedules
Method:POST
Request Body:
<schedule>
<name>Enter values for City:</name>
<format type="webi"/>
<destination>
<inbox/>
</destination>
<once retriesAllowed="2" retryIntervalInSeconds="60">
<startdate>2013-08-26T15:58:51.000+02:00</startdate>
<enddate>2013-08-27T15:58:51.000+02:00</enddate>
</once>
<parameters>
<parameter optional="false" type="prompt" dpId="DP0">
<id>0</id>
<technicalName>Enter values for City:</technicalName>
<answer constrained="false" type="Text">
<values>
<value>Austin</value>
</values>
</answer>
</parameter>
</parameters>
</schedule>
Using the above request you can schedule the Webi document with prompts to inbox destination and set for once.
The schedule can be sent in different formats to several destinations and set just for once, daily,
hourly or monthly.
You can also check the example for this on page 275 of SAP Webi RESTful SDK user guide for BI4.0 SP6 below:
http://help.sap.com/businessobject/product_guides/boexir4/en/xi4sp6_webi_restful_ws_en.pdf
Regards,
Swati
Message was edited by: Swati Ikhe -
TS4055 How do I use my MacBook Air to access the Amazon Web Service?
How do I use my MacBook Air to access AWS (Amazon web Service)? The information provided to me by Apple Care seems to be about allowing outside access to my MacBook.
Sorry, but does this relate to Apple Remote Desktop, Apple's software for managing networked Macs, in some way? If so, how are you using ARD in relation to Amazon's services?
-
How to bind to REST web services?
The REST web services don't provide WSDL. How to bind this kind of services?
Thanks.Melvin, not yet (in fact it's on my plate) - what I usually argue for is to abstract these pieces into services (much like what I did in the rest sample, and then expose them .. )
In any case - I will start collecting ideas (that is topics) for best practices soon .. Let me know if you have any specific wishes.
cheers -
How to call restful web services from BPEL
How do we call create partnerlinks for calling RESTful web services in Oracle BPEL.
Any ideas ?Raymond,
1. To consume WebService in Flex you don't need FDS at all.
2. AFAIK, you need crossdomain.xml at WS host or System.allowDomain("ws-host") or System.allowInsecureDomain("ws-host") on Flex side. Check Flex documentation.
3. Better to discuss this topic in some other forum -- say WebAS General. It's not related to WD
Valery Silaev
SaM Solutions
http://www.sam-solutions.net -
Getting the Request Object in the EJB published as a Web Service
Hi experts,
I have a Portal Service that call a BAPI in a back-end system with the Connector Framework. I have a Portal Component that calls the Portal Service, passing the Locale (request.getLocale()) and the User (request.getUser()) object. It's work fine!
I need to call the Portal Service by an EJB that is published as a Web Service. The connection between the EJB and Portal Service is ok, but I don't know how to get the Locale and the User object in the EJB to pass to the Portal Service.
Is possible to get the request object from the HTTP SOAP Request?
Thanks,
GustavoHey Alice!
The Feature Hashing module is actually a wrapper around
Vowpal Wabbit's implementation of the murmurhash. Thus, it takes text in, and produces 2^N new features based on the text, where N is the bitsize specified in the module. These features (and not the original text!) should be used during model training.
The Learner will then keep track of these features behind the scenes.
When you publish your web service and these features are recomputed for new input text (same N), they are used as the features for scoring.
Does that make sense?
Regards,
AK -
Problem when adding java objects in a vector and passing thru web service
Hi! I'm getting this error when I try to add a java object I created into a vector and passing it through a web service: java.lang.IllegalArgumentException: No Serializer found to serialize a 'testObj' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'
This does not happen when I simply add strings or Integer objects into the vector. What am I missing?
Thanks.just chek this
http://forum.java.sun.com/thread.jspa?threadID=501189&messageID=2370914
Edited by: garava on Jul 16, 2008 1:13 PM.
It would be great if you could paste the wsdl part for that vector and just have a look for the complex typr cntent
like for HashMap we have the following mapping
<complexType name="HashMap">
<sequence>
<element name="item" minOccurs="0" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="key" type="anyType" />
<element name="value" type="anyType" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>Since in Value it should again contain a mapping for the Object which you are trying to pass then only an appropriate serializer and deserilaizer would get generated. Hope this answers your query. For refernece
http://www.theserverside.com/tt/articles/article.tss?l=Systinet-web-services-part-2
[http://www.theserverside.com/tt/articles/article.tss?l=Systinet-web-services-part-2|For refernce tutorial]
Thanks,
Avadhoot Sawant.
Edited by: garava on Jul 16, 2008 1:16 PM -
How to consume Google REST web service
Dear All,
I have a task to embed Google Maps into web dynpro and/or CRM WebUI.
There is no problem with embedding only map with route on it, but I need also calculated distance.
In WebDynpro I've just created iFrame CHIP component which targets: http://maps.google.pl/maps?output=embed and two CHIPS with import parameters to give source and destination address. Route is calculated and drawn.
Problem is with the distance, because the only way is to consume google web service (which is not SOAP, so I can't use service consumer). It must be something like web request.
URL which I need to access is:
http://maps.googleapis.com/maps/api/distancematrix/xml?&mode=driving&sensor=false&origins=Warsaw&destinations=Hamburg
or
http://maps.googleapis.com/maps/api/distancematrix/json?&mode=driving&sensor=false&origins=Warsaw&destinations=Hamburg
where origins and destinations must be connected with import CHIPS. How to access such service in a proper way?
Second thing is that I have to parse response.. it could be XML or JSON format. I just need summary distance. Any idea?
Btw - I'm quite fresh with WebDynpro and WebUI, so I'm looking for good 'HOW TO' guide. Can you recommend something which is good to start with?
thanks in advanceHi,
check this reference to start with: [How to integrate google maps in Web Dynpro ABAP|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0bca5ae-3c5c-2d10-938d-a81787f59ace?QuickLink=index&overridelayout=true]
Also this demo by Thomas Jung Sir: [Google Maps: Flash Islands in WDA|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/80f16eef-91ef-2b10-4fb5-d709436f3cc3&overridelayout=true]
hope this helps u.,
@moderators: Don't Close this thread instead move to Web Dynpro ABAP Forum
Thanks & Regards,
Kiran -
How to retrieve multiple values from a DB Adapter to a Web Service
Hello,
I'm creating a login WS that receives the username and password and returns the user status, full name and a set of permissions (the number of permissions varies among users).
In order to do that i've created a DBAdapter that is calling a PL/SQL procedure. This DBAdapter is connected to the login Web Service through a mediator.
I have two problems:
1 - I don't know the type of variable that the PL\SQL procedure should return. Like I said I need to retrieve an undefined number of values from a table (user permissions). How can I do this inside a PL\SQL procedure? What kind of structure should i return?
2 - How can i assign a multiple value variable (the permission variable) in the mediator? Is the mediator going to identify that this is variable is multiple valued and add automatically a for-each statement?
The Oracle DB version im using is the 11.1.0.7.0 and the Oracle SOA Suite 11.1.1.3.0.
Thanks in advance,
PauloHey guys,
thanks for your help.
I've created a userdefined type and sucessfully retrievied from the PL\SQL procedure multiple values. I have also mapped this values with the web service.
Even though everything's working fine i would like to understand if it is also possible to use the XMLType to return these values. I ask this cause I don't no if by returning a XMLType i can explicitly map the XML elements inside the mediator component.
If possible what are the main advantages/disavantages between using XMLType and Userdefined Types?
Paulo. -
How to connect a PDF form to SQL server database through web service?
Hi,
I'm new to LiveCycle designer. I have designed a PDF form in LC designer ES2, which suppose to take a personnel number and retrieve the personnel information from a SQL server database. Currently its working fine with XML data and a search button, but I need to securly connect to a database through web service. I know how to connect to a wsdl file through designer. What I need is a wsdl file to connect the form to database. For this purpose, is there any WSDL code to use as the web service?
I really appreciate your help and advice.Hi,
I'm new to LiveCycle designer. I have designed a PDF form in LC designer ES2, which suppose to take a personnel number and retrieve the personnel information from a SQL server database. Currently its working fine with XML data and a search button, but I need to securly connect to a database through web service. I know how to connect to a wsdl file through designer. What I need is a wsdl file to connect the form to database. For this purpose, is there any WSDL code to use as the web service?
I really appreciate your help and advice.
Maybe you are looking for
-
hey please help itunes wont open up it says it can not be accessed and i dont know how to fix it please help
-
Time machine bug after upgrading system
Hello, I just upgraded my macbook pro from Lion to Mountain Lion. After this upgrade, I created a new admin account and tried to install back my previous account with my entire files thanks to migration assistant with a time machine data. Unfortunate
-
XML Namespace and schemalocation property?
In many xml examples i see many nameschemas which even dont use in xml like in below example we have defined nameschemas as xsi,aop and one default namespace. If we dont use them what the purpose of defining them.Did not attach the xml as its quite b
-
PDF within IE acting differently between Reader 9x and 11x
We are in the process of upgrading from Reader 9x to 11x. In testing users have found that when they try to open multiple PDF's from a single webpage within Internet Explorer, 11x opens only one at a time, closing the current one and opening a new on
-
Airport signal becomes MUCH worse after 10.4.7 update?
Airport signal in 10.4.7 is 50% of what it was in 10.4.6. It also now cuts in and out. What changed? And how can one go back to the good signals and stable reception under 10.4.6? Mac OS X (10.4.7)