JSP with XML SOAP
Hi,
Anyone know where to get the example to create the xml soap by using jsp? i tried to search it in web but no relevent links found. Can anyone give me some example if you know about it?
Thanks
Check out Apache Axis.
http://ws.apache.org/axis/index.html
Similar Messages
-
Char into balise jsp:scriptlet in jsp with xml syntax
hello,
i met a trouble with coding jsp with xml syntax,
i use wsad to develop the jsp, and it's not allowed to put characters < or > into the balise scriptlet
for example i cant do a loop (as i did easily with html syntax <% %> ) :
this his the header of my jsp:
<jsp:directive.page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" />
<jsp:text>
<![CDATA[ <?xml version="1.0" encoding="ISO-8859-1" ?> ]]>
</jsp:text>
<jsp:text>
<![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> ]]>
</jsp:text>
and the code which dont work:
<jsp:scriptlet>
for (int i=0;i<10;i++){
System.out.println(i);
</jsp:scriptlet>
i get a compilation error, did someone could help me to code dynamic content jsp ?
ps: excuse me for my english.I don't use xml, so I may be way off the wall, but did you try using the CDATA sections again?
<jsp:scriptlet>
<![CDATA[
for (int i=0;i<10;i++){
System.out.println(i);
]]>
</jsp:scriptlet> -
Guidance on getting started with XML/SOAP and JDeveloper
I am not a novice programmer, but I am new to Java and web services and I need to get up to speed very quickly on JDeveloper, XML, SOAP, WSDL, UDDI, etc. Nothing I have read so far is making any sense. Could anyone please suggest the best place to start getting grounded in XML/SOAP messaging. It is my task to send and receive messages to an existing SOAP service on the web conveying data from our E-Bis Suite. Thanks, Bill.
Thanks! I made it through the JDeveloper Tutorial. I see a tutorial on the list specifically for Web Service from WSDL, so that's next. Hopefully, as I study the pieces, it will become easier to see how they all fit together.
-
Can somebody solve a problem of jsp with xml
I have written the following code to generate a web page.
the application will get some data from a xml file and show it in the web page.
The problem is it is showing null for all the xml properties.
When i used the java scriplet as a seperate java file, it seems to be running fine.
Can somebody help me:-
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
<%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
<%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="org.w3c.dom.*" %>
<%@ page import="org.xml.sax.*" %>
<%@ page import="javax.xml.transform.TransformerFactory" %>
<%@ page import="javax.xml.transform.Transformer" %>
<%@ page import="javax.xml.transform.TransformerException" %>
<%@ page import="javax.xml.transform.dom.DOMSource" %>
<%@ page import="javax.xml.transform.stream.StreamResult" %>
<%@ page import="javax.xml.transform.*" %>
<%@ page import="javax.xml.parsers.*" %>
<%@ page import="javax.xml.*" %>
<%@ page import="javax.xml.transform.stream.StreamSource" %>
<%!
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
%>
<html>
<head>
<title>Main Page</title>
<link rel="stylesheet" href="Styles1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" height="50" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
</td>
</tr>
</table>
<table width="100%" height="17" bgcolor="#FFCC00" border="0" cellspacing="0" cellpadding="6">
<tr>
<td>
<%
try
DocumentBuilder builder = factory.newDocumentBuilder();
System.out.println("Builder: "+builder);
Document document = builder.parse("config.xml");
System.out.println("Document: What happened "+document);
document.getDocumentElement().normalize();
Node ParentNode = document.getDocumentElement();
System.out.println("Node: "+ParentNode);
//NodeList list = document.getElementsByTagName("TimeSheet");
for(Node child= ParentNode.getFirstChild(); child != null; child = child.getNextSibling())
try{
if(child.getNodeType()==Node.ELEMENT_NODE)
String Vals = child.getFirstChild().getNodeValue().toString();
System.out.println("Hi: "+Vals);
%>
<%=Vals%> |
<%
catch (NullPointerException nex)
System.out.println("Null Exception : "+nex);
catch (Exception ex)
System.out.println("Exception : "+ex);
%> <a href="Log-out |
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
I wil be thankful for that
OttranHi can anyone solve the above problem
-
Send/Receive IDOCs (XML) from/to SAP R/3 with XI-SOAP without XI!
Dear SAP specialists,
(BACKGROUND) We are using the Microsoft BizTalk Adapter for SAP 1.0, developed on top of the SAP DCOM Connector (we are using the version 6.20 Patch Nr. 177), with Microsoft BizTalk Server 2002 SP1 in order to send and receive IDOC via the tRFC transport protocol. We are using the Microsoft BizTalk Adapter for SAP 1.0 since February 2002, and today we are exchanging more than 25,000 IDOC/day with this architecture.
When we migrate our SAP R/3 system to the version 4.7 with WAS 6.20, I was very enthusiastic about the possibility of sending the IDOC in XML via the standard HTTP transport protocol, because it would considerably simplify my architecture, i.e. no need of any (expensive) adapter any more! But, I had to realise that the quality of service exactly once will not be there anymore with HTTP as it exists with tRFC. Then, we carry on using the tRFC transport protocol with the adapter.
(QUESTION) But recently, I followed the SAP Course TBIT40 XI Foundations and I learn that:
1. On one hand, the XI-SOAP protocol supports the quality of service exactly once by the usage of a message GUID within the XI-SOAP envelope;
2. On the other hand, all mySAP solutions using WAS 6.20 (or higher) carry a small Integration Engine (with XI-SOAP as the native transport protocol).
Then, my question is: << Is it possible to exchange IDOC (XML) directly with an SAP R/3 4.7 (WAS 6.20) via the XI-SOAP transport protocol using the small Integration Engine embedded into it, with the quality of service exactly once? >>
Many thanks in advance and best regards,
Patrice KrakowHello Patrice
We have same issue. Is it possible to use IDoc (XML) directly with SAP 5.0 with SOAP (HTTP) without XI?
Since your que is three years old, I'm sure you must have found some method for this.
We'll highly appreciate your help.
Regards: Gaurave -
I work with SOA 10.1.3.3 (Patched).
When I call an ESB Routing Service from BPEL, are generated an exception as follow:
<messages><input><WBPM_IKSelectDatiTx_in><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WBPM_DASelectDatiTxSelect_pn_prog_tx_inparameters"><WBPM_DASelectDatiTxSelect_pn_prog_txInputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/WBPMDASelectDatiTx">
<pn_prog_tx>3</pn_prog_tx>
</WBPM_DASelectDatiTxSelect_pn_prog_txInputParameters>
</part></WBPM_IKSelectDatiTx_in></input><fault><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found</summary>
</part></remoteFault></fault></messages>
I've already read the metalink note 427452.1 and I tried the 2 way indicated to solve this problem. But the problem persist.
In the ESB console the Web Services considered above:
WSDL URL http://wise-svr1.wise.com:7777/esb/slide/ESB_Projects/AppWBPMCicloPassivo_ESB_WBPMCicloPassivo/WBPM
URI endpoint SOAP http://wise-svr1.wise.com:7777/event/DefaultSystem/WBPM_DASelectDatiTx
When I click on WSDL URL explorer open an XML file
When I click on URI endpoint SOAP explorer result "Page not Found"
Thanks in advance
UmbertoHi,
Your problem is with the esb service since calling the endpoint in a browser should result in a test interface for the esb service. Do you have any errors in the logfiles after deploying or calling the endpoint? ($ORACLE_HOME\j2ee\oc4j_soa\log\oc4j_soa_default_group_1\oc4j\log.xml
Kind Regards,
Andre -
Problems with JSP Documents (XML Mode)
Hi --
Have been following the spec for JSP as XML documents because I want to produce JSPs using XSLT. Two problems which I've yet to find anything but workarounds for:
1. (Most pressing) JSP Documents do not allow this <%= blah %>. This creates problems when I want to dynamically create an attribute value. The spec recommends this: 'value = "%=var%"', but I've tried this in Tomcat 4.1.12 and the expression gets reproduced literally at run-time. I've searched these forums and not found an answer.
2. Transformer wigs out on colons in "jsp:root" or "c:out" because it signifies a namespace with which it is unfamiliar. It doesn't need to recognize the namespace. Right now I'm putting in placeholders (jsp999root, for example) and replacing them after processing. Is there a better way?
These problems are really getting in the way. Any help would be most appreciated.Have been following the spec for JSP as XML documents because I want to
produce JSPs using XSLT. Two problems which I've yet to find anything but
workarounds for:
1. (Most pressing) JSP Documents do not allow this <%= blah %>. This creates
problems when I want to dynamically create an attribute value. The spec
recommends this: 'value = "%=var%"', but I've tried this in Tomcat 4.1.12 and
the expression gets reproduced literally at run-time. I've searched these
forums and not found an answer. I am stuck on this also and desperately searching for an answer. Has anyone found anything yet?
2. Transformer wigs out on colons in "jsp:root" or "c:out" because it
signifies a namespace with which it is unfamiliar. It doesn't need to
recognize the namespace. Right now I'm putting in placeholders (jsp999root,
for example) and replacing them after processing. Is there a better way?You can (and should) put multiple namespace declarations in the xsl:stylesheet tag. that will let it know about jsp:* and pass it through appropriately. Try something like:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:jsp="http://java.sun.com/JSP/Page"> -
Deploying a jsp with calls to CS Web Services to OC4J 10.1.2.0.2
Hi
My jsp (with CS webservices calls) works fine when deployed in the embedded oc4j that comes with jdev 10.1.2.0.0 but when I deploy the jsp to OC4J 10.1.2.0.2 with a preconfigured jpdk (available for download from otn at http://download.oracle.com/otndocs/tech/ias/portal/files/pdk101202_oc4j_extended.zip) I get the following error
Any thoughts?
500 Internal Server Error
java.lang.IncompatibleClassChangeError at org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1387) at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148) at org.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1257) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:314) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:281) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196) at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:288) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:424) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2765) at org.apache.axis.client.Call.invoke(Call.java:2748) at org.apache.axis.client.Call.invoke(Call.java:2424) at org.apache.axis.client.Call.invoke(Call.java:2347) at org.apache.axis.client.Call.invoke(Call.java:1804) at oracle.ifs.fdk.RemoteLoginManagerSoapBindingStub.login(RemoteLoginManagerSoapBindingStub.java:242) at oracle.ifs.examples.ws.WsConnection.login(WsConnection.java:210) at oracle.ifs.examples.ws.WsConnection.login(WsConnection.java:132) at oracle.ifs.examples.ws.SearchOperations.<init>(SearchOperations.java:106) at htdocs.contentportlet._ContentPortletShowPage._jspService(_ContentPortletShowPage.java:51) [SRC:/htdocs/contentportlet/ContentPortletShowPage.jsp:8] at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) at java.lang.Thread.run(Thread.java:534)I have found the solution:
The Content Services Libraries include a saaj-api.jar (for soap messages between the cs client java code and the server side webservices api).
Unfortunately, the preconfigured oc4j container downloaded from otn included an older version of saaj.jar in its j2ee/home/applib directory, which of course was found before the cslib version according to the default order in which class paths are read.
All I had to do was remove he saaj.jar from the oc4j/j2ee/home/applib directory so that content services could find its own (more upto date) version -
Weblogic with XML-RPC RuntimeModelerException
I am having problems invoking a SOAP Web Service from an XML-RPC Web Service. They are both deployed on WebLogic.
Here are the details:
We have ported a JBOSS .esb application that implements XML-RPC Web Services to a WebLogic .ear application. The porting was successful. Bellow you can see the the .ear archive structure:
xmlrpc-services-app.ear
+ lib
+ aopalliance-1.0.jar
+ aspects-5.2.0.jar
+ commons-codec-1.3.jar
+ commons-collections-3.2.jar
+ commons-lang-2.4.jar
+ commons-logging-1.1.jar
+ container-common-api-5.2.0.jar
+ jettison-1.2.jar
+ junit-3.8.1.jar
+ log4j-1.2.16.jar
+ mysql-connector-java-5.1.12.jar
+ openads-api-xmlrpc-1.xmlrpc3.cmt_fix.2.jar
+ snmpTrapAppender-1.2.9.jar
+ spring-aop-3.0.1.RELEASE.jar
+ spring-asm-3.0.1.RELEASE.jar
+ spring-beans-3.0.1.RELEASE.jar
+ spring-context-3.0.1.RELEASE.jar
+ spring-context-support-3.0.1.RELEASE.jar
+ spring-core-3.0.1.RELEASE.jar
+ spring-expression-3.0.1.RELEASE.jar
+ spring-jdbc-3.0.1.RELEASE.jar
+ spring-ldap-1.2.1.jar
+ spring-security-core-2.0.5.RELEASE.jar
+ spring-tx-3.0.1.RELEASE.jar
+ spring-web-3.0.1.RELEASE.jar
+ lib-common-tools-1.5.jar
+ lib-security-1.5.jar
+ stax-api-1.0.1.jar
+ ws-commons-util-1.0.2.jar
+ xml-apis-1.0.b2.jar
+ xmlrpc-client-3.1.3.jar
+ xmlrpc-common-3.1.3.jar
+ xmlrpc-server-3.1.3.jar
+ META-INF
+ MANIFEST.MF
+ application.xml
+ weblogic-application.xml
+ xmlrpc-services-app.war
+ META-INF - generated by Maven
+ WEB-INF
+ classes
+ jboss-web.xml
+ lib
+ apache-mime4j-0.6.1.jar
+ commons-codec-1.4.jar
+ commons-logging-1.1.jar
+ httpclient-4.2-beta1.jar
+ httpcore-4.2-beta1.jar
+ httpmime-4.2-beta1.jar
+ servlet-api-2.3.jar
+ offersService-Client-1.0.jar
+ web.xml
+ index.jsp - not really usedThe `offersService-Client-1.0.jar` contains a Web Service definition (not the implementation) and is used to invoke the Offers Web Service. The WS client and the jar were created using JDeveloper. The key files inside this jar are:
GetOfferRequest.class
ObjectFactory.class
Offer.class
OffersPortType.class
OffersSchema.xsd
OffersService.class
OffersService.wsdl
OffersService.xmlWhen invoking this WS from a class in the xmlrpc-services-app.ear, I get the following error:
com.sun.xml.ws.model.RuntimeModelerException: A WebService annotation is not present on class: offers.OffersPortType
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:237)
at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:762)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.buildRuntimeModel(WLSProvider.java:982)
at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:746)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:737)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:361)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:934)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1039)
at weblogic.wsee.jaxws.spi.ClientInstancePool.takeSimpleClientInstance(ClientInstancePool.java:376)
at weblogic.wsee.jaxws.spi.ClientInstancePool.take(ClientInstancePool.java:232)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:852)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:792)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
at javax.xml.ws.Service.getPort(Service.java:92)
at offers.OffersService.getOffersPort(OffersService.java:68)HOWEVER, when I invoke it from a simple Web Service created in JDeveloper and deployed on WebLogic or even from the command line (so outside the WebLogic context), I do not get this error.
Here is how I create the client for the service:
OffersService offersService = new OffersService();
OffersPortType offersPortType = offersService.getOffersPort(); // it crashes hereDo you have any idea of what might be wrong?
If you need any other details, please do not hesitate to ask.carYang wrote:
> Can you use cfinvoke with XML-RPC arguments or is it
just for SOAP methods?
>
> Does anyone have an example of passing XML-RPC?
http://www.fusionteam.co.uk/blog/2008/02/19/xml-rpc-using-coldfusion-and-microsoftxmlhttp- com-object/
But you can also do it with CFHTTP.
Mack -
Javax.xml.soap.SOAPException: Unable to create message factory for SOAP
I installde jwsdp1.5 and tomcat50-jwsdp, want to use the local registry server in jwsdp1.5 to publish and query services. the code can run successfully on other PC, but I can not run it successfully.
when I run the JSP+Servlet to publish a service, the information is:
javax.xml.registry.JAXRException: javax.xml.bind.JAXBException
- with linked exception:
[javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Provider com.sun.xml.messaging.saaj.soap.MessageImpl could not be instantiated: java.lang.IllegalAccessException: Class javax.xml.soap.FactoryFinder can not access a member of class com.sun.xml.messaging.saaj.soap.MessageImpl with modifiers "protected"]
at com.sun.xml.registry.uddi.Processor.processRequestJAXB(Unknown Source)
at com.sun.xml.registry.uddi.UDDIMapper.getAuthorizationToken(Unknown Source)
at com.sun.xml.registry.uddi.ConnectionImpl.setCredentials(Unknown Source)
at Publish.doPost(Publish.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:790)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:709)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:572)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[javax.xml.soap.SOAPException: Unable to create message factory for SOAP: Provider com.sun.xml.messaging.saaj.soap.MessageImpl could not be instantiated: java.lang.IllegalAccessException: Class javax.xml.soap.FactoryFinder can not access a member of class com.sun.xml.messaging.saaj.soap.MessageImpl with modifiers "protected"]
at com.sun.xml.registry.common.util.MarshallerUtil.jaxbMarshalObject(Unknown Source)
... 32 more
what can I do?? Help me please!!Thanks very very very much!It seems saaj-impl.jar (in case of Sun One Server) or the jar which contains implementationof SAAJ API is not in the classpath.
-
How to get javax.xml.soap.SOAPMessage handler?
Hello,
I'm trying to evaluate WebLogic AS 10, especially evaluate it if it's possible to use our custom access control module build using JACC API inside it. The problem is, we're using SOAPMessage handler, but it seems WebLogic does not register any handler at all at least by default? That's at least what I see after example H:\bea\wlserver_10.0\samples\server\examples\src\examples\webservices\jaxws\java2wsdl\SimpleEjbImpl.java
modification:
public String sayHello(String s) throws SystemException {
System.err.println("CALL sayHello: " + s);
Object obj = null;
try {
System.err.println("registered handlers: " + PolicyContext.getHandlerKeys());
obj = PolicyContext.getContext("javax.xml.soap.SOAPMessage");
} catch (PolicyContextException ex) {
ex.printStackTrace();
if (obj != null) {
SOAPMessage msg = (SOAPMessage)obj;
System.err.println("SOAP msg: " + msg);
else
System.err.println("This is not SOAP message!");
other method code is unchanged. Anyway, when I run this example I see in example server console that there are no registered handlers and in such situation following call to PolicyContext to obtain SOAPMessage handler fails with the IllegalArgumentException: unknown handler
My question is, what I have to do in order to setup WebLogic to use standard handlers like SOAPMessage handler, EJBArguments handler etc.?
Thanks!
KarelHello,
it seems I've found the reason myself. At least WebLogic does not seems to support JACC by default and it needs to be switched on manually.
Thanks,
Karel -
Hi,
I have created a class JaxmClient.java. When I compile the class with appropriate jar files assigned to -classpath it compiles successfully with no errors. But when I run the classe "java JaxmClient" it produces the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/soap/SOAPElement
Can someone help me I am knew to this technology.
Thanks in advanceI tried to use in my execution all the jar files that I used for compilation.
java -cp jaxm-jar; etc.jar Request
but it still gives me this execption
Exception in thread "main" java.lang.NoClassDefFoundError: Request
I am in the right directory where is the Request.class file is and it is present in this directory....
Thanks appreciate your help... -
Hi
I deployed an ESB service.
I am trying to test it from Server Enterprise Manager, Webservices feature.
I wrapped up my original message with SOAP 1.1 and 1.2 specifications.
When I invoke the service, I am getting
java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Unable to get header stream in saveChanges error.
Any idea how to get rid of that ?
Thanks
PraveenThe current version of ESB does not support SOAP 1.2. You need to make sure your message contains the correct SOAP 1.1 namespace so ESB uses the correct SOAP version:
SOAP 1.1: http://schemas.xmlsoap.org/soap/envelope/
SOAP 1.2: http://www.w3.org/2003/05/soap-envelope
Kind Regards,
Andre Jochems -
Creating AIR/Web Apps. with XML & E4X using AS3
Needing tips using AS3 with XML/E4X to make my project work over the server:
1) Here I'm having trouble trying to create a component with a 'GOOGLE MAP' with the user being able to input their location for directions with once submitting the get directions button that it generates the directions in the datagrid automatically.
2) Including a 'DATAGRID' for customers to be able to retain their info in a datagrid that has been updated by office personnel from an 'AIR APPLICATION' with a XML file that holds the customers info
/**the Component*/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:s="library://ns.adobe.com/flex/spark" width="1400" backgroundColor="#666666" xmlns:mx2="library://ns.adobe.com/flex/mx" creationComplete="initApp(event)">
<mx:Style source="map_1.css"/>
<mx:XML id="customer_info.xml" source="Assets/customer_info.xml" />
<mx:Script>
<![CDATA[
/**Google Map Code API:http://code.google.com/apis/maps/documentation/flash/tutorial-flexbuilder.html#DeclaringMa ps_&
_http://www.adobe.com/devnet/flex/articles/googlemaps_api.html */
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
private function onMapReady(event:Event):void {
this.map.setCenter(new LatLng(31.683952973286058, -97.09904551506042), 14, MapType.NORMAL_MAP_TYPE);
click="processForm(event);"
private function processForm(event:Event):void { trace(from.text + " " + to.text); }
[Bindable]
public var directionsSteps:ArrayCollection = new ArrayCollection();
dataProvider="{directionsSteps}"
var directions:Directions = new Directions(); directions.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, onDirectionsSuccess);
directions.addEventListener(DirectionsEvent.DIRECTIONS_FAILURE, onDirectionsFail);directions.load("from: " + from.text + " to: " + to.text);
Alert.show("Status:" + event.directions.status);
map.clearOverlays(); var directions:Directions = event.directions; var directionsPolyline:IPolyline = directions.createPolyline(); map.addOverlay(directionsPolyline);
var directionsBounds:LatLngBounds = directionsPolyline.getLatLngBounds(); map.setCenter(directionsBounds.getCenter()); map.setZoom(map.getBoundsZoomLevel(directionsBounds));
var startLatLng:LatLng = dir.getRoute(0).getStep(0).latLng;
var endLatLng:LatLng = dir.getRoute(directions.numRoutes-1).endLatLng; map.addOverlay(new Marker(startLatLng)); map.addOverlay(new Marker(endLatLng));
for (var r:Number = 0 ; r < directions.numRoutes; r++ ) { var route:Route = directions.getRoute(r); for (var s:Number = 0 ; s < route.numSteps; s++ )
{ var step:Step = route.getStep(s); directionsSteps.addItem(step);
directionsSteps.removeAll();
itemClick="onGridClick(event)"
privatefunction onGridClick(event:Event):void { var latLng:LatLng = directionsGrid.selectedItem.latLng;
var opts:InfoWindowOptions = new InfoWindowOptions(); opts.contentHTML = directionsGrid.selectedItem.descriptionHtml; map.openInfoWindow(latLng, opts);
var ServerPath:String = "http://www.sometext.com/";
var ServerPage:String = serverPath + "getCountries";
dataProvider="{directionsSteps}"
var directions:Directions = new Directions(); directions.addEventListener(DirectionsEvent.DIRECTIONS_SUCCESS, onDirectionsSuccess); directions.addEventListener(DirectionsEvent.DIRECTIONS_FAILURE, onDirectionsFail);
directions.load("from: " + from.text + " to: " + to.text);
Alert.show("Status:" + event.directions.status);
map.clearOverlays(); var directions:Directions = event.directions; var directionsPolyline:IPolyline = directions.createPolyline();
map.addOverlay(directionsPolyline);
var directionsBounds:LatLngBounds = directionsPolyline.getLatLngBounds(); map.setCenter(directionsBounds.getCenter());
map.setZoom(map.getBoundsZoomLevel(directionsBounds));
var startLatLng:LatLng = dir.getRoute(0).getStep(0).latLng; var endLatLng:LatLng = dir.getRoute(directions.numRoutes-1).endLatLng; map.addOverlay(new Marker(startLatLng));
map.addOverlay(new Marker(endLatLng));
for (var r:Number = 0 ; r < directions.numRoutes; r++ ) { var route:Route = directions.getRoute(r); for (var s:Number = 0 ; s < route.numSteps; s++ )
{ var step:Step = route.getStep(s); directionsSteps.addItem(step); } }
directionsSteps.removeAll();
itemClick="onGridClick(event)"
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
var sender:URLLoader;
var sendPage:URLRequest;
var sendVars:URLVariables;
initApp;
function initApp:void {
var ServerPath:String = "http://localhost/silverfoxcc/";
var url:String = serverPath + "login.aspx";
sender = new URLLoader();
sendPage = new URLRequest(url);
sendPage.method = URLRequest.POST;
sendvars = new URLVariables();
SUBMIT.btn.addEventListener(MouseEvent.CLICK, clickHandler);
sender.addEventListener(Event.COMPLETE, completeHandler);
sender.addEventListener(IOErrorEvent.SECURITY_ERROR, securityErrorhandler);
function clickhandler(e:MouseEvent:void{
var suppSUBMIT:String = username_txt.text;
var suppRESET:String = reset_txt.text;
if (suppSUBMIT.length > 0 && suppRESET.length > 0) {
message_txt.text = "";
sendVars.submit = suppSUBMIT;
sendVars.reset = suppRESET;
sendPage.data = sendVars;
sender.load(sendPage);
else{
message_txt.text ="You must enter a last name and customer identification before clicking the submit button."
function completeHandler(e:Event):void{
var xmlResponse:XML = XML(e.target.data;
var userMessage:String;
if (xmlResponse.text().toString() == "true") {
userMessage = "Congratulations, information is retrieved"'';
else {
usermessage = "Information to be retrieved failed. Please try again";
message_txt.text =userMessage;
function ioErrorHandler(e:IOErrorEvent):void{
message_txt.text = e.text;
function securityErrorHandler(e:SecurityErrorEvent):void {
message_txt.text = e.text;
/**Foundation for Ed: XML & E4X-Chapter 9: COMMUNICATION WITH THE SERVER*/
import mx.events.FlexEvent;
import xmlUtilities.XMLLoader;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent
private var serverPath:String = "http://localhost/FOE/";
private function initApp(e:FlexEvent):void {
myXMLLoader = new XMLLoader();
myXMLLoader.addEventListener(Event.COMPLETE, completeHandler);
myXMLLoader.addEventListener(IOErrorEvent.IO_Error, IOErrorHandler);
SUBMIT.btn.addEventListener(MouseEvent.CLICK, clickHandler);
private function completeHandler(e:Event):void{
var userMessage:String;
var response:String =myXMLLoader.response().toString();
if (response:String = myXMLLoader.response().toString();
if (response == true"){
usermessage = "Congratualtions. You were successful";
else{
userMessage = Login failed. Please try again";
message_txt.text = userMessage;
private function clickHandler(e:MouseEvent):void{
var SUBMIT:String = submit_txt.text;
var RESET:String = reset_txt.text;
vars myVars:URLVariables = new URLVariables();
if (username.length > 0 && password.length > 0) {
myVars.SUBMIT = submit;
myVars.CUSTMER ID = customerid;
myXMLLOADER.loafxml("login.aspx, myVars);
else {
message_txt.text = "You must enter a last name and customer id before clicking the submit button"
private function IOErrorHandler(e:IOErrorEvent):void{
message_txt.text = e.text;
private function securityErrorHandler(e:SecurityErrorEvent):void{
message_txt.text = e.text;
/**Foundation for Ed: XML & E4X-Chapter 8: MODIFYING XML CONTENT WITH ACTIONSCRIPT 3.0*/
import mx.events.FlexEvent;
import mx.events.ListEvent;
import mx.collections.XMLListCollection;
import xmlUtilities.MyXMLLoaderHelper;
import mx.events.FlexEvent;
import mx.events.DataGridEvent;
private function initApp(e:Event):void {
/add testing lines here
private var myXMLLoader:MyXMLLoaderHelper;
private function initApp(e:FlexEvent):void {
myXMLLoader = new MyXMLLoaderHelper();
myXMLLoader.addEventListener(Event.COMPLETE, completeHandler);
myXMLLoader.addEventListener("xmlUpdated", xmlUpdatedHandler);
authors_cbo.addEventListener(ListEvent.CHANGE, changeHandler);
addRow_btn.addEventListener(MouseEvent.CLICK, addClickHandler);
delete_btn.addEventListener(MouseEvent.CLICK, deleteClickHandler);
books_dg.addEventListener(DataGridEvent.ITEM_EDIT_END, itemEditEndHandler);
authors_cbo.labelFunction = getFullName;
myXMLLoader.loadXML("Assets/customer_info.xml", "lastname");
private function completeHandler(e:Event):void {
authors_cbo.dataProvider = myXMLLoader.getChildElements("author");
tree_txt.text = myXMLLoader.getXML().toXMLString();
books_dg.dataProvider = myXMLLoader.getBooks(0);
private function getFullName(item:Object):String {
return item.authorFirstName + " " + item.customerLastName;
private function changeHandler(e:Event):void {
books_dg.dataProvider = myXMLLoader.getBooks(e.target.selectedIndex);
private function addClickHandler(e:MouseEvent):void {
var newBookName:String = name_txt.text;
var newPublishYear:String = year_txt.text;
var newBookCost:String = cost_txt.text;
var authorIndex:int = authors_cbo.selectedIndex;
if(newBookName.length > 0 && newPublishYear.length > 0 && newBookCost.length > 0) {
myXMLLoader.addBook(authorIndex, newBookName, newPublishYear, newBookCost);
private function deleteClickHandler(e:MouseEvent):void {
var bookIndex:int = books_dg.selectedIndex;
var authorIndex:int = authors_cbo.selectedIndex;;
if (books_dg.selectedIndex != -1) {
myXMLLoader.deleteBook(authorIndex, bookIndex);
private function itemEditEndHandler(e:DataGridEvent):void {
var authorIndex:int = authors_cbo.selectedIndex;
var dg:DataGrid = e.target as DataGrid;
var field:String = e.dataField;
var row:int = e.rowIndex;
var col:int = e.columnIndex;
var oldVal:String = e.itemRenderer.data[field];
var newVal:String = dg.itemEditorInstance[dg.columns[col].editorDataField];
if (oldVal != newVal) {
myXMLLoader.modifyXMLTree(authorIndex, dg.columns[col].dataField, row, newVal)
private function xmlUpdatedHandler(e:Event):void {
books_dg.dataProvider = myXMLLoader.getBooks(authors_cbo.selectedIndex);
tree_txt.text = myXMLLoader.getXML().toXMLString();
]]>
</mx:Script>
<s:Panel x="9" y="257" width="459" height="383" contentBackgroundColor="#666666" backgroundColor="#666666" chromeColor="#FCF6F6" title="DIRECTIONS TO SILVER FOX COLLISION CENTER:" fontSize="14">
<s:TextInput x="55" y="7" contentBackgroundColor="#030000" height="17" width="392"/>
<mx:Label x="3" y="6" text="FROM:" fontSize="14" color="#FDF9F9"/>
<s:TextInput x="1114" y="637" contentBackgroundColor="#FCF7F7" height="17" width="213"/>
<s:Button x="1337" y="634" label="GET DIRECTIONS" focusColor="#FBFCFD" chromeColor="#666666" color="#FEFEFE" width="141" fontSize="14"/>
<mx:Label x="1088" y="637" text="TO:" fontSize="12" color="#FDFBFB"/>
<s:Button x="295" y="56" label="GET DIRECTIONS" focusColor="#FBFCFD" chromeColor="#666666" color="#FEFEFE" width="157" fontSize="12"/>
<s:TextInput x="55" y="31" contentBackgroundColor="#070000" height="17" width="392"/>
<mx:Label x="25" y="30" text="TO:" fontSize="14" color="#FDFBFB"/>
</s:Panel>
<mx2:DataGrid x="10" y="54" width="458" height="104" color="#666666" contentBackgroundColor="#060000" borderColor="#030000" fontSize="8" focusColor="#666666" chromeColor="#030000" selectionColor="#666666" dropShadowVisible="true" rollOverColor="#FFFFFF">
<mx2:columns>
<mx2:DataGridColumn headerText="LAST NAME:" dataField="col1"/>
<mx2:DataGridColumn headerText="DESIGNATED DUE DATE:" dataField="col2"/>
<mx2:DataGridColumn headerText="STATUS UPDATED:" dataField="col3"/>
<mx2:DataGridColumn headerText="CUSTOMER ID:" dataField="col3"/>
</mx2:columns>
</mx2:DataGrid>
<mx:Text id="directionsSummary" width="100%"/> <mx:DataGrid id="directionsGrid" dataProvider="{directionsSteps}" width="100%" height="100%" sortableColumns="false" />
<mx:Text id="directionsCopyright" width="100%"/>
<mx:HBox> <mx:Label text="From: " width="70"/> <mx:TextInput id="from" text="San Francisco, CA" width="100%"/> </mx:HBox>
<mx:HBox> <mx:Label text="To: " width="70"/> <mx:TextInput id="to" text="Mountain View, CA" width="100%"/> </mx:HBox>
<s:Label x="11" y="38" text="LAST NAME:" color="#FCFBFB" fontSize="14" verticalAlign="top"/>
<s:TextArea x="96" y="32" width="145" height="18" focusColor="#FCFAFA" color="#010000" contentBackgroundColor="#000000" id="message_txt" text="{xmlService.lastResult.toString()}>
<s:Label x="273" y="37" text="CUSTOMER ID;" fontSize="14" color="#FDFBFB"/>
<s:TextInput x="376" y="32" width="89" height="18" focusColor="#FCF9F9" color="#FAF8F8" contentBackgroundColor="#040000"/>
<s:Button x="318" y="212" label="RESET" focusColor="#F8FAFB" color="#FEFBFB" chromeColor="#666666" fontSize="12"/>
<s:Button x="393" y="212" label="SUBMIT" focusColor="#F8F9FA" color="#FFFBFB" chromeColor="#666666" fontSize="12"/>
<s:TextArea x="10" y="160" width="458" height="48" color="#FEF8F8" contentBackgroundColor="#050000"/>
<mx:Panel x="483" y="31" width="750" height="609" layout="absolute" backgroundColor="#666666" borderVisible="true" dropShadowVisible="true" chromeColor="#FDF9F9">
<mx:VBox x="26" y="7" height="559" width="708">
<maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" x="500" y="25" width="700" height="550" key="ABQIAAAA9YXHa-b0xqHBMiooUNYUbhRpa9TAnukyOWjhoGl3Y9H2BJoi9xSrm6cnM0lBZ4lCtqRLxKpQK_eb Rg" sensor="true"/>
</mx:VBox>
</mx:Panel>
</mx:Application>
/**the AIR APPLICATION*/
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" backgroundColor="#666666" width="854" height="348" creationComplete="initApp(event)">
<s:HTTPService id="customer_info" url="data/customer_info.xml" resultFormat="e4x" result="resultHandler(event)"/>
<mx:Script>
<![CDATA[
/**FLEX 4 Bible: Chapter 24- Managing XML w/ E4X*/
private var xmlData:XML;
private function resultHandler(event:ResultEvent):void
xmlData = event.result as XML:
]]>
</mx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Image source="@Embed('Assets/logo.png')" x="1" y="0" width="760" height="168"/>
<s:Label x="96" y="126" text="Last Name:
" color="#FFFFFF" fontSize="20" fontFamily="Times New Roman"/>
<s:Label x="13" y="218" text="Designated Due Date:
" fontSize="20" fontFamily="Times New Roman" color="#FBF8F8"/>
<s:Label x="63" y="186" text="Status Updated:
" color="#FCF5F5" fontSize="20" fontFamily="Times New Roman"/>
<s:TextInput x="192" y="125" width="196"/>
<s:TextInput x="193" y="215" width="195"/>
<s:TextInput x="193" y="185" width="195"/>
<s:Label x="80" y="158" text="Customer ID:" color="#FDFCFC" fontSize="20" fontFamily="Times New Roman"/>
<s:TextInput x="192" y="155" width="196"/>
<s:Button x="243" y="241" label="RESET"/>
<s:Button x="317" y="241" label="UPDATE" focusColor="#666666"/>
</s:WindowedApplication>
/**the Customer Information XML*/
<?xml version="1.0" encoding="utf-8"?>
<allNames>
<name namesID="1">
<nameLastName>Ambrose</nameLastName>
<customerids>
<customerid customerID="1">
<customerID>777777</customerID>
</customerid>
</customerids>Hi All,
please note that we found the problem. The problem was that we didn't configure under:
"Configuration-> Security -> Message Security -> SOAP" the voprrect provider to handle the security.
After that was done (extract of domain.xml) the message was understood.
<provider-config class-name="com.sun.identity.agents.jsr196.as9soap.AMServerAuthModule" provider-id="AMServerProvider-UserNameToken-Plain" provider-type="server">
<request-policy auth-source="content"/>
<response-policy auth-source="content"/>
<property name="providername" value="UserNameToken-Plain"/>
</provider-config>unfortunately the next problem occured I will post in a new thread.
Edited by: rankin_ut on Jan 26, 2009 4:43 AM -
All -
I'm new to consuming web services in JDeveloper. I'm using Oracle JDEV 10.1.3.3/OC4J. I'm using this version since it is compatible with Oracle EBS 12.1.3. My intent is to pull data from our third party recruitment app (Success Factors) and load that data into Oracle HRIS. I'm already doing this through a .NET application. I'm converting it to be a Java Concurrent Program in EBS. The code listed below is a stub call to verify I'm on the right track. I created a JDeveloper Web Services proxy project. I'm testing it locally on my windows desktop. When I'm able to consume the service successfully, then I'll think about moving it to the EBS server.
I'm getting the following error when I invoke the following service:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
End point is: https://api4.successfactors.com/sfapi/v1/soap?wsdl
Any help/assistance would be much appreciated.
Below is my code and output of my test:
package emsc.oracle.apps.emscper.sfapi.proxy;
import HTTPClient.HTTPConnection;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSession;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.IsValidSessionResponse;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Login;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResponse;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LoginResult;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Logout;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.LogoutResponse;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFCredential;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.SFParameter;
import emsc.oracle.apps.emscper.sfapi.proxy.types.sfobject_sfapi_successfactors_com.Error;
import java.io.File;
import javax.xml.rpc.ServiceFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import javax.xml.ws.BindingProvider;
import javax.xml.soap.SOAPException;
import java.util.Map;
import oracle.security.ssl.OracleSSLCredential;
public class SFAPITest {
// Declare members:
private String companyId;
private String userName;
private String password;
private String developerKey;
private Date effDt;
private String greaterThanEffDt;
private String lessThanEffDt;
// Declare constants:
final static private String breakLine = "+---------------------------------------------------------------------------+";
final static private String format = "yyyy-mm-dd";
private enum ReqId {
PrimaryReq(25),
PrimaryReqCEO(26),
EmCarePrimary(27),
RTI(28),
EmCareClinical(29);
private int reqId;
private ReqId() {
private ReqId(int value) {
reqId = value;
public int getReqId() {
return reqId;
// Getters and Setters:
protected String getCompanyId() {
return this.companyId;
protected void setCompanyId(String value) {
this.companyId = value;
protected String getUserName() {
return this.userName;
protected void setUserName(String value) {
this.userName = value;
protected String getPassword() {
return this.password;
protected void setPassword(String value) {
this.password = value;
protected String getDeveloperKey() {
return this.developerKey;
protected void setDeveloperKey(String value) {
this.developerKey = value;
protected Date getEffDt() {
return this.effDt;
protected void setEffDt(Date value) {
this.effDt = value;
protected String getGreaterThanEffDt() {
return this.greaterThanEffDt;
protected void setGreaterThanEffDt(String value) {
this.greaterThanEffDt = value;
protected String getLessThanEffDt() {
return this.lessThanEffDt;
protected void setLessThanEffDt(String value) {
this.lessThanEffDt = value;
public void runProgram()
SFAPIService mySFAPIService;
String CompletionText = "";
String effDtStr2 = null;
/* Code your program logic here.
* Use getJDBCConnection method to get the connection object for any
* JDBC operations.
* Use CpContext provided commit,rollback methods to commit/rollback
* data base transactions.
* Don't forget to release the connection before returning from this
* method.
/* Call setCompletion method to set the request completion status and
* completion text.
* Status values are ReqCompletion.NORMAL,ReqCompletion.WARNING,
* ReqCompletion.ERROR.
* Use Completion text message of length 240 characters. If it is more
* than 240 then full string will appear in log file and truncated 240
* characters will be used as request completion text.
try
ServiceFactory factory = ServiceFactory.newInstance();
mySFAPIService = (emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService)factory.loadService(emsc.oracle.apps.emscper.sfapi.proxy.SFAPIService.class);
SFAPI api = mySFAPIService.getSFAPI();
/// SFAPI api = new SFAPI();
//Map<String, Object> requestContext = ((BindingProvider) api).getRequestContext();
//requestContext.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
System.out.println("ServiceName => " + mySFAPIService.getServiceName().toString());
System.out.println("End Point => " + mySFAPIService.getServiceName().toString());
System.out.println(breakLine);
// Authentication: Login to SFAPI:
SFCredential credential = new SFCredential();
// Fake credentials being passed in for this post:
credential.setCompanyId("XXX");
credential.setUsername("XXX");
credential.setPassword("XXX");
credential.setDeveloperKey("XXX");
HTTPConnection httpsConnection = null;
OracleSSLCredential _credential = new OracleSSLCredential();
_credential.setWallet("\\\\\\C:\\Program Files\\Java\\jdk1.6.0_33\\jre\\lib\\security", "ParkEstes3");
/*System.setProperty("javax.net.ssl.trustStore","C:\\\\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\keystore");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
System.out.println(System.getProperty("javax.net.ssl.trustStore"));*/
// SFParameter: Define a generic SFParameter List. This is a necessary parameter
// to invoking calls in SFAPI:
/*System.setProperty("javax.net.ssl.keyStore",
"file:\\\C:\\jdk1.4.1\\jre\\lib\\security\\client.keystore");
System.setProperty("javax.net.ssl.keyStorePassword","welcome"); */
/* System.setProperty("oracle.net.wallet_location",
"(SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=\\\C:\Users\dparrish\Oracle\WALLETS)))"); // (2) */
File kstore = new File("C:\\OraHome_1\\jdev\\jdevbin\\jdk\\jre\\lib\\security\\jssecacerts");
boolean exists = kstore.exists();
if (!exists) {
System.out.println("Keystore does not exist");
else {
System.out.println("Keystore does exist");
System.setProperty("javax.net.ssl.trustStore", kstore.getAbsolutePath());
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
//System.setProperty("proxySet", "false");
//System.setProperty("http.proxyHost", "127.0.0.1");
//System.setProperty("http.proxyPort", "8080");
System.out.println(kstore.getAbsolutePath());
List<SFParameter> lst = new ArrayList<SFParameter>();
SFParameter param = new SFParameter();
param.setName("");
param.setValue("");
lst.add(param);
SFParameter[] sfParam = lst.toArray(new SFParameter[lst.size()]);
Login login = new Login();
try {
login.setCredential(credential);
System.out.println("1");
login.setParam(sfParam);
System.out.println("2");
LoginResponse loginResponse = new LoginResponse();
LoginResult loginResult = new LoginResult();
try {
loginResponse = api.login(login);
catch (Exception e ) {
System.out.println(e.getMessage());
System.out.println("3");
try {
loginResult = loginResponse.getResult();
catch (Exception e ) {
System.out.println(e.getMessage());
System.out.println("4");
IsValidSession vs = new IsValidSession();
IsValidSessionResponse isValidSessionResponse = api.isValidSession(vs);
System.out.println("5");
if (isValidSessionResponse.isResult()) {
System.out.println("Session is valid");
System.out.println("Result => " + loginResult.getSessionId());
System.out.println(breakLine);
Logout logout = new Logout();
LogoutResponse logoutResponse = api.logout(logout);
if (logoutResponse.isResult()) {
System.out.println("Logout of SFAPI Successful");
else {
System.out.println("Logout of SFAPI Unsuccessful");
else {
System.out.println("Session is invalid");
List<Error> errors = new ArrayList<Error>();
for (int i = 0; i < loginResult.getError().length; i++) {
errors.add(loginResult.getError()[i]);
for (int i = 0; i < errors.size(); i++) {
System.out.println("Error Indice => " + i);
System.out.println("Error Code: => " + errors.get(i).getErrorCode());
System.out.println("Error Message: => " + errors.get(i).getErrorMessage());
System.out.println(breakLine);
} // end for loop of SFObject errors
} // end InvalidSession
catch (Exception e)
System.out.println("Session Credential Exception");
System.out.println("Exception => " + e.getMessage());
System.out.println(breakLine);
catch (Exception e)
System.out.println("Parameter List Exception");
System.out.println("Exception => " + e.getMessage());
System.out.println(breakLine);
} // end runProgram
// Constructor:
public SFAPITest() {
} // end constructor
public static void main (String args[]) {
try
SFAPITest test = new SFAPITest();
test.runProgram();
catch (Exception e) {
System.out.println("main exception => " + e.getMessage());
} // SFAPITest
Here is the output with trace:
WARNING: Unable to connect to URL: https://api4.successfactors.com:443/sfapi/v1/soap due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
Session Credential Exception
Exception => ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: String index out of range: -7
+---------------------------------------------------------------------------+
Process exited with exit code 0.The other end is throwing back a programming error.
That might be because you are sending incorrect data and the other end fails to validate it.
You might be able to guess based on your C# code. But, since you are using soap one generic solution is available to you.
- Get an http proxy interceptor like wireshark.
- Run it while your C# app runs, collect the http requests from that.
- Run it while running your java code, collect the http requests from that.
Compare the two.
Maybe you are looking for
-
I want use both audio cards. The On-board audio + SoundBlaster Audigy. Because I have mp3 player mp3tunes ( from http://www.mp3tunes.nl ) that is able play on both audiocards at the same time. It is good for DJ. One audiocard is for pre-listen. But
-
Itunes will not install on vista 64
I get an error when trying to install itunes: iTunes + QuickTime An error occurred during the installation of assembly "microsoft.vc80.crt, verstion =.........
-
Does anybody know if Windows 8 is causing a problem with iTunes? Many songs on my old iPod are now missing in my iTunes library and I can't find them anywhere. . Also, I have a new iPod and am afraid of using it for fear of something else going wr
-
Creating a DVD Movie that Plays When Inserted
I would like to movie DVD that plays automatically when inserted into a player. Is there a way to skip the initial interface where one has to click the play button on the screen? Thanks. Gus
-
I have set up a trial site using Muse that has Paypal Buy Now buttons to sell a product. I want to sell the product in different countries and so I have created different web pages for each country. On each of these pages is a Paypal Buy Now button w