Web service and web dynpro
Hi,
I am learning about web services in java web dynpro. I follow some tutorial on how to create a web service in a java web dynpro using netweaver developer studio. The tutorial works (I think) because in the picture of my local development, I can see the web dynpro component and the model representing the web service. In the web dynpro explorer view I can see the model has been created and the method/service that can be called. But now I don't know how to go on calling these services by the web dynpro methods; can anybody please explain me or post me a link with a tutorial for this (that I did not find). Thanks in advance
Gabriele
Hi
Please go throught links
https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/faq%252b-%252bmodels%252b-%252badaptive%252bweb%252bservice
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d076c662-8c0f-2b10-8ca4-e63c26e2e489
Import Adaptive Web service Model
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/900bbf94-a7a8-2910-e298-a651b4706c1e
hope will help you .
murali
Similar Messages
-
Basic auth with RESTful WEb service and Web Service reference
Hi, All,
We have made much progress on getting an application working wtih RESTful web services but now are trying to figure out how to lock down a RESTful Web service while making it available for a particular application.
We are using one of the sample 'emp' table web services that come with Apex 4.2 and are trying to apply Basic Auth to the WEb Service via Weblogic filter defined in the web.xml file. That works fine. I now get challenged when I try to go to :
https://wlogic.edu/apex/bnr/ace/hr/empinfo/
And when I authenticate to that challenge I am able to get the data. (we are usiing LDAP authentication at the Weblogic level)
However, I am not sure how to get same basic authentication to work with the Web Service reference in my application. I see the error message in the application when I try to call that Web Service:
401--Unauthorized<
And I see:
"The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials"
How do I provide the credentials in the Web REference or do I provide credentials in the Application?
Web service works fine if I remove the RESTful web service basic auth from the Web.xml file.
Should we NOT use Weblogic basic auth and instead use basic auth from Workspace RESTful web service definition. If so, how do we implement THAT basic auth in the Web Service definition and in the Web SErvice Reference on the application?
Thanks,
PatWhat I mean is diid you try to use the PL/SQL package for APEX webservice. Here is an example I use (modified and shortened, just to show how much better this is than to use it from the application).
CREATE OR REPLACE PACKAGE webservice_pkg
IS
PROCEDURE create_webservice (
p_id IN NUMBER,
p_message OUT VARCHAR2,
p_workspace IN VARCHAR2 DEFAULT 'MY_WORKSPACE',
p_app_id IN NUMBER DEFAULT v ('APP_ID'),
p_app_session IN VARCHAR2 DEFAULT v ('SESSION'),
p_app_user IN VARCHAR2 DEFAULT v ('APP_USER')
END webservice_pkg;
CREATE OR REPLACE PACKAGE BODY webservice_pkg
IS
PROCEDURE set_credentials (
p_workspace IN VARCHAR2,
p_app_id IN NUMBER,
p_app_session IN VARCHAR2,
p_app_user IN VARCHAR2
IS
v_workspace_id NUMBER;
BEGIN
SELECT workspace_id
INTO v_workspace_id
FROM apex_workspaces
WHERE workspace = p_workspace;
apex_util.set_security_group_id (v_workspace_id);
apex_application.g_flow_id := p_app_id;
apex_application.g_instance := p_app_session;
apex_application.g_user := p_app_user;
END set_credentials;
PROCEDURE create_webservice (
p_id IN NUMBER,
p_message OUT VARCHAR2,
p_workspace IN VARCHAR2 DEFAULT 'MY_WORKSPACE',
p_app_id IN NUMBER DEFAULT v ('APP_ID'),
p_app_session IN VARCHAR2 DEFAULT v ('SESSION'),
p_app_user IN VARCHAR2 DEFAULT v ('APP_USER')
IS
v_envelope VARCHAR2 (32000);
v_server VARCHAR2 (400);
v_url VARCHAR2 (4000);
v_result_url VARCHAR2 (1000);
v_collection_name VARCHAR2 (40) := 'PDF_CARD';
v_message VARCHAR2 (4000);
v_xmltype001 XMLTYPE;
BEGIN
v_url := v_server || '.myserver.net/services/VisitCardCreator?wsdl';
FOR c IN (SELECT *
FROM DUAL)
LOOP
v_envelope :=
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" '
|| 'xmlns:bran="http://www.myaddress.com">'
|| CHR (10)
|| '<soapenv:Header/><soapenv:Body>'
|| CHR (10)
|| '<parameter:'
|| 'some_value'
|| '>'
|| CHR (10)
|| '<bran:templateID>'
|| p_id
|| '</bran:templateID>'
|| '</soapenv:Body>'
|| CHR (10)
|| '</soapenv:Envelope>';
END LOOP;
set_credentials (p_workspace, p_app_id, p_app_session, p_app_user);
BEGIN
apex_web_service.make_request
(p_url => v_url,
p_collection_name => v_collection_name,
p_envelope => v_envelope
p_message := 'Some message.';
EXCEPTION
WHEN OTHERS
THEN
v_message :=
v_message
|| '</br>'
|| 'Error running Webservice Request. '
|| SQLERRM;
END;
BEGIN
SELECT v_result_url
|| EXTRACTVALUE (VALUE (t),
'/*/' || 'Return',
'xmlns="http://www.myaddress.com"'
xmltype001
INTO v_result_url,
v_xmltype001
FROM wwv_flow_collections c,
TABLE
(XMLSEQUENCE (EXTRACT (c.xmltype001,
'//' || 'Response',
'xmlns="http://www.myaddress.com"'
) t
WHERE c.collection_name = v_collection_name;
EXCEPTION
WHEN OTHERS
THEN
v_message := v_message || '</br>' || 'Error reading Collection.';
END;
EXCEPTION
WHEN OTHERS
THEN
p_message := v_message || '</br>' || SQLERRM;
END create_webservice;
END webservice_pkg;
/If you use it this way, you will find out what the problem is much faster.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Help - cannot access web service outside web proxy
I'm trying to access a public web service - and web proxy stops me from doing it.
Here is my code:
package test;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import net.webservicex.www.WeatherForecastLocator;
import net.webservicex.www.WeatherForecastSoap;
import net.webservicex.www.WeatherForecastSoapStub;
import net.webservicex.www.WeatherForecasts;
import java.net.*;
import java.io.*;
public class TestOutput {
public static void main(String[] args) {
initialiseConfiguration();
printForecast();
public static void initialiseConfiguration() {
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "proxyserver");
System.setProperty("http.proxyPort", "8080");
System.setProperty("http.proxyUser", "userid");
System.setProperty("http.proxyPassword", "password");
public static void printForecast() {
try {
WeatherForecastLocator wfl = new WeatherForecastLocator();
WeatherForecastSoap wfs = wfl.getWeatherForecastSoap();
WeatherForecasts forecasts = wfs.GetWeatherByZipCode("90210");
} catch (Exception e) {
e.printStackTrace();
}Here, I was using the test web service located in www.webservicex.net/WeatherForecast.asmx
I've created stubs using Eclipse (package net.webservicex.www) in another project, compiled into a jar, and imported into the test project.
The test is working beautifully from my home. It's failing in the office with the error:
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (407)Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. )
faultActor:
faultNode:
faultDetail:
{}:return code: 407
It's failing when it's trying to execute
WeatherForecasts forecasts = wfs.GetWeatherByZipCode("90210");
The "initialiseConfiguration" function is doing its job OK - it's actually helping me to go through the proxy - if I'm doing simple stuff like accessing internet sites. I've tested it - I can get to any external site and read from it. The moment I disable "initialiseConfiguration", I can't get through the proxy.
So, probably, the problem lies in the web services client classes generated by Eclipse and based on axis. Maybe, the code gets through the proxy, but then starts to do something without authentication??? (I'm not sure if it's possible at all, but who knows...)
I've read a lot of postings on this subject and couldn't find a solution that would work for me. I'm very surprised, because my situation is very common - there are more and more public web services, and most organisations have firewalls. Obviously, I'm making some very elementary mistake.
Please helpWe have the same problem, not with SOAP but with XML-RPC (err 407). We're still stumped, and i agree that the problem should be common, but i don't see the mistake, so it's not that obvious.
Hypothesis: the proxy is spying on the requests content , and filtering out xml. Can you check that ?
Message was edited by:
idiallo -
Error while calling a web service in web dynpro through XI
Hello,
I was following a blog for Invoking Webservices using SAP XI
/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
I have done all the steps specified but when I import the wsdl file in web dynpro application and deploy the project I get the following error:
<b>"Exception on execution of web service with WSDL URL 'bankws_OUT_MI.wsdl' with operation 'bankws_OUT_MI' in interface 'bankws_OUT_MI'"</b>
where:
bankws_OUT_MI -
is the message interface name.
I have defined a web service in the integration reopsitory as follows:
<b>http://PEP:50000/XISOAPAdapter/MessageServlet?channel=:bankws:s_comm</b>
where
bankws --- service name
s_comm -
sender communication channel
selected 'bankws_OUT_MI' message interface from the given choices
'bankws_IN_MI' or 'bankws_OUT_MI'.
interface name: bankws_OUT_MI -
mesage interface name
Can anyone guide me how to proceed further. Also if possible can anyone send me some helpful documentation regarding how to call a web service in web dynpro through XI.
Thanks in advance.
Regards,
Imtoolhello everyone,
I made the whole scenario again and it is running succusfully in Xml spy. Now when i call the webservice in web dynpro... I get the following error:
<b>com.sap.engine.services.webservices.espbase.discovery.BaseIOException: Invalid Response Code 200 while accessing URL: http://PEP:50000/XISOAPAdapter/MessageServlet?channel=:OOMS_WS_OUT:CC_OOMS_WS_OUT. Response Message: OK. Content Type: text/html; charset=utf8. Body Content: <html> <head><title>MessageServlet</title></head> <body> <h3>Message Servlet is in Status OK</h3> <h3>Status information:</h3> Servlet com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id: //tc/xi/645_VAL_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#7 $) bound to /MessageServlet <br/>Classname ModuleProcessor: null <br/>Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean <br/>Lookupname for remoteModuleProcessorLookupName: null <br/>ModuleProcessorClass not instantiated <br/>ModuleProcessorLocal is Instance of com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0 <br/>ModuleProcessorRemote not instantiated </body></html></b>
I have also made the entry in the visual administrator for metadata_dest and execution_dest.
Does anybody have an idea what mistake i am doing.
Thanks,
Imtool -
Unable to consume secured Web service from a Dynpro application
Hello,
I have followed <a href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/bac36a469e4c75aba646077e71516d/frameset.htm">this tutorial</a>
in order to protect and consume a secured Web service from a Dynpro application using SAP logon ticket.
The problem is that after implementing everything needed I receive 401 Unauthorized when I am trying to consume it from the web dynpro side.
If I manually transfer the request the credentials, before the execute i.e:
modObj._setUser
modObj._setPassword
modObj.execute();
I am able to call it, meaning the dynpro application doesn't transfer these credentials to the Webservice even though it's authentication property is set to true.
Any idea how to solve it?
Roy
Message was edited by:
Roy CohenTry below steps
Add jars
o security.class
o tc/sec/destinations/interface
Setting WebDynpro project property
o Project>Properties>Web Dynpro References-->Interface references
 Name=tcsecdestinations~interface
o Project>Properties>Web Dynpro References-->Service reference
 Name=webservices
 Name=tcsecdestinations~service
Dynamically Set httpdestination and Call web service
final InitialContext ctx = new InitialContext();
final DestinationService dstService = (DestinationService)ctx.lookup(DestinationService.JNDI_KEY);
if (dstService== null)
throw new NamingException ("Destination service not available");
final Destination destination = dstService.getDestination("HTTP"," DestinationName");
// getting user name
Properties destprop = destination.getDestinationProperties();
String username = destprop.getProperty("USERNAME");
String password = destprop.getProperty("PASSWORD");
final HTTPDestination httpDestination = (HTTPDestination) destination;
HttpURLConnection httpConnection = httpDestination.getURLConnection();
String httpURL = String.valueOf(httpConnection.getURL());
Request_AdvLocationVer1ViDocument_getLocation obj=wdContext.currentRequest_AdvLocationVer1ViDocument_getLocationElement().modelObject();
obj._setUser( user );
obj._setPassword(pass);
obj._setEndPoint(httpURL);
obj.execute();
Rahul -
Consuming External Web Services in Web Dynpro Java
Hi All,
I an trying to consume external web service in Web dynpro java using Adaptive Web Service Model.
But getting below mentioned error while executing the web service
Exception on execution of web service with WSDL URL 'D:\Web Service Project\CurrencyConvertor.asmx.xml' with operation 'ConversionRate' in interface 'CurrencyConvertorSoap'
Steps i followed are as below:
1. Created Adaptive Web Service Model for this i select WSDL source as "Local File System or URL"
In next step i select No logical destination radio button and click on next
In next step, browse the WSDL file and successfully import the WSDL file.
2. After successfully importing the WSDL file i wrote below code in Init method:
WebModel modelweb = new WebModel();
Request_ConversionRate reqConversion = new Request_ConversionRate(modelweb);
ConversionRate conversion= new ConversionRate(modelweb);
reqConversion.setConversionRate(conversion);
wdContext.nodeRequest_ConversionRate().bind(reqConversion);
3.After that execute the model - code is given below :
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
wdContext.currentRequest_ConversionRateElement().modelObject().execute();
wdContext.nodeResponse().invalidate();
wdContext.nodeConversionRateResponse().invalidate();
catch(Exception e)
manager.reportException(e.getMessage(), false);
Please let me know how to resolve this.
Thanks
SandyHi,
You need to use destinations for metadata and modeldata.
Configure those destination in Visula admin.
you can refer to following link.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
Regards,
Shruti. -
Consume Web Service in Web Dynpro
Hi Experts,
I´m currently trying to learn web dynpro development.
Scenario: I have one component which embed two views. One view is for enter customer number and in the other view I will see the name of the customer. The name of this customer is provided in a sap erp2005. I have develop a function modul and wich gave me the appropriate data(customer name). Then I create a web service base on this function module.
When I test this web serviec in WSNavigator, I get the customer name, so the web service is working well.
My Problem is: I can´t invoke this Web Service in Web Dynpro. My steps to invoke web service were: create a model with the web service wsdl and then I add this model in the component (in "Used Models").
I have create a application and assign it to the component. When I "Deploy new archive and Run" the application I be come the error: "Configuration not found for application: demo.sap.com/test_wd3,serviceRefId:7fecf23b-0895-48f3-9902-0e7015a705c3. Please check the configuration details from the NWA. You may have not assigned the Service Group to a Provider System, or the generation of the configuration has failed."
What do I have to consider or to set up?
It is right to assign the input field to the context parameter?
PS: I have followed the steps in this tutorial, but I don´t use XI or PI
http://www.riyaz.net/blog/xipi-consuming-xi-web-services-using-web-dynpro-part-ii/technology/sap/7/
best regards
Anna von Landsberg
Edited by: Anna_von_Landsberg on Dec 8, 2010 4:48 PMHi,
I have the following message error:
Exception on execution of web service with WSDL URL
'http://j2eeserver:port/xxxx/Config1?wsdl'
with operation 'RequestNode' in interface
'urn:xxxxx'
When i debugged it, I found the following error:
Cannot find the required parameter [unTipoProducto] in request message content.
What is wrong?, I pasted the code of my method, that call to web service in the component controller.
public void Alta_Entrega( )
//@@begin Alta_Entrega()
String tipoProducto = wdContext.currentAlta_EntregaElement().getUnTipoProducto();
Request_Alta_Entrega entregaMO = wdContext.currentRequest_Alta_EntregaElement().modelObject();
if (!wdContext.currentAlta_EntregaElement().getUnTipoProducto().equalsIgnoreCase("")){
IWDMessageManager manager = wdComponentAPI.getMessageManager();
if (logger.beDebug()) {
entregaMO.wdSetInvocationLogEnabled(true); //switch on logging for this model object
try{
entregaMO.setInvokerProperty(Stub.USERNAME_PROPERTY,"xxx");
entregaMO.setInvokerProperty(Stub.PASSWORD_PROPERTY,"xxx");
entregaMO.execute();
wdContext.nodeResponse().invalidate();
wdContext.nodeAlta_Entrega().invalidate();
}catch (Exception e){
manager.reportException(e.getMessage(),false);
logger.debugT(entregaMO.wdGetRequestLog()); //request log (HTTP header + SOAP request)
logger.debugT(entregaMO.wdGetResponseLog()); //response log (HTTP header + SOAP response)
logger.debugT(entregaMO.associatedModelClassInfo().getModelInfo().toString()); //model metadata in XML format
logger.debugT(entregaMO.toString()); //model object tree in XML format (= model context node content)
I hope you can understand me, because my english is very bad!!.
Thank you. -
Consume XI web service in web dynpro application
HI All,
I have scenario access web service in web dynpro java, which is created by XI ..Now I have WSDL file. Using that WSDL file I have imported web service model(Adaptive web service method) in my web dynpro java.
By following the PDF document = https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b2bc0932-0d01-0010-6d8e-cff1b2f22bc7
I have created a Model as mentioned in the PDF.
Once model is created I have done the mapping from model to component controller, after that I need to execute the Web service model .For the execution I need to write a code in component controller :-
model class name = XIModel
XIModel obj = new XIModel();
Once I am done with the above coding , and when I try to run the application I get the following error :-
com.sap.engine.services.webservices.espbase.discovery.BaseIOException: Invalid Response Code 200 while accessing URL:http://atind037:50000/WSDL/GetPOPDF.wsdl. Response Message: OK. Content Type: content/unknown
Could you please help me with this at the earliest , as it is a urgent issue.
Regards,
Boopathi M.Hi boopathi,
It seems your wsdl url is not correct. Put the http://atind037:50000/WSDL/GetPOPDF.wsdl
in your browser and check whether you are getting the WSDLDefinitions in xml format or not ?
In wsdl url put ? instead of .
URL : http://atind037:50000/WSDL/GetPOPDF?wsdl
call adaptive web services mit Parameter
Regards,
Mithu -
Diff b/w Web service and window service
What is the difference between web service and window service, whether the both are same or not, Give some explain about that each one and give some examples also.
An XML Web service is a component that implements program
logic and provides functionality for diseparate
applications. These applications use standard protocols,
such as HTTP, XML, and SOAP, to access the functionality.
XML Web services use XML-based messaging to send and
receive data, which enables heterogeneous applications to
interoperate with each other. You can use XML Web services
to integrate applications that are written in different
programming languages and deployed on different platforms.
In addition, you can deploy XML Web services within an
intranet as well as on the Internet. While the Internet
brings users closer to organizations, XML Web services
allow organizations to integrate their applications.
A Windows service starts much before any user logs in to
the system (if it has been setup to start at boot up
process). A Windows service can also be setup in such a way
that it requires a user to start it manually ? the ultimate
customization!
Windows services run as background processes. These
applications do not have a user interface, which makes them
ideal for tasks that do not require any user interaction.
You can install a Windows service on any server or computer
that is running Windows 2000, Windows XP, or Windows NT.
You can also specify a Windows service to run in the
security context of a specific user account that is
different from the logged on user account or the default
computer account. For example, you can create a Windows
service to monitor performance counter data and react to
threshold values in a database. -
Pl/Sql web service and collections not working
Hello
I'm trying to create a web service from a function in a package which returns a collection. The creation of the web service and its deployment seem to work correctly. I do get the following warning :
WARNING: OWS-00077 The Value Type class: pxWsLang.PamLanguagerecordBase does not have a valid JAVA Bean pattern
but I don't think this is the source of the problem.
When I try to test the web service using the endpoint in the wsdl I get the following answer in the browser:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>Error creating target: pxWsLang.WsLangUser</faultstring><faultactor></faultactor></env:Fault></env:Body></env:Envelope>
In the DOS window for the OC4J I get the following error :
2006-11-15 09:21:25.852 ERROR OWS-04005 An error occurred for port: {http://pxWs
Lang/WsLang.wsdl}wsLangSoapHttpPort: javax.xml.rpc.JAXRPCException: Error creati
ng target: pxWsLang.WsLangUser.
The PL/SQL code is as follows :
Object:
CREATE OR REPLACE TYPE PAM_LanguageRecord as OBJECT
NR NUMBER(3),
SYMBOL VARCHAR2(2)
Collection:
CREATE OR REPLACE Type PAM_LanguageTable as Table of PAM_LanguageRecord;
Package body :
create or replace package body PAM_TEST is
function CursorTest return Pam_LanguageTable is
Res_LangTable PAM_LanguageTable;
cursor cur is select * from stc_languages;
begin
Res_LangTable := new PAM_LanguageTable();
for Rec in cur loop
Res_LangTable.Extend(1);
Res_LangTable(cur%ROWCOUNT) := new PAM_LanguageRecord
(Rec.NR,
Rec.SYMBOL
end loop;
Return Res_LangTable;
end;
end;
I'm using JDeveloper version 10.1.3.1.0.3984
How can I get this to work ? (without using Apache Axis or other tools :-)
Is it supposed to work ?
Many Thanks
PaulHi,
for the "error creating target" problem I found the solution here:
[WS from a PL/SQL package]: Error creating target
Hope this helps.
Regards,
Patrik -
Web service and servlets in the same project...web.xml?
Hello, I have a problem with my web service.
I have a server, which displays a web service. I programmed this service with JAXRPC.
I have a client, in another directory. I succeded in compiling, deploying and running the web service.
The problem is that after I tried to integrate this service in an existing project. This project contains servlets. In these servlets, I'm using sessions.
These servlets are on the same side as the server of the web service. Because of the implementation of my code, I'd like to use in the class that represents the server of the service, the same session as the one I'm using in the servlets.
But of course, it's not working by itself. I know there's something to do with the web.xml files.
The thing is that I created a web.xml file for the service, and another for the servlets.
I was thinking of joining both of them in one xml file, but everything crashes then...
Could someone tell me how to create a project with a web service and servlets, and mostly how to configure the xml file??
Thanks for any help
PhilippeHello, I have a problem with my web service.
I have a server, which displays a web service. I programmed this service with JAXRPC.
I have a client, in another directory. I succeded in compiling, deploying and running the web service.
The problem is that after I tried to integrate this service in an existing project. This project contains servlets. In these servlets, I'm using sessions.
These servlets are on the same side as the server of the web service. Because of the implementation of my code, I'd like to use in the class that represents the server of the service, the same session as the one I'm using in the servlets.
But of course, it's not working by itself. I know there's something to do with the web.xml files.
The thing is that I created a web.xml file for the service, and another for the servlets.
I was thinking of joining both of them in one xml file, but everything crashes then...
Could someone tell me how to create a project with a web service and servlets, and mostly how to configure the xml file??
Thanks for any help
Philippe -
Quick questions on the topic of Web Services and EJB POJOs
I have been reading about Web Services and the data types that are aloud as operation parameters and return types. I was wondering what the standard practice for return types; is it to use the Entity classes straight and customize the WSDL instead of letting the EE container do it (avoid cyclic problems in the schema that can occur when using entity 1-to-many and many-to-1 mappings) or; is it to off load the data into a DTO/VO/Bean and let the EE container take care of all the schema mapping for the WSDL? I look at the EE tutorial and bought a EE book both use very basic examples that do not include connecting to a database or using EJB3 for the data store.
Thanks for any informationbump
-
How to call web services in WEB DYNPRO ABAP
Hi ABAPER'S,
Please let me know how to call web services in web dynpro.
Thanks,
Sandy.Hi Sandy,
Please check this blog..
/people/riyaz.sayyad/blog/2006/05/08/consuming-xi-web-services-using-web-dynpro-150-part-ii
also cehck this...
call the webservices in webdynpro ABAP.
calling webservice in webdynpro component
Re: Web Services in WDA.
Cheers,
Kris.
Edited by: kissnas on May 24, 2011 11:37 AM -
Hello Experts,
I am working on SAP BO 4.1. I have made several dashboards on top of web services ie;Web Service Method. I have 2 systems in BO ie; Development and Production Systems.The BW production system is connected to BO Development and Production both.
The Webi reports are made on top of BI BEx Query. From the webi reports, BI Web Services are made on top of which the dashboards are made further.
The Webi Reports, Web Services and the Dashboards everything is made directly in BO Production.
My question is, Can I transport the Webi Reports and the Web Services from BO Production to BO Development?
And If yes, will it have any other impact on webi reports, web services or dashboards?
Thanks & Regards,
Alfred ThomasHi Gill,
As per your reply,with the promotion managament i have make the web services again manually in Dev system...Right?
Is there any way possible that i can transport the webservices and the webi reports usind Query AS A Web Service Designer. And if yes, through this QAAWS will the WSDL or the URL required for the web services in the connection button in dashboards will automatically updated or changed as per the Development System?
But i am not able to enable the "Deploy to Other servers Option" in QAAWS.
Can you please help?
Regards,
Alfred thomas -
i have developed a very small web service and which is hosted along with our web site. our webservice url is
http://www.bba-reman.com/Search/SearchDataIndex.asmx
web service code
namespace WebSearchIndex
#region SearchDataIndex
/// <summary>
/// SearchDataIndex is web service which will call function exist in another library for part data indexing
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class SearchDataIndex : System.Web.Services.WebService
//public AuthHeader ServiceAuth=null;
public class AuthHeader : SoapHeader
public string Username;
public string Password;
#region StartIndex
/// <summary>
/// this function will invoke CreateIndex function of SiteSearch module to reindex the data
/// </summary>
[WebMethod]
public string StartIndex(AuthHeader auth)
string strRetVal = "";
if (auth.Username == "Admin" && auth.Password == "Admin")
strRetVal = SiteSearch.CreateIndex(false);
else
SoapException se = new SoapException("Failed : Invalid credentials",
SoapException.ClientFaultCode,Context.Request.Url.AbsoluteUri,new Exception("Invalid credentials"));
throw se;
return strRetVal;
#endregion
#endregion
when i was calling that web service from my win apps using
HttpWebRequest
class then getting error The remote server returned an error: (500) Internal Server Error
here is code of my win apps from where i am calling web service
string strXml = "";
strXml = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><StartIndex xmlns='http://tempuri.org/' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'><auth><Username>joy</Username><Password>joy</Password></auth></StartIndex></s:Body></s:Envelope>";
string url = "http://www.bba-reman.com/Search/SearchDataIndex.asmx";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method = "POST";
req.ContentType = "text/xml";
req.KeepAlive = false;
req.ContentLength = strXml.Length;
StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
streamOut.Write(strXml);
streamOut.Close();
StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
string strResponse = streamIn.ReadToEnd();
streamIn.Close();
i am just not being able to understand when this line execute
StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
then getting the error The remote server returned an error: (500) Internal Server Error
not being able to understand where i made the mistake. mistake is in the code of web service end or in calling code?
help me to fix this issue. thanksHi Mou,
I just tried your win app code about calling web service, but failed. I got the 500 error after I called your service:
The error message I quoted from Fiddler:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Failed : Invalid credentials ---> System.Exception: Invalid credentials
--- End of inner exception stack trace ---
at BBAReman.WebSearchIndex.SearchDataIndex.StartIndex(AuthHeader auth)</faultstring><faultactor>http://www.bba-reman.com/Search/SearchDataIndex.asmx</faultactor><detail /></soap:Fault></soap:Body></soap:Envelope>
I am not totally sure that error occurred by the authentication. But I suggest you can try to add this service into your project using this method below:
1.right click the Reference and select Add Service Reference
2.input your service link and click "Go"
And you can use this service as the following:
private async void callService()
ServiceReference1.SearchDataIndexSoapClient client =new ServiceReference1.SearchDataIndexSoapClient();
var Str= await client.StartIndexAsync(new ServiceReference1.AuthHeader { Username = "Admin", Password = "Admin" });
Please try it.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Clearing issue Incoming payment due to Cash discount ( customers)
Hello, During processing automatic incoming payments the system don't clear the customer open item in case the customer has taken a cash discount. The clearing should be done automatically in the posting area 2 but now the the user needs to do manual
-
Captivate 5.5 Review message no longer wraps in Review area caption box
Has anyone else experienced this issue? I logged it as a bug when someone else in my company reported the same issue to me. I searched for it on the Internet and didn't get any hits. We tested to see if it was just for converted projects from 4 to 5.
-
Delivery Complete Flag in PO for Services
Hi, For a Material or text PO when I make the GR for the total quantity, I get for that PO the flag in field Deliveri Complete for the item. This Flag doesn't exist when I use Item Category D - Services. Can I've this flag for this Item Category also
-
Green startup screen, urgent help
Hi, I'm in desperate need of your advice for my Mac Book Pro.While I was using my computer, the screen suddenly went black. I had my skype, adobe illustrator and web browser running at that point of time. My computer had been on for more than 9 hours
-
Google maps 2.0.3
a new version of google maps is out . its 2.0.3 check it out .