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!
Karel
Hello,
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
Similar Messages
-
!!! How to print javax.xml.soap.SOAPElement -- help plz
hi
I am receiving an javax.xml.soap.SOAPElement in a stand alone client ,from a webservice.Like:
SOAPElement soapElement = port.findParty("35020722624");
I want to print the entire XML in the soapElement . how can i do that ? please let me know asap.Hi,
You could try a recursive method like this:
public void printTree( NodeList nodes, String padding )
for ( int i = 0; i < nodes.getLength(); i++ )
Node node = nodes.item(i);
String name = node.getNodeName();
System.out.print(padding + "<" + name + ">");
if ( node.hasChildNodes() )
System.out.println();
printTree(node.getChildNodes(), padding + " ");
else
System.out.println(node.getNodeValue() + "</"" + name + ">");
{code}
HTH -
How to Get SOAPElement BOM in SOAPMessage for Sales Opportunities
Hi experts,
I'm newbie in using Java.
I want to Update Sales Opportunities using SOAPMessage in Java.
So far, this is my sample code:
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
import testws.salesopportunities.BOM;
import testws.util.MyHandler;
public void updateOppr() {
Service service = Service.create(new QName("UpdateOpportunities"));
QName portQName = new QName("UpdateOpportunities");
QName elementbom = new QName("BOM");
try {
String endPoint = "http://192.168.56.102/B1WS/service.asmx";
service.addPort(portQName, javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING, endPoint);
service.setHandlerResolver(new MyHandler());
Dispatch<SOAPMessage> sourceDispatch = service.createDispatch(portQName, SOAPMessage.class, Service.Mode.MESSAGE);
salesOpBOM = (new testws.salesopportunities.ObjectFactory()).createBOM();
JAXBContext context = JAXBContext.newInstance(salesOpBOM.getClass().getPackage().getName());
Marshaller marshaller = context.createMarshaller();
SOAPMessage msg = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL).createMessage();
// create header
SOAPHeader header = msg.getSOAPHeader();
SOAPElement elMsgHeader = header.addChildElement("MsgHeader", "", "http://www.sap.com/SBO/DIS");
SOAPElement elSession = elMsgHeader.addChildElement("SessionID");
elSession.addTextNode(sessionID);
// create body
SOAPBody body = msg.getSOAPBody();
SOAPElement elCommand = body.addChildElement("UpdateObject", "", "http://www.sap.com/SBO/DIS");
SOAPElement elBOM = elCommand.addChildElement("BOM");
SOAPElement elBO = elBOM.addChildElement("BO");
SOAPElement elAdmInfo = elBO.addChildElement("AdmInfo");
SOAPElement elObj = elAdmInfo.addChildElement("Object");
elObj.addTextNode("oSalesOpportunities");
SOAPElement elQueryParam = elBO.addChildElement("QueryParams");
SOAPElement elParam1 = elQueryParam.addChildElement("SequentialNo");
elParam1.addTextNode("69");
SOAPElement elslsOpLine1 = elBO.addChildElement("SalesOpportunitiesLines");
SOAPElement elLineRow = elslsOpLine1.addChildElement("Row");
elLineRow = elslsOpLine1.addChildElement("Row");
elLineRow = elslsOpLine1.addChildElement("Row");
SOAPElement elLineRowMaxTotal = elLineRow.addChildElement("MaxLocalTotal");
SOAPElement elLineRowStageKey = elLineRow.addChildElement("StageKey");
SOAPElement elLineRowStagePercent = elLineRow.addChildElement("PercentageRate");
elLineRowStagePercent.addTextNode("85.00");
elLineRowStageKey.addTextNode("5");
elLineRowMaxTotal.addTextNode("1000000.00");
marshaller.marshal(salesOpBOM, elCommand);
msg.saveChanges();
SOAPMessage response = sourceDispatch.invoke(msg);
//End UpdateObject (Update Document / Add Document Lines)
} catch (Exception ex) {
ex.printStackTrace();
Edited by: Siddharta on Mar 4, 2011 10:31 AMAfter I Debug this code, i get an error message (SOAP Request were trimmed):
Update sales opportunities
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<MsgHeader xmlns="http://www.sap.com/SBO/DIS">
<SessionID>D8419D24-4E71-4D10-A425-1ADCCD6020C3</SessionID>
</MsgHeader>
</env:Header>
<env:Body>
<UpdateObject xmlns="http://www.sap.com/SBO/DIS">
<BOM>
<BO>
<AdmInfo>
<Object>oSalesOpportunities</Object>
</AdmInfo>
<QueryParams>
<SequentialNo>69</SequentialNo>
</QueryParams>
<SalesOpportunitiesLines>
<Row/>
<Row/>
<Row>
<MaxLocalTotal>1000000.00</MaxLocalTotal>
<StageKey>5</StageKey>
<PercentageRate>85.00</PercentageRate>
</Row>
</SalesOpportunitiesLines>
</BO>
</BOM>
<BOM xmlns="" xmlns:ns3="http://www.sap.com/SBO/DIS"/>
</UpdateObject>
</env:Body>
</env:Envelope>
javax.xml.ws.soap.SOAPFaultException: Invalid XML Stream
at com.sun.xml.internal.ws.fault.SOAP12Fault.getProtocolException(SOAP12Fault.java:210)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:176)
at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:195)
at testws.Main.updateOppr(Main.java:173)
at testws.Main.main(Main.java:43)
Why there is 2 SOAPElement for <BOM> ?
If my code is wrong, please can you help me?
Is there a way to get SOAPElement <BOM> in SOAPBody so i can update Sales Opportunities Document without addChildElement for <BOM>?
Thanks a lot.
Edited by: Siddharta on Mar 4, 2011 10:38 AM -
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 -
I am using SOA Mediator 11.1.1.7(11g) and while invoking a thrid party web service API I get the following error. Please help me fix this issue.
ORAMED-03302:[Exception in oneway execution]Unexpected exception in one-way operation "execute" on reference "AppvOffclJMSInAdapter_Exist_RS.AppvOffclJMSInAdapter_Exist_RS".Possible Fix:Check whether the reference service is properly configured and running or look at exception for analyzing the reason or contact Oracle Support Services. Cause:Unable to invoke endpoint URI "https://stripesqa.doe.gov/headergeneric/HeaderGeneric/HeaderGeneric.asmx" successfully due to: javax.xml.soap.SOAPException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html
Thanks,
Vedauser9055538 wrote:
i test the soa webservcies in a browserHi,
It would help if you could give us more details...
What type of soa webservices are we talking about here (JAX-RPC/BPEL/OSB)?
And how exactly are you testing your soa webservices in a browser (EM)?
A valid SOAP will have content-type: text/xml
You may be pointing to a invalid endpoint or you may have an authentication/authorisation problem, so you are receiving html instead of soap...
Cheers,
Vlad -
I have generated my Web Service Client Control Class based on WSDL file provided by Web Service Provider using JAX-RPC in "Oracle Workshop for WebLogic version 10.3".
I am using Web Service Client Control class in WebLogic Portal portlet backing class to invoke Web Service. But while invoking Web Service, I am getting following error:
Caused by: java.rmi.RemoteException: Failed to invoke; nested exception is:
javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAPElementweblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://xyz.com/abc/UpdateSR']:updateSRRequest}
Here is the code of my Portlet Backing class where I am using Service Control to invoke Web Service:
URL webServiceUrl = new URL(webServiceLocation);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
QName qName = new QName(nameSpaceURI, serviceName);
Service siebelService = serviceFactory.createService(webServiceUrl, qName);
updateSRServiceControl siebelServiceProxy = (updateSRServiceControl)siebelService.getPort(qName, updateSRServiceControl.class);
UpdateSRResponse updateSRResponse = siebelServiceProxy.updateSR(updateSRRequest);
Please let me know if more information required.
I appreciate for help.
Thanks in advance.
Regards
NeerajI have generated my Web Service Client Control Class based on WSDL file provided by Web Service Provider using JAX-RPC in "Oracle Workshop for WebLogic version 10.3".
I am using Web Service Client Control class in WebLogic Portal portlet backing class to invoke Web Service. But while invoking Web Service, I am getting following error:
Caused by: java.rmi.RemoteException: Failed to invoke; nested exception is:
javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAPElementweblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://xyz.com/abc/UpdateSR']:updateSRRequest}
Here is the code of my Portlet Backing class where I am using Service Control to invoke Web Service:
URL webServiceUrl = new URL(webServiceLocation);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
QName qName = new QName(nameSpaceURI, serviceName);
Service siebelService = serviceFactory.createService(webServiceUrl, qName);
updateSRServiceControl siebelServiceProxy = (updateSRServiceControl)siebelService.getPort(qName, updateSRServiceControl.class);
UpdateSRResponse updateSRResponse = siebelServiceProxy.updateSR(updateSRRequest);
Please let me know if more information required.
I appreciate for help.
Thanks in advance.
Regards
Neeraj -
Hi all,
I am getting below error while invoking Siebel web service from BPEL service,
<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: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html; charset=UTF-8
</summary>
</part>
</remoteFault>
</fault
Please help me to resolve this issue.
Thanks,
Santosh M EResolved, I was invoking an external Web service which is an Asynchronous 2 way.
Didn't capture the reply back from the Async service. -
Javax.xml.soap.SOAPException in Fusion Order Demo Application
Hi,
I setup the Oracle Fusion Middleware. I also deployed the Oracle Fusion Order Demo Application in the soa_server. I placed the order in the store front web for the price of 3000. The Store font Service initiates the call to webservice (OrderBookingService) and aproved the order using BAM worklist application and then I found the below error in the soa_server_diagnostic log file.
=====================================================================================================================================
2011-01-14T11:17:27.525+08:00] [soa_server1] [WARNING] [] [oracle.bam.adapter.adc.soap.DOOperationsDispatch] [tid: BatchProcessorThread(0)] [userId: <anonymous>] [ecid: 0000Iq2VyNWDCgWFLzuHOA1DBcDA000CjD,1:30958] [dcid: b6be438a400b4064:-27d42103:12d7db2014a:-7ffc-0000000000001b7c] Error in batch webservice[[
javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:784)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:234)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:105)
at oracle.bam.adapter.adc.soap.DOOperationsDispatch.batch(DOOperationsDispatch.java:103)
at oracle.bam.adapter.adc.soap.SOAPBatch.flush(SOAPBatch.java:107)
at oracle.bam.common.batching.BatchProcessor.run(BatchProcessor.java:1149)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:227)
at oracle.j2ee.ws.common.transport.HttpTransport.transmit(HttpTransport.java:75)
at oracle.j2ee.ws.common.async.MessageSender.call(MessageSender.java:64)
at oracle.j2ee.ws.common.async.Transmitter.transmitSync(Transmitter.java:134)
at oracle.j2ee.ws.common.async.Transmitter.transmit(Transmitter.java:90)
at oracle.j2ee.ws.common.async.RequestorImpl.transmit(RequestorImpl.java:275)
at oracle.j2ee.ws.common.async.RequestorImpl.invoke(RequestorImpl.java:95)
at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:741)
... 10 more
Caused by: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.post2(HttpSOAPConnection.java:516)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:1232)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:225)
... 17 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:215)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:212)
at HTTPClient.HTTPConnection.getSocket(HTTPConnection.java:3606)
at HTTPClient.HTTPConnection.doConnect(HTTPConnection.java:4364)
at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3358)
at HTTPClient.HttpOutputStream.closeImpl(HttpOutputStream.java:461)
at HTTPClient.HttpOutputStream.access$000(HttpOutputStream.java:99)
at HTTPClient.HttpOutputStream$1.run(HttpOutputStream.java:417)
at HTTPClient.HttpClientConfiguration.doAction(HttpClientConfiguration.java:666)
at HTTPClient.HttpOutputStream.close(HttpOutputStream.java:415)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.sendMessage(HttpSOAPConnection.java:1045)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.post2(HttpSOAPConnection.java:491)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:1232)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:225)
at oracle.j2ee.ws.common.transport.HttpTransport.transmit(HttpTransport.java:75)
at oracle.j2ee.ws.common.async.MessageSender.call(MessageSender.java:64)
at oracle.j2ee.ws.common.async.Transmitter.transmitSync(Transmitter.java:134)
at oracle.j2ee.ws.common.async.Transmitter.transmit(Transmitter.java:90)
at oracle.j2ee.ws.common.async.RequestorImpl.transmit(RequestorImpl.java:273)
at oracle.j2ee.ws.common.async.RequestorImpl.invoke(RequestorImpl.java:94)
at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:741)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:234)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:105)
at oracle.bam.adapter.adc.soap.DOOperationsDispatch.batch(DOOperationsDispatch.java:103)
at oracle.bam.adapter.adc.soap.SOAPBatch.flush(SOAPBatch.java:106)
at oracle.bam.common.batching.BatchProcessor.run(BatchProcessor.java:1149)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
=====================================================================================================================================
Edited by: Raju Ilayaraja on Jan 17, 2011 12:18 AMHi,
BookingOrderProcess is working correctly. I am getting the below error periodically.It looks like some batch process is throwing the communication error.
[2011-01-17T19:16:26.231+08:00] [soa_server1] [WARNING] [] [oracle.bam.adapter.adc.soap.DOOperationsDispatch] [tid: BatchProcessorThread(0)] [userId: <anonymous>] [ecid: 0000Iq2VyNWDCgWFLzuHOA1DBcDA000CjD,1:30958] [dcid: b6be438a400b4064:-27d42103:12d7db2014a:-7ffc-0000000000001b7c] Error in batch webservice[[
javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:784)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.synchronousInvocationWithRetry(OracleDispatchImpl.java:234)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.invoke(OracleDispatchImpl.java:105)
at oracle.bam.adapter.adc.soap.DOOperationsDispatch.batch(DOOperationsDispatch.java:103)
at oracle.bam.adapter.adc.soap.SOAPBatch.flush(SOAPBatch.java:107)
at oracle.bam.common.batching.BatchProcessor.run(BatchProcessor.java:1149)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:227)
at oracle.j2ee.ws.common.transport.HttpTransport.transmit(HttpTransport.java:75)
at oracle.j2ee.ws.common.async.MessageSender.call(MessageSender.java:64)
at oracle.j2ee.ws.common.async.Transmitter.transmitSync(Transmitter.java:134)
at oracle.j2ee.ws.common.async.Transmitter.transmit(Transmitter.java:90)
at oracle.j2ee.ws.common.async.RequestorImpl.transmit(RequestorImpl.java:275)
at oracle.j2ee.ws.common.async.RequestorImpl.invoke(RequestorImpl.java:95)
at oracle.j2ee.ws.client.jaxws.DispatchImpl.invoke(DispatchImpl.java:741)
... 10 more
Caused by: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.post2(HttpSOAPConnection.java:516)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:1232)
at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:225)
... 17 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
Regards,
Ilaya -
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. -
Error:Can not found "javax/xml/soap"
Hi:
I'm fairly new to Java development and I'm trying to write a wrapper class that will access a webservice. The problem I'm running into is that I keep getting this error message when I try to compile my class:
./STest.java:1: error:Can not found "javax/xml/soap" [JLS 7.5.2, 7.6]
I've installed the jwsdb-1_2 and I think mh env is set up correctly.
The above error message is generated by:
import javax.xml.soap.*;
Please help!I've searched every jar file and it doesn't seem as though any of them have the soap stuff....
This page, http://java.sun.com/webservices/docs/1.0/api/overview-summary.html, seems to say that I need the Web Services Developer Pack, which is was the wsdp is.... -
Org.w3c.dom.Element to javax.xml.soap.SOAPElement
I have a org.w3c.dom.Element that I want to insert into an existing SOAPBody using
public SOAPElement addChildElement(SOAPElement element). How can I turn the org.w3c.dom.Element
into a javax.xml.soap.SOAPElement so that I can do that?
Steve WatsonHi Steve,
Here's a code segment that may be of some value.
Bruce
public SOAPElement populateSOAPElement(SOAPEnvelope envelope,
SOAPElement element, Element sndElement) throws SOAPException{
int i, j;
NamedNodeMap map;
Node node;
NodeList list;
SOAPElement subElement;
//populate attributes
map = sndElement.getAttributes();
for (j = 0; j < map.getLength(); j ++)
node = map.item(j);
element.addAttribute(envelope.createName(node.getNodeName()),
sndElement.getAttribute(node.getNodeName()));
//populate the element value and subElements
list = sndElement.getChildNodes();
for (j = 0; j < list.getLength(); j ++)
short type = list.item(j).getNodeType();
String typeString = "";
if (list.item(j).getNodeType() == 3)
element.addTextNode(list.item(j).getNodeValue());
if(list.item(j).getNodeType() == 1)
subElement =
element.addChildElement(((Element)list.item(j)).getTagName());
subElement = populateSOAPElement(envelope, subElement,
(Element)list.item(j));
return element;
Steve wrote:
>
I have a org.w3c.dom.Element that I want to insert into an existing SOAPBody using
public SOAPElement addChildElement(SOAPElement element). How can I turn the org.w3c.dom.Element
into a javax.xml.soap.SOAPElement so that I can do that?
Steve Watson -
Package javax.xml.soap does not exist
I have created a UDDI publish client where i am trying to publish a service.
But when i try to compile my code it gives me the following error:
package javax.xml.soap does not exist
I know i am missing some jar in my classpath. But i don't know which one. I have tried soap.jar, jaxm-api.jar, jaxm-runtime.jar, but of no success.
Can anybody tell me which jar am i missing.
Regards
RishiI tried "Request.java" (get it neer sun tutorial pages) inside windows environnement, and i got the same error !!!
Request.java:4: package javax.xml.soap does not exist
import javax.xml.soap.*;
^
1 error
(javac -classpath .;%JAVA_HOME%\lib;%JWSDP_HOME%\common\lib\mail.jar;%JWSDP_HOME%\common\lib\activation.jar;%JWSDP_HOME%\common\lib\jaxm-api.jar Request.java )
... But when i used the same command under linux it works well !
(try this sample Request.java to see difference...)
// Request.java
// (c) Sun , 2002
import java.io.*;
import java.util.*;
import javax.xml.soap.*;
import javax.xml.messaging.*;
public class Request {
public static void main(String[] args) -
Web service call: javax.xml.soap.SOAPException: bloken pipe
Hello,
We are calling a web service deployed to OAS 10.1.3 from database 10.1.2.
Some times it works, but sometimes we get the exception below.
What could be wrong?
Thank you.
java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Premature EOF encountered
at com.amc.dd.proxy.runtime.DDRequesterWSSoapHttp_Stub.requestDispatch(DDRequesterWSSoapHttp_Stub.java:96)
at com.amc.dd.requester.DDRequesterWSSoapHttpPortClient.requestDispatch(DDRequesterWSSoapHttpPortClient.java:44)
at com.amc.dd.db.DBDDRequester.requestDispatch(DBDDRequester.java:36)
Caused by: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Premature EOF encountered
at oracle.j2ee.ws.client.http.HttpClientTransport.invokeImpl(Unknown Source)
at oracle.j2ee.ws.client.http.HttpClientTransport.invoke(Unknown Source)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:175)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
at com.amc.dd.proxy.runtime.DDRequesterWSSoapHttp_Stub.requestDispatch(DDRequesterWSSoapHttp_Stub.java:80)Does anyone have any help with this post? We are receiving the same intermittent errors. Sometimes it works, sometimes it doesn't.
java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: send failed
Broken pipe
at billing_service_client.proxy.runtime.BCCreateAccountPortSoapBinding_Stub.createAccount(BCCreateAccountPortSoapBinding_Stub.java:92)
at billing_service_client.proxy.BCCreateAccountPortClient.createAccount(BCCreateAccountPortClient.java:40)
at com.sentry.bc.ai_trans_collection.oracleTestClient(ai_trans_collection.java:96)
Caused by: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: send failed
Broken pipe
at oracle.j2ee.ws.client.http.HttpClientTransport.invokeImpl(Unknown Source)
at oracle.j2ee.ws.client.http.HttpClientTransport.invoke(Unknown Source)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:175)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
at billing_service_client.proxy.runtime.BCCreateAccountPortSoapBinding_Stub.createAccount(BCCreateAccountPortSoapBinding_Stub.java:76)
... 2 more -
Hi,
where can i adjust the timeout for:
exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection timed out: connect
The webservice needs 5min to return a message....
I found a duplicate of this on thread:
error initiating a test instance
But no answer
Message was edited by:
HEWizardI found http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/events.htm#BABGGADB
Setting Timeouts for Synchronous Processes
For synchronous processes that connect to a remote database, you must increase the syncMaxWaitTime timeout property in the SOA_Oracle_Home\bpel\domains\default\config\domain.xml file:
<property id="syncMaxWaitTime">
<name>Delivery result receiver maximum wait time</name>
<value>60000000</value>
<comment>
<![CDATA[The maximum time the process result receiver will wait for a
result before returning. Results from asynchronous BPEL processes are
retrieved synchronously via a receiver that will wait for a result from the
container.
<p/>
The default value is 60 seconds.]]>
</comment>
</property>
But this changes nothing...
Is this value ignored? -
How to get built.xml for ear file in jdeveloper?
Hi,
I am using JDeveloper to create EAR file for my ADF Fusion Application. I think Jdeveloper use ant to create EAR file. I know how to get built.xml for my war file.
Can anyone tell how to get that built.xml that create EAR file in Jdeveloper.?This blog explains:
http://adfhowto.blogspot.com/2011/03/ojdeploy-deploying-adf-application-from.html
Based on the blog, I simply copied an existing project "deploy" target definition and augmented the project's build.xml with a new target "deployApp" that omits the Project parameter to ojdeploy. This causes ojdeploy to build the workspace-level deploy profile instead. I also omitted the output directory parameter (default is app's /deploy folder) and assume that there is only one application deployment profile (i.e. the default for profile parameter is the '*' wildcard). You can augment the build.properties file if you need to get fancier than that.
<target name="deployApp" description="Deploy Complete YourFoo Application"
depends="init">
<taskdef name="ojdeploy"
classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask"
uri="oraclelib:OJDeployAntTask"
classpath="${oracle.jdeveloper.ant.library}"/>
<ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask"
executable="${oracle.jdeveloper.ojdeploy.path}"
ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
<ora:deploy>
<ora:parameter name="workspace"
value="${oracle.jdeveloper.workspace.path}"/>
<ora:parameter name="profile"
value="${oracle.jdeveloper.deploy.profile.name}"/>
<ora:parameter name="nocompile" value="true"/>
</ora:deploy>
</ora:ojdeploy>
</target>
Maybe you are looking for
-
Getting values from application context
I want to set an input box with the value from the jsp getRemoteHost() in jsf page.. In my page i have this <h:inputText value="#{sok.Searchstring}">... where the reference sok is a java bean public class sok private String Searchstring; pu
-
I would like to see the same mails in all my apple devices. Can someone please tell me how? My calendar and contacts sync but my mailboxes dont...
-
Does anyone know how to use the Yoga 2 Pro Recovery Media?
Hey guys, Tech support is not being helpful at all. I paid $60 just for some recovery discs to recover my accidentally formatted Yoga 2 Pro. The discs came with no instructions whatsoever, and using them is weird. First of all, there is two disc 1's,
-
NI 9237 External Excitation - VeriStand 2013 SP1
The recommended excitation voltage for my pressure transducers is + 10 VDC. I prefer to use external excitation as per the NI 9237 manual, total power for the module is limited to 150 mW, which in my case is "Four 350 ohm full bridges at 3.3 V". (I w
-
4s thinks my old email is my user id - my phone wont change it!
I was messing with my ID and password bc I deleted my old email (was my user id) and now my phone thinks my id is my old email address. I can't change it so everything is out of sorts (text msg, photostream, etc.)! Please help!