Consuming a web service from external system
Hi exepert,
I'm new in web service, I have to send a file towards external system so I think that I have to expose
my web service in sap system.
How, the external system, can understand that I exposed my web service, in other word that my file is
ready to be sent ?
tks, bye.
I am not sure if web service is a right fit for your issue but web service is accessed from another system using a URL(Uniform Resource Locator) which will be generated when you create a web service using SE80 or by running the wizard.
The other system might not know that you file is ready, I suggest to write a sequential(repetetive) program in the target system and check by using the URL and check if the file is ready. If the file is ready pick the file else repeat the step.
Similar Messages
-
Calling a web service in external system from SRM
Hi folks,
A web service is created in the external system and I need to access this web service from a BADI. Can you tell me how can I call this web service (the external system is giving me a URL) and how I'll get a return. Please let me know in detail.
Thanks,
PremPrem,
Hi. You can call the service via HTTP protocol. Pass them values (SET_DATA), and receive a response (GET_DATA), via xml/html.
In your code you would need to create the xml data to pass them, and evaluate the returned xml.
Process...
Data setup
1) Create the XML to send them
Working with the external service
2) Open the HTTP connection
2a) cl_http_client=>create_by_url (IF_HTTP_CLIENT)
2b) lr_client->authenticate
3) Call the to send them the XML
3a) lr_client->request->set_data
3b) lr_client->send
4) Call the lr_client->receive to return the response
5) Close the connection lr_client->close
Data evaluate
6) Evaluation the returned XML and process.
Hope this helps
Cheers
Rob
Code example below.. (There are loads of SAP examples depending on which release you are on).
Process the call to the HTTP client - logic copied from RSHTML01 *
Open IF_HTTP_CLIENT
call method cl_http_client=>create_by_url
exporting
url = l_url
importing
client = lr_client
exceptions
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
others = 4.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
raising oops.
endif.
Authenticate the user
if not g_int_type-usr is initial.
move: g_int_type-usr to l_user,
g_int_type-password to l_password.
call method lr_client->authenticate
exporting
username = l_user
password = l_password.
endif.
Allow for Cookies
lr_client->propertytype_accept_cookie = lr_client->co_enabled.
Set the server protocol
select single gsval into l_server_protocol
from z77s0
where grpid = c_grpid
and semid = c_server_protocol.
if sy-subrc eq 0
and not l_server_protocol is initial.
move l_server_protocol to l_st_server_protocol.
call method lr_client->request->set_header_field
exporting
name = '~server_protocol'
value = l_st_server_protocol.
endif.
Send out the XML
Set body to XML data
lr_client->request->set_data( g_xxml ).
save_xml( i_role = cl_xml_document=>c_role_oreq ).
l_request_length = xstrlen( g_xxml ).
If Data is sent through then we need certain flags set
lr_client->request->set_header_field(
name = 'Content-Type'
value = zcl_tem_bsp=>c_xml_content ).
call method lr_client->request->set_header_field
exporting
name = '~request_method'
value = 'POST'.
Set length of string to the header fields
if not l_request_length is initial.
move l_request_length to l_st_request_length.
lr_client->request->set_header_field(
name = 'content-length'
value = l_st_request_length ).
endif.
Send the request
call method lr_client->send
exceptions
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
others = 5.
check_for_error 'Send'.
Receive the response
call method lr_client->receive
exceptions
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
others = 4.
check_for_error 'Receive'.
Determined returned XML or HTML
g_xxml = lr_client->response->get_data( ).
Determine the header fields for failure validation
if lr_client->response->get_header_field( '~status_code' )
between 200 and 299.
save_xml( i_role = cl_xml_document=>c_role_ires ).
else.
l_status_code =
lr_client->response->get_header_field( '~status_code' ).
l_descript_1 =
lr_client->response->get_header_field( 'error' ).
l_descript_2 =
lr_client->response->get_header_field( 'errortext' ). -
HTTP connection from OSB web service to external system via a Proxy Server
Dear experts,
May I know has anyone tried to use HTTP protocol to send a request from OSB web service to external system via a proxy server? Heard that we need to establish some sort of tunnel (socket) to talk to Proxy Server. Can you please any have sample code or configuration steps to share?
Thank you very much!!http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/global_resources.html#wp1137294
Adding Proxy Servers
Use the Summary of Proxy Servers page to add and configure Proxy Server resources and make them available in Oracle Service Bus as a system resource. You must be in an active session to configure or reconfigure Proxy Server resources.
1. If you have not already done so, click Create to create a new session or click Edit to enter an existing session. See Using the Change Center.
2. Select System Administration > Proxy Servers.
3. Click Add.
4. In the Name field, enter a name for the Proxy Server resource. This is a required field.
5. In the Description field, enter a short description for the Proxy Server resource.
6. In the Host-Port Parameters section, enter the following information:
1. In the Server Host field, enter the host name or IP address of the Proxy Server. This is a required field.
The Server Host name for the Oracle Service Bus proxy server must be identical to the server host name of the actual proxy server.
2. In the Clear Text Port field, enter the Proxy Server clear-text port number.
3. In the SSL Port field, enter the Proxy Server SSL port number. You must enter either a clear text or SSL port number.
4. Click Add.
You can configure multiple Proxy Servers for each Proxy Server resource. This enables Oracle Service Bus to perform load balancing and offer fault tolerance features for the Proxy Server resource.
7. If the Proxy Server performs proxy authentication, enter a user name in the User Name field, and the associated password in the Password and Confirm Password fields.
These fields are optional, and required only if the Proxy Server is secured.
8. Click Save to create and save the Proxy Server resource in the current session.
9. To end the session and deploy the configuration to the run time, click Activate under Change Center. -
Consuming a Web service from Crystal reports 2008 - Error
Hi,
I want to consume a web service from Crystal Reports 2008. I created a New Connection using "XML and Web Services" and given WSDL url as the Web Service location. Crystal Report is able to connect to the WSDL and is displaying the tags correctly. When dragging the output to "Selected Tables' section, I am getting the following error:
"Invalid Argument Provided"
Details: Cannot support ArrayType input parameters.
Kindly help. Apparently this was a limitation in CR XI but does it still exist in CR 2008? Is there any patch available to resolve this issue?
Thanks,
Jaya
Edited by: jayakvr on Feb 17, 2011 10:47 AM
Edited by: jayakvr on Feb 17, 2011 10:48 AM
Edited by: jayakvr on Feb 17, 2011 10:48 AMThis issue is resolved now. I have installed the Service packs 1, 2 and 3 of CR2008 to overcome this error.
Thanks,
Jaya -
Consume a Web Service from a Web Page
I had tried out the Tutorial "Consume a Web Service from a Web Page". I have encountered this error :
; nested exception is: java.lang.NullPointerException.
oracle.adf.model.adapter.AdapterException: DCA-40010: The Web Service call failed. The service returned a SOAP fault with the message: [S:Receiver] EJB Exception: : java.lang.NullPointerException
at oracle.model.freightjb.CalculateFreightBean.calculateFreightCost(CalculateFreightBean.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy170.calculateFreightCost(Unknown Source)
at oracle.model.freightjb.CalculateFreight_5vfuh6_WSOImpl.__WL_calculateFreightCost_WS(CalculateFreight_5vfuh6_WSOImpl.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
I tried to modify abit the code as i changed the web method parameter from object (BatchOrder order) to variables(eg. int) and it works. When I test the Web Services I need to select the include checkbox den it works nicely else i will also encounter this problem. Does this mean the web services can not take it object as parameter?Hi Paolo,
maybe I faced the same issue. I solved it reading the thread:
web service deployable client
Hope this help
Cheers
Roberto -
Consuming a web service from a BSP page
Hello
Here is the description of the different instances :
ERP is running on an instance without J2EE engine
EP is running on an instance with J2EE engine
I create a web service definition, VI, and proxy classe on ERP.
I tested the web service using WSADMIN where I put as J2EE server the J2EE engine on the EP instance : it works.
I created a BSP application to consume the web service, when I try to reach the web service I've the error Unallowed RFC-XML Tag (SOAP_EINVALDOC) .
I guess it doesn't work because I ve got no J2EE engine linked to my ERP system, but as the netweaver plateform is new for us my question is : How can I define in ERP that I use the J2EE engine from EP ?
Thankshi
in your wsdl file find this
tag
<wsdl:service name="SendSMS">
inside it
you have a tag for soap port like this
<wsdl:port name="SendSMSSoap" binding="tns:SendSMSSoap">
<soap:address location="http://localhost/<Web service path>" />
</wsdl:port>
<wsdl:port name="SendSMSHttpGet" binding="tns:SendSMSHttpGet">
<http:address location="http://localhost/<Web service path>" />
</wsdl:port>
<wsdl:port name="SendSMSHttpPost" binding="tns:SendSMSHttpPost">
<http:address location="http://localhost/<Web service path>" />
</wsdl:port>
here replace localhost with the address of the server where the web service lies
like i mentioned
<server ip>
i hope this will work out
regards -
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 Axis web service from Oracle 10g database
Greetings,
I have a working web service that I want my Oracle 10.2 database to consume. I've taken the wsdl file from the web service and run it through Apache Axis' wsdl2java function, thus creating the Java client stubs required.
Is it possible to:
-Call a PL/SQL function which:
--Calls a Java class which:
---Calls the webservice which calculates an answer and passes it all the way back to the db?
I can get the db to call Java functions through PL/SQL and I can call the webservice from Java if I call the Java from the command line, but I can't seem to put it all together. When I upload all my Java to the db and attempt to call the method, I get:
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
Java.lang.ExceptionInInitializerError
If this is possible, could you please give me some direction as to where to go about doing it?
Thanks.Using Axis libraries within the database may not be the easiest way to get started.
Try this: Calling a Web Service From The Database
Best,
-Eric -
Consume a Web Service from a Webcenter aplication | Checkinuniversal servi
HI
Im trying to consume the checkinuniversal service from my webcenter application.
Steps done as instructed in the URL below
http://www.oracle.com/technology/obe/obe11jdev/11/wsdc/wsdc.htm
But when i try to cehkin the document from my webcenter application it showin an error ' Content item 'scs' was not successfully checked in. The content item must have a primary file.'
Is there any other way to checkin content from webcenter application through java code/CIS/ or any one has idea about primary file issue-how to resolve it.
Can you please share your ideas/ sample code(CIs) if any
thanks SmithHi Paolo,
maybe I faced the same issue. I solved it reading the thread:
web service deployable client
Hope this help
Cheers
Roberto -
Consume WCF Web Service from Designer
I am trying to consume a Windows Communications Foundation web service from within Adobe Form Designer and I believe the WSDL generated in incompatible. The WCF WSDL uses <xsd:import> tags to include other files containing the object schemas, such as the input and output parameters to method calls. Adobe doesn't seem to understand this notation and just shows "Body" for both the input and output, which is not correct.<br /><br />Is there a way to get these technologies to work together?
I understand that you have to set the end point up using code
Hello Paul,
David have setup the endpoint in the code with this line
var endpointAddress = new EndpointAddress(this.Variables.ServiceUrl);
and this means he have created a SSIS variable containing the URL for the web service.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Can I consume Asynchronous Web Services from WD?
We have some asynchronous web services running on XI, my doubt is if I can consume those web services in my WebDynpro application...
Any ideas... thanx in advance.
JVHi Raja,
Following patterns will likely give you a good idea of the type of problems you will have to address in real-world apps involving interactions with async Web services. I would encourage you to make the leap to studying BPEL4WS (and possibly WS-Transaction as well if you have true transactional requirements).
App servers are at the core synchronous engines while BPEL4WS calls for asynchrony top to bottom. Saying that, it is possible to create an orchestration engine (as a J2EE container) on top of an app server to deliver orchestration infrastructure that deals with asynchrony, exception handling, long-running transactions, to enable developers to focus on the orchestration logic (i.e. BPEL) rather than re-invent the infrastructure wheel for each application built.
Take a look at the Q&A content here, hope it helps.
http://searchwebservices.techtarget.com/ateAnswers/0,289620,sid26_cid492833_tax292928,00.html
Doron\ -
SOAPException while consuming a web service from OAF
Hi All,
I have successfully created a web service proxy using JDev version 10.1.3.3.0.3 to be inline with the OAF version for our R12 environment 12.1.3.
I then included the poxy in my OAF Workspace/Project and can consume the service 100% fine while running locally.
I get an error once deploying it and running it from the development/testing environments with the following error:
nested exception is: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: For input string: ""
Has anyone ever come across this and resolved the problem?
I can't find anything helpful regarding this.
I am able to telnet etc to the service end point (IP/Port) from the apps server, so I don't think its firewall related?
Thanks,
Anthony
Edited by: AnthonyFromSA on 2012/08/22 7:24 AMHi Anthony,
Am facing the similar issue as you have mentioned. Could you please elaborate on how exactly have you resolved it? I have changed the OC4J properties file and have bounced the server. But still facing the issue.
Thanks in advance.
Regards,
Dhamani -
Consuming a web service from a Servlet on OC4J
In my web application, I have a servlet, and that servlet calls a webservice running on an external server. To connect to the web service, I am using a java proxy class that was generated using the WebServicesAssembler tool (the webservice runs on an OC4J server). When I use the proxy in a stand alone application, it works fine. Unfortunately, when I try to use it in my servlet, I get a SOAP Exception. This is some information I get from my log.
2007-07-23 11:36:39,861 [HttpRequestHandler-19288329] INFO
Message: Unsupported response content type "text/html", must be: "text/xml". Response was:
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>404 Not Found</H1>Resource /webservices/StationService/ not found on this server</BODY></HTML>
2007-07-23 11:36:39,861 [HttpRequestHandler-19288329] INFO [com.georss.GeoRss:190] - Cause: null
2007-07-23 11:36:39,861 [HttpRequestHandler-19288329] INFO
Localized Message: Unsupported response content type "text/html", must be: "text/xml". Response was:
<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>404 Not Found</H1>Resource /webservices/StationService/ not found on this server</BODY></HTML>
2007-07-23 11:36:39,861 [HttpRequestHandler-19288329] INFO
Fault Code: SOAP-ENV:Protocol
So from the error message in the Localized message, it seems like the application is receiving a 404 error. In the proxy stub code, I know the url for the service is correct, so I dont know why it is not working. Any idea?
Thanks.
Message was edited by:
MynameisbtI am sure that the URL is right because I can use the same client class for the web service in a stand alone application. I did not change the endpoint URL in the client at all. The client was generated by OC4J's web services assembler tool. Also, the same URL will work in a browser.
Does OC4J require some sort of deployment descriptor to connect to an external web service? My web application only uses a .war file and it is packaged in an .ear file. It is a J2EE 1.3 application.
this is what I have in my web.xml file:
<web-app>
<servlet>
<servlet-name>myServlet</servlet-name>
<display-name>myServlet</display-name>
<description>description</description>
<servlet-class>com.controller</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/servlet/myServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
In my web.xml descriptor, do I need to add anything related to the web service i am trying to access?
Message was edited by:
Mynameisbt -
Consume conversational web services from WebLogic
hi all,
any one tried to consume conversational async webservices from weblogic 7 ? or tried to create conversational async webserices on sunONE ?
I am looking for standards to create interoperable async webservices which will use callbacks on the client side for notifications. Please advise...Hi Raja,
Following patterns will likely give you a good idea of the type of problems you will have to address in real-world apps involving interactions with async Web services. I would encourage you to make the leap to studying BPEL4WS (and possibly WS-Transaction as well if you have true transactional requirements).
App servers are at the core synchronous engines while BPEL4WS calls for asynchrony top to bottom. Saying that, it is possible to create an orchestration engine (as a J2EE container) on top of an app server to deliver orchestration infrastructure that deals with asynchrony, exception handling, long-running transactions, to enable developers to focus on the orchestration logic (i.e. BPEL) rather than re-invent the infrastructure wheel for each application built.
Take a look at the Q&A content here, hope it helps.
http://searchwebservices.techtarget.com/ateAnswers/0,289620,sid26_cid492833_tax292928,00.html
Doron\ -
Consume a web service from JME that returns an image
Hi,
I have a web service that returns an image in base64binary format, but when i use the wscompile tool to generate the stub i get an error becuase seems that JME does not support base64binary -> byte[] convert. My question is: How can i return an image from web service to consume from JME?.
Thanks in advance.
BrunoI tried this and works fine, but i see this like a workaround instead of a solution. Do you know why JME doesn't support this type of data? I think that is weird because i don't see a limitation on JME for use it.
Thanks for repsonse.
Maybe you are looking for
-
So what's the export quality like???
Hi, after the 'pain' of i-movie 8, what's the view on the export quality in 9? Does it export high enough quality to look good when burnt to dvd and played back on tv?
-
Firefox no longer opens my Football tv service.
I pay for a subscription tv service from Leeds United FC called LUTV. It used to open and work with no problems but now when I use the LUTV link it displays a message telling me that my browser no longer supports the tv sevice.
-
the ``send link`` option just disappeared..It happened immediately after an automatic update to firefox when my computer has to be restarted about a month ago. sometimes a ``copy link location`` will be on the list...and that will allow me to send on
-
Netbeans VWP: problem with getSelectedRowKeys() + immediate
I'm developing a form following this tutorial: http://www.netbeans.org/kb/60/web/web-jpa-part2.html The difference is that I marked the fields as required. When I click the Add, Delete or Update button I want that the action is executed without proce
-
OS X v10.7 Lion Download
Do i have to purchase a separate download of OS X v10.7 Lion to each Apple device?