Call a C++ services using an uuid from java
I need to call a C++ services which is using the UUID for RPC. The interface is having the UUID. The previous client program is also in C++, they have used RpcBindingFromStringBinding(UUID value, .,.,.) to call the interface. Right now I need to call this service from Java using the UUID. Can anyone help me in it.
Passing the UUID should be the easy part, the tricky bit is performing an RPC from Java to C++. How are you doing that? Once you sort that out, passing arguments should be straight forward.
Note: Java's RMI only works between a client server running RMI. To connect to C++ server, you need to use a Java client library which is compatible with your C++ server.
If you still don't know how to perform the RPC call, I suggest you contact the people supporting the C++ program as they should know how RPC calls are made currently. If they don't know, it is highly unlikely we can guess a solution unless you are willing to change the C++ server to use a known RPC mechanism.
Similar Messages
-
[SOLVED] Call an esb service using PL/SQL utl_http
I would like to call an esb service using the UTL_HTTP package but I'm always getting the following exception: ORA-29266: end-of-body reached.
My ESB uses an xml document as input-parameter and I'm not defining this in my procedure, how can I use a document-style parameter when calling the webservice.
Could someboy point me out how to accomplish this functionality?
If tried the examples about bpel procedures and utl_dbws and these work for bpel processes but not for esb services.Hi aprt of my article:
http://orasoa.blogspot.com/2006/10/calling-bpel-process-from-raw-plsql.html
Can you call the ESB service with the SOAPUi.org tool? If this works, than you must create the same request from PLSQL.
Marc -
Calling two Business service using split join in osb
Hi,
While trying to call two business service using Split Join in osb i am getting selection failure message in Bpel em console. i am using invoke activity to invoke the BS and assign to assign the input. in the assign i am assigning *$request.payload/input* to input.payload . In the em console i am getting input like this
receiveInput
Jun 19, 2012 5:05:45 PM Received "process" call from partner "bpelprocess1_client"
<payload>
<inputVariable>
<part name="payload">
<client:process>xxxxx</client:process>
</part>
</inputVariable>
Assign (pending)
Jun 19, 2012 5:05:48 PM Error in evaluate <from> expression at line "65". The result is empty for the XPath expression : "/client:process/client:input".
<payload>
<client:process>xxxxxx</client:process>
Jun 19, 2012 5:05:48 PM The following exception occurred while attempting to execute operation copy at line 63
<payload>
<bpelFault>
<faultType>0</faultType>
<selectionFailure/>
</bpelFault>
Jun 19, 2012 5:05:57 PM "BPELFault" has not been caught by a catch block.
Jun 19, 2012 5:06:00 PM The transaction was rolled back. The work performed for bpel instance "650002" was rolled back, but the audit trail has been saved for this instance.If this is a sync request, please resubmit the request from the client. If it is an async request, please recover from the recovery console by resubmitting the invoke message.
Can anyone help on this?
Thanks in Advance...maybe this one helps a bit, it's the same pattern
http://www.xenta.nl/blog/2011/07/03/oracle-service-bus-implementing-aggregator-pattern-by-use-of-split-join/
if you're using a dynamic split join easiest way is to do something like
assing <yourresponse/> to $response
at this moment your assign an empty placeholder to the response variable
now you go into the for-each looping and for each iteration you need to insert the response of your bpel call in the $response variable
so in the looping as last step you add something like
insert $mybpelresponse/rootelement into $response/yourresponse
with the insert it will insert the reponse 1..x times into the $response variable (so actually aggregating all the responses for you) -
Calling C Functions in existing DLL's from Java
Hi Guys ,
The tutorial in this site talks about creating ur own DLL's and then calling them from Java . I need to call C functions in existing DLL's from Java . How do I go about doing this ? . Any help on this would be much appreciated.
regards
muraliWhat you are interested in can be done with what's called "shared stubs", from the JNI book (http://java.sun.com/products/jdk/faq/jnifaq.html), although you don't need the book to do it (I didn't).
The example code will call functions with any number and kind of parameters, but doing that requires some assembly language. They supply working examples for Win32 (Intel architecture) and Solaris (Sparc).
If you can limit yourself to functions to a single function signature (number and types of parameters), or at least a small set that you know you'll call at compile time, you can modify the example so that the assembly language part isn't needed, just straight C code.
Then you'll have one C library that you compile and a set of Java classes and you can load arbitrary functions out of arbitrary dynamic libraries. In my case you don't even have to know what the libraries and functions are ahead of time, the user can set that up in a config file.
You mentioned doing this with Delphi. One thing to watch out for is C versus Pascal (Win32) function calling convention. A good rule of thumb; if it crashes hard, you probably picked the wrong one, try the other. :-) -
Using word/excel from java (client or weblogic server)
Hi everybody,
i want to use excel / word functionality from java in two different variants:
-> serverside
-> clientside
I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
My knowlege about COM is rather bad.
Does anybody did this bevor and
-> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
-> has a example for using Excel / Word from Java in bea weblogic
-> has a example for using Excel / Word directly in a client (not via rmi)
Thanks
Ciao
SvenSven, This is a really bad idea. Why don't you tell me
what your trying to do and I wil surely give you a better alternative
JRadecki
"Sven Roesner" <[email protected]> wrote:
>
Hi everybody,
i want to use excel / word functionality from java in two different variants:
-> serverside
-> clientside
I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
My knowlege about COM is rather bad.
Does anybody did this bevor and
-> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
-> has a example for using Excel / Word from Java in bea weblogic
-> has a example for using Excel / Word directly in a client (not via rmi)
Thanks
Ciao
Sven -
Hi all!, someone knows about an API that let me use a scanner from Java?
without programing JNI code.
thks in advance!.The Java Twain package from http://www.gnome.sk does exactly what you need. You do not have to bother about jni, you can get an image from the scanner directly from your java application.
Erika -
Not able to call BPEL web service using RMI call from different machine
Hi,
1. I have created a smiple Helloworld asynchoronous BPEL process
2. I am able to call that BPEL process using java program (RMI call) which I have written in JDeveloper 10.1.3.3 and the java program is running in the embeded OCJ4 instance of JDeveloper sucessfully.
3. Now I am trying to run the same Java program in my unix machine where oracle application is installed.
4. I have set all the CLASSPATH for required jars which I have used in JDeveloper and also kept the jar file in Unix machine.
5. The java codes are complied successfully.
6. But when I am trying to run it , getting the following exception:
bash-3.00$ java HelloworldAsyn
name is Debkanta
property file data are: {java.naming.provider.url=opmn:ormi://172.18.19.169:6003:home/orabpel, java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory, orabpel.platform=ias_10g, java.naming.security.principal=oc4jadmin, java.naming.security.credentials=welcome1}
hello3
java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found
at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:279)
at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)
at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)
at HelloworldAsyn.main(HelloworldAsyn.java:64)
at com.oracle.bpel.client.util.BeanRegistry.lookupDeliveryBean(BeanRegistry.java:293)
at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:250)
at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:174)
at com.oracle.bpel.client.delivery.DeliveryService.post(DeliveryService.java:149)
at HelloworldAsyn.main(HelloworldAsyn.java:64)
bash-3.00$
I need to solve it urgently. Can anyone please help me.
Is it relaed to some user access issue in unix?
Thanks & Regards
Deb
Message was edited by:
user587916actually , I have laready given print stataement for the data in the context property file that you can see in the output. Today I am also able to call the bpel process using the same java program from my DOS command promt(cmd). Don't understand why the problem is occuring in unix.
please help. -
Call MTOM web service using pl/sql (utl_http)
Hi All,
Is anyone able to call a MTOM web service using utl_http from pl/sql ?
A typical request looks like this:
--uuid:fd1fbed8-7042-4673-a304-becc1ffb037f+id=1
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>......</s:Body></s:Envelope>
uuid:fd1fbed8-7042-4673-a304-becc1ffb037f+id=1
A microsoft C# tool is provided to generate some requests and using fiddler I can see the content type is in the header as well as in the request. In the requests it doesn't contain the UID. Connection is set to keep-alive, is that possible using pl/sql ?
The part that builds the header looks like:
l_http_request := UTL_HTTP.begin_request(url => 'http://' || l_host_name || ':' || l_port || '/CRUDService.svc', method => 'POST', http_version => 'HTTP/1.1');
UTL_HTTP.set_header(l_http_request, 'Host', l_host_name || ':' || l_port);
UTL_HTTP.set_header(l_http_request, 'SOAPAction', '"action"');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_string_request));
UTL_HTTP.set_header(l_http_request, 'Content-ID', '<http://tempuri.org/0>');
UTL_HTTP.set_header(l_http_request, 'Content-Transfer-Encoding', '8bit');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'multipart/related; type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:fd1fbed8-7042-4673-a304-becc1ffb037f+id=1";start-info="text/xml"');
I've played with the request by adding or removing information, the http response is (400) "Bad Request - Invalid Header", so should be somewhere in the header? Anyone ideas?
Kind regards,
MichielHI Michiel
I am also trying to achieve something similar to that. I am trying to call a web service that sends an xml attachment over MTOM? Kindly, let me know if this was achievable from your end? I mean how did the issue got resolved.
thanks
vijay -
Problem in calling a web service hosted on tomcat from BEA WebLogic portal
Hi,
I have a wsdl file for my web service which is hosted on apache tomcat 5.5(running on port : 8080). The contents of the wsdl file are-
*<?xml version="1.0" encoding="UTF-8"?>*
*<wsdl:definitions targetNamespace="http://soa.tutorials.serg.edu" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soa.tutorials.serg.edu" xmlns:intf="http://soa.tutorials.serg.edu" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">*
*<!--WSDL created by Apache Axis version: 1.4*
Built on Apr 22, 2006 (06:55:48 PDT)-->
*<wsdl:types>*
*<schema elementFormDefault="qualified" targetNamespace="http://soa.tutorials.serg.edu" xmlns="http://www.w3.org/2001/XMLSchema">*
*<element name="getNums">*
*<complexType>*
*<sequence>*
*<element name="n" type="xsd:int"/>*
*<element name="m" type="xsd:int"/>*
*</sequence>*
*</complexType>*
*</element>*
*<element name="getNumsResponse">*
*<complexType>*
*<sequence>*
*<element maxOccurs="unbounded" name="getNumsReturn" type="xsd:int"/>*
*</sequence>*
*</complexType>*
*</element>*
*<element name="getNums2">*
*<complexType>*
*<sequence>*
*<element name="n" type="xsd:int"/>*
*<element name="m" type="xsd:int"/>*
*</sequence>*
*</complexType>*
*</element>*
*<element name="getNums2Response">*
*<complexType>*
*<sequence>*
*<element maxOccurs="unbounded" name="getNums2Return" type="xsd:int"/>*
*</sequence>*
*</complexType>*
*</element>*
*</schema>*
*</wsdl:types>*
*<wsdl:message name="getNums2Request">*
*<wsdl:part element="impl:getNums2" name="parameters"/>*
*</wsdl:message>*
*<wsdl:message name="getNumsRequest">*
*<wsdl:part element="impl:getNums" name="parameters"/>*
*</wsdl:message>*
*<wsdl:message name="getNums2Response">*
*<wsdl:part element="impl:getNums2Response" name="parameters"/>*
*</wsdl:message>*
*<wsdl:message name="getNumsResponse">*
*<wsdl:part element="impl:getNumsResponse" name="parameters"/>*
*</wsdl:message>*
*<wsdl:portType name="Echo">*
*<wsdl:operation name="getNums">*
*<wsdl:input message="impl:getNumsRequest" name="getNumsRequest"/>*
*<wsdl:output message="impl:getNumsResponse" name="getNumsResponse"/>*
*</wsdl:operation>*
*<wsdl:operation name="getNums2">*
*<wsdl:input message="impl:getNums2Request" name="getNums2Request"/>*
*<wsdl:output message="impl:getNums2Response" name="getNums2Response"/>*
*</wsdl:operation>*
*</wsdl:portType>*
*<wsdl:binding name="EchoSoapBinding" type="impl:Echo">*
*<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>*
*<wsdl:operation name="getNums">*
*<wsdlsoap:operation soapAction=""/>*
*<wsdl:input name="getNumsRequest">*
*<wsdlsoap:body use="literal"/>*
*</wsdl:input>*
*<wsdl:output name="getNumsResponse">*
*<wsdlsoap:body use="literal"/>*
*</wsdl:output>*
*</wsdl:operation>*
*<wsdl:operation name="getNums2">*
*<wsdlsoap:operation soapAction=""/>*
*<wsdl:input name="getNums2Request">*
*<wsdlsoap:body use="literal"/>*
*</wsdl:input>*
*<wsdl:output name="getNums2Response">*
*<wsdlsoap:body use="literal"/>*
*</wsdl:output>*
*</wsdl:operation>*
*</wsdl:binding>*
*<wsdl:service name="EchoService">*
*<wsdl:port binding="impl:EchoSoapBinding" name="Echo">*
*<wsdlsoap:address location="http://localhost:8080/SOATest/services/Echo"/>*
*</wsdl:port>*
*</wsdl:service>*
*</wsdl:definitions>*
I created a client from the above wsdl file using ClientGen wizard in WebLogic. This client contains the follwoing classes-
Echo.java
EchoService.java
EchoService_Impl.java
Echo_Stub.java
I created a JSP portlet and the jsp content of it is-
String url = "http://localhost:8080/SOATest/services/Echo";
Echo echo = new EchoService_Impl(url).getEcho();
getNumsResponse = echo.getNums(getNums);
I tried to call that web service from BEA weblogic portal through a JSP potlet. I got an error saying -
*<An exception [javax.xml.rpc.ServiceException: Failed to parse WSDL http://localhost:8080/SOATest/services/Echo weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element] was thrown while rendering the content at [TestEcho.jsp].*
*javax.servlet.ServletException: javax.xml.rpc.ServiceException: Failed to parse WSDL http://localhost:8080/SOATest/services/Echo weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element*
* at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:420)*
* at jsp_servlet.__testecho._jspService(__testecho.java:112)*
* at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)*
* at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)*
* at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)*
* Truncated. see log file for complete stacktrace*
*javax.xml.rpc.ServiceException: Failed to parse WSDL http://localhost:8080/SOATest/services/Echo weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element*
* at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:174)*
* at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:485)*
* at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:119)*
* at edu.serg.tutorials.soa.EchoService_Impl.<init>(Unknown Source)*
* at edu.serg.tutorials.soa.EchoService_Impl.<init>(Unknown Source)*
* Truncated. see log file for complete stacktrace*
*weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.io.IOException: Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element*
* at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)*
* at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:405)*
* at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:391)*
* at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:79)*
* at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:66)*
* Truncated. see log file for complete stacktrace*
*java.io.IOException: Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element*
* at weblogic.xml.domimpl.Loader.load(Loader.java:38)*
* at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:122)*
* at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:65)*
* at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)*
* at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:405)*
* Truncated. see log file for complete stacktrace*
*javax.xml.stream.XMLStreamException: Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element*
* at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:206)*
* at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)*
* at weblogic.xml.domimpl.Loader.load(Loader.java:112)*
* at weblogic.xml.domimpl.Loader.load(Loader.java:73)*
* at weblogic.xml.domimpl.Loader.load(Loader.java:35)*
* Truncated. see log file for complete stacktrace*
*Error at Line:2, token:[OPENTAGBEGIN]All tags must be contained within a single element*
* at weblogic.xml.babel.baseparser.BaseParser.parseProlog(BaseParser.java:417)*
* at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:328)*
* at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)*
* at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:237)*
* at weblogic.xml.domimpl.Loader.load(Loader.java:112)*
* Truncated. see log file for complete stacktrace*
My web service is using soap binding. I have tested it with eclipse and other tools also. It is working well and good. But when I tried to call a web service which is created and hosted on WebLogic server(running on port : 7001), I got the correct output.
Can anyone help me out in calling a web service hosted on different server from WebLogic server.
Thanks in advance,
Tiijnar
Edited by: user8715057 on Aug 13, 2009 1:11 AMHi
1. The way you are invoking the WebService deployed on Tomcat server is looks suspicious. It may be valid by adding extra ?wsdl etc into the url, but still I have not seen this way to invoke the webservice.
2. So you used Weblogic ant task to generate client JARs by giving this WSDL. So looks like it generated the 4 classes (.java) and in addition any other classes for Request/Response xml objects.
3. Look at the source code of EchoService.java. It should have one default empty constructor. Internally it uses the default wsdl defined in this class. You will see another constructor that takes WSDL URL as one of the parameters (QName) etc. Echo.java is the class corresponding to the Port. In the same EchoService you should see an instance method like getEcho() something like that. This Echo.java class will have methods for all the Operations defined on this Port. So the standard code snippet we use most of the times will be like this:
EchoService myEchoService = new EchoService(); // Default it uses WSDL deployed on Tomcat at localhost:8080
Echo myEchoPort = myEchoService.getEchoPort(); // Something along these lines.
myEchoPort.xxxYYY(); // NOW this is the operation name that takes the input parameters and returns outputs defined as per the WSDL defintions. If the Input and Outputs are complex xml types, it will have corresponing .JAVA files with setters and getters.
Now if this WebService is deployed on same Tomcat but on different machine or different port, you just give the full WSDL URL with that host and port in the constructor for new EchoService(...). You may need to instantiate QName object. But look at the methods generated in EchoService.java class.
The way you are using with Impl and Stubs class may also work. I am not much famiiar with this APIs apporach. Still look at the methods generated in these classes.
Also if you latest Sun JDK 1.6, it also has one command like wsimport. Infact if you install WLS 10.3 with Sun JDK, it should have C:\beawlp103\jdk160_05\bin\wsimport command. This will also generate client jar given a WSDL URL.
Thanks
Ravi Jegga -
Calling a web-service using JAX-WS client on the browser
Hi,
I created a basic web-service using netbeans/glassfish, which can be successfully called from a JavaFX application running stand-alone.
But when I try to run the same JavaFX application on a browser, the web-service call does not work, and it is hard to get any information on where it is failing.
I can see the error is a Throwable (not an Exception), but the message is null.
What are the restrictions on being able to call a webservice using the JAX-WS libraries? Are there security issues? I am not using the javafx HTTP libraries.
Also, if Java1.6u10 is available on the machine running the browser, do I still need to package all the JAX-WS libraries for the client?
Any help is appreciated, even if it is just about how to track down the problem.Thank you very much for responding.
There was no error due to WebService. Actually, I was using xmlbeans and I did not put those xmlbeans jar files into appropriate place. That is what caused the problem. I have solved it now and it is working fine.
I put those xmlbeans jar files into my war file. It is working. Earlier, I had put them in tomcat 5.5's shared/lib directory. It was not working.
Thank you once again for replying.
Sasi. -
Calling a web service using UTL_DBWS
Hello,
I am trying to call a web service froma PL/SQL procedure using UTL_DBWS. I've been able to use a different method to determine that the web service is working correctly, so I know my problem is somewhere within my UTL_DBWS call. It seems like my call to the web service is not authenticating correctly. What I would like to do is be able to take a look at the XML header that is created by UTL_DBWS based on the parameters I have supplied, in order to ensure that everything is correct. Does anyone know a way to do this?
Thanks,
JasonHello,
I am trying to call a web service froma PL/SQL procedure using UTL_DBWS. I've been able to use a different method to determine that the web service is working correctly, so I know my problem is somewhere within my UTL_DBWS call. It seems like my call to the web service is not authenticating correctly. What I would like to do is be able to take a look at the XML header that is created by UTL_DBWS based on the parameters I have supplied, in order to ensure that everything is correct. Does anyone know a way to do this?
Thanks,
Jason -
Fault while calling a Web service using SOAP 1.2
Hi ,
I have created a simple PL/SQL web service using Jdeveloper from PL/SQL using SOAP 1.2.
But while i call that from PL/SQL, i am getting a version mismatch.
While the same service created from SOAP 1.1 is working fine.
Can anyone Help???Yip - Acrobat or Reader Extensions are needed.
Try right click on the PDF and open in Internet Explorer and try your submit (hopefully the domain is trusted) -
Example for calling document type service using a XML
Hi,
Can anybody give me some pointers to any examples about Document type webservice
that is passed an XML document? The service expects a custom java object.
I am running WLS 7.0 with sp2.
This is what i have done so far:
I have created a document type web-service with the following signature
public CustomReturnObject provideService(customParameter) { }
The 'customParameter' is based on a "CustomParameter.xsd" and 'CustomReturnObject'
is based on its schema. I ran the "autotype" to generate the java classes for
the schema.
Now, we would like to invoke the service by passing an XML document instead of
calling it by creating instances of "CustomParameter" java class. Also we would
like to get the XML represented by "CustomReturnObject" in the client program
instead of the java object.
Can anybody help?
Thanks
RaghuThe latest version of WLS is 8.1.
I think the the "endpoint" needs to be string.
String endpoint =
http://RASUBR-2K:7001/SubscriptionServicesWS/SSApplicationService.jws;
Regards,
-manoj.
http://manojc.com
"Raghu Subramaniam" <[email protected]> wrote in message
news:[email protected]...
>
SAAJ did work!
But it is not working with the BEA client libraries (WLS 8.0 Beta). I amgetting
the following exception
exception ejava.lang.IllegalArgumentException: endpoint shou
ld be String or URL
java.lang.IllegalArgumentException: endpoint should be String or URL
atweblogic.webservice.core.soap.SOAPConnectionImpl.call(SOAPConnectionI
mpl.java:43)
at TestMain.main(TestMain.java:51)
Attached is my test file.
I used the libraries from Sun's web services kit and it works.
Is it a known problem? Any fixes?
Raghu
"manoj cheenath" <[email protected]> wrote:
SAAJ will work. You can also use DII client with
generic type mapping. Check this out:
http://manojc.com/tutorial/sample27/Main.java
Regards,
-manoj
http://manojc.com
"Raghu Subramaniam" <[email protected]> wrote in message
news:[email protected]...
But how did you call the web service. Did you use the stubs in yourclient
code?
We don't want to use the stubs generated from "clientgen". Rather wantto
call
the service by passing a XML string that adheres to our schema expectedby
our
service. Our service is document-style.
I am trying to use the SAAJ api to generate a SOAPMessage and callthe
service.
Anybody has tried this before. Does it work?
Raghu
"Mike DeAngelo" <[email protected]> wrote:
I just did this the first time a few weeks ago, but I had some
gotchas...
>>>>
First, run the autotype ant task against your xsd file to generateyour
value
objects (I think you already did this).
Second, write your java class or EJB to use the value objects asparameter/return
type. (I think you did this too.) If you are going to invoke anEJB,
create
the EJB-Jar file.
Third, use the servicegen ant task to create the an ear file. Theear
file will
contain both the ejb-jar and file webservice.war which is generatedby
weblogic.
Fourth, unbundle the ear file, then unbundle the war file. Edit the
file WEB-INF/web-service.xml
Add the contents of your original xsd under the <types> element (iftypes
doesn't
exist, it should be the first subelement under the root element).Add
the contents
of types.xml (generated by autotype) to the <type-mapping> element(It
should
be the second element under the root element.
Rebundle the war file, rebundle the ear file, and deploy it.
Here is a fragment of the ant stuff...
<taskdef name="servicegen"
classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"/>
<target name="check-servicegen" depends="stage">
<uptodate property="servicegen.notRequired"
targetfile="${stage}/my_webservice.ear"
srcfile="${stage}/my_ejb.jar">
</uptodate>
</target>
<target name="servicegen"
depends="check-servicegen"
unless="servicegen.notRequired">
<servicegen destEar="${stage}/my_webservice.ear"
warName="my_webservice.war">
<classpath refid="compile.classpath"/>
<service ejbJar="${stage}/my_ejb.jar"
targetNamespace="http://foo/bar/baz"
serviceName="process"
serviceURI="/process"
generateTypes="False"
expandMethods="True"
style="document">
</service>
</servicegen>
</target>
Mike
"Raghu Subramaniam" <[email protected]> wrote:
Hi,
Can anybody give me some pointers to any examples about Document
type
webservice
that is passed an XML document? The service expects a custom javaobject.
I am running WLS 7.0 with sp2.
This is what i have done so far:
I have created a document type web-service with the following
signature
>>>>>
public CustomReturnObject provideService(customParameter) { }
The 'customParameter' is based on a "CustomParameter.xsd" and'CustomReturnObject'
is based on its schema. I ran the "autotype" to generate the javaclasses
for
the schema.
Now, we would like to invoke the service by passing an XML documentinstead
of
calling it by creating instances of "CustomParameter" java class.
Also
we would
like to get the XML represented by "CustomReturnObject" in the client
program
instead of the java object.
Can anybody help?
Thanks
Raghu -
How can I call a web service using JAVAscript in LCD
hi guys,
I know it can call a WSDL in LCD, but I have not any WSDL web service , and I have a REST web service ,how can I call this REST web service in LCD? I checked some documents and found nothing...if it's possible that it can call a REST web service using JAVAScript code, I mean I can program some code to call this web service ?
thanks,
JesseHi Jesse,
You can do GET, PUT and POST using FormCalc, so you should be able to access a REST web service.
There is a example of accessing a RSS feed in this thread, http://forums.adobe.com/message/5695433#5695433
Regards
Bruce -
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' ).
Maybe you are looking for
-
Unstructured Framemaker 8.0 p277, Windows Vista Home Premium service pack 2 Like many I have to provide final documents in Word (2003). In my workflow I export my Frame doc to RTF (Microsoft RTF 1.6), open it in Word then save as a Word doc. Reopen i
-
PDF as a print option to my PC
how do I add PDF as a print option to my PC
-
Firefox is not displayed correctly on USB-screen
Firefox 4.0 is not displayed correctly on USB-screen (Samsung SyncMaster LD 190). Firefox 3.6 was displayed correctly. looks like an incompatibility problem between UbiSync and FF 4.0
-
Hi, We are using the XML Publisher to generate the checks in Payables. We are using the IDAutomationMICR font. The ttf file has been moved to the UNIX server and the custom property has been added to the RTF template When we open the output, we get a
-
CDZHome Error when trying to connect universe from Crystal Reports XI R2
I am getting the below error message when I am trying to connect a universe from Cyrstal Reports. CDZHome not found on server, IRAPPS437.WebIntelligenceProcessingServer I am using below versions: Universe - Business Objects XI 3.0 Enterprise Edition