OWSM Custom Step SOAPMessage Class Problem

I have SOA Suite installed on several different machines. All have BPEL, ESB, and OWSM installed. I have a BPEL process that calls a web service hosted on a remote machine that uses a OWSM client agent to do "security stuff". I have a custom OWSM step that does the "security stuff". On one machine everything works as it should. On another machine, I am getting the following error in the execute() method of my custom step implementation:
java.lang.UnsupportedOperationException: getSOAPBody must be overridden by all subclasses of SOAPMessage:
at my.custom.step.CustomStep(CustomStep:83)
at com.cfluent.pipelineengine.container.DefaultPipeline.execute(DefaultPipeline.java:124)
at com.cfluent.pipelineengine.container.DefaultPipeline.execute(DefaultPipeline.java:97)
at com.cfluent.pipelineengine.container.DefaultPolicy$DeferredPipeline.execute(DefaultPolicy:63)
at com.cfluent.pipelineengine.container.DefaultPolicy$DeferredPipeline.access$300(DefaultPolicy:18)
<snipped>
Here's the snippet of code from the execute() method of the custom step:
SOAPMessage soapMsg = messageContext.getRequestMessage();
if ( soapMsg.getSOAPBody().hasFault()) // !!!!!!!!!!!!!!!!!!!!!!!! Here's where the error is occurring
When I log out soapMsg.getClass().getName() I get "org.apache.axis.Message".
Now, when I execute the same piece of code on another machine, it works fine and the class for SOAPMessage
is oracle.j2ee.ws.saaj.soap.soap12.Message12.
Any idea why the class difference? Is there some SOAPFactory configuration value somewhere?
Thanks in advance.

mrmora,
After opening a Service Request and communicating with one of Oracle's reps, I was told that the HttpServletRequest (and I guess other client info) is never available for either the Server Agent or Client Agent.
I created a Gateway, instead, and and I'm now getting the HttpServletRequest and the client's IP. Both of these codes now work:
HttpServletRequest request = (HttpServletRequest)messageContext.getProperty("javax.servlet.request");
String clientIP = httpSrvltRqst.getRemoteHost();
=====
String clientIP = ((MessageContext)messageContext).getRemoteAddr();
Thanks.

Similar Messages

  • OWSM custom step

    I am creating a OWSM custom step for validating 'XML Signature Verification'. The step provided by the tool has some limitations (if otherwise please correct me).
    Only one certificate can be configured and the certificates need to be provided in jks file store.
    My requirements are a bit different. I am using both username token as well as XML signatures. Using the username I will retrieve the certificate from the LDAP or database. But my question is how do I verify the XML signature. Can I extend the step already provided in OWSM?
    I have already written a custom step that retrieves the certificate from the database using the username.
    Thanks,
    Sashwat

    I've come across the following Beans which look like they provide the details I need:
    com.cfluent.webui.uibeans.opcockpit.ServiceLatencyBean;
    com.cfluent.webui.uibeans.opcockpit.MessageTrafficBean;
    Has anyone used these and tried to access data via these beans directly?

  • OWSM Custom Step to modify SOAPBody

    We're trying to write a custom step that takes a username out of a WS-SECURITY header and forces it into an element in our SOAPBody.
    My code to pull the name from the header works fine, so does my code to iterate through the body to find the element I want to modify. But then what? setObjectValue doesn't seem to work. I also know that I've got to use setDirty, but when I run it on my soapbodyelement then most of the body disappears from the soap message.
    try {
    org.apache.axis.message.SOAPEnvelope env = soapMessage.getAxisMessage().getSOAPEnvelope();
    env.setDirty(true);
    SOAPBody soapBody = (SOAPBody)env.getBody();
    soapBody.setDirty(true);
    java.util.Iterator iterator = soapBody.getChildElements();
    while (iterator.hasNext()) {
    SOAPBodyElement bodyElement = (SOAPBodyElement)iterator.next();
    java.util.Iterator childIterator = bodyElement.getChildElements();
    while (childIterator != null && childIterator.hasNext()) {
    MessageElement childElement = (MessageElement)childIterator.next();
    if (childElement.getName() == "usernamein1") {
    log("Hey, I found the username 1 paramenter");
    log("old child element value" + childElement.getValue());
    childElement.setObjectValue("eureeka");
    ((org.apache.axis.message.MessageElement)childElement).setDirty(true);
    logSOAPMessage(soapMessage);
    I've seen the thread and blog post about adding a new header and I've done that. But I can't seem to affect the body, except to destroy it.
    So again, my goal is to take a WS-SECURITY username and force it in to a particular body element so that my web service (which is a pl/sql stored procedure) can know who it is talking to for auditing purposes. Help!

    I was never able to find out exactly why the problem occurs with setDirty(true) on an existing SOAPBodyElement in the message, but I did find a way to circumvent the problem.
    Basically what I did was to create a new SOAPBodyElement with the same Name, add that as a child to the SOAPBody, add the children of the old SOAPBodyElement to the new one, and detach the old SOAPBodyElement. Using setDirty(true) on the new element did not drop the content.
    SOAPEnvelope senv = msg.getAxisMessage().getSOAPEnvelope();
    SOAPBody sBody = (SOAPBody) senv.getBody();
    SOAPBodyElement serviceRequestOld = senv.getFirstBody();
    SOAPBodyElement serviceRequest = (SOAPBodyElement) sBody.addBodyElement(serviceRequestOld.getElementName());
    ArrayList<MessageElement> serviceRequestChildrenOld = serviceRequestOld.getChildren();
    for (MessageElement oldMessageElement : serviceRequestChildrenOld) {
    serviceRequest.addChild(oldMessageElement);
    serviceRequestOld.detachNode();
    // modify children as needed
    // setDirty(true) on changed elements and all the way up the hierarchy
    serviceRequest.setDirty(true);
    sBody.setDirty(true);
    senv.setDirty(true);
    This was helpful:
    http://www.oracle.com/technetwork/articles/jones-owsm-101767.html

  • OWSM custom step & web service proxy

    Hello!
    I'm writing custom step, in which I want to call methods from another web services. So I generated in JDev (i'm using 10g) Web Service Proxy, I have all needed classes generated,
    and I want to use it in my custom step (i.e. invoke some method). But when I try to build .jar I get errors like this:
    [javac] C:\Documents and Settings\admin\Pulpit\My Dropbox\my_apps\Laboratoria\PEP\src\pep\proxy\runtime\PDPConnectorPortBinding_Stub.java:61: cannot find symbol
    [javac] symbol : method setProperty(java.lang.String,java.lang.Object)
    [javac] location: class javax.xml.soap.SOAPMessage
    [javac] _state.getMessageContext().getMessage().setProperty("DimeEncode",_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS));
    what is the problem? some classes incompatiblity? I tried to use jdk 1.5 and 1.6...
    Best regards,
    Michal

    Hi,
    Are you accessing teh WSDl from a deployed service ? If yes, when providing the Web Service URL, did you extend the URL with ?WSDL ?
    Frank

  • OWSM Custom Step - Determine Remote Address

    I'm working on a custom step that provides custom metrics for some of our web services (BPEL). The only thing that I haven't been able to figure out is the remote address.
    The heart of my code is:
    public IResult execute(IMessageContext messageContext) throws Fault {
    Result result = new Result();
    result.setStatus(IResult.FAILED);
    boolean isRequest = (IMessageContext.STAGE_REQUEST.equals(messageContext.getProcessingStage()) || IMessageContext.STAGE_PREREQUEST.equals(messageContext.getProcessingStage()));
    if (!isRequest) {
    result.setStatus(IResult.SUCCEEDED);
    return result;
    try {
    log(messageContext);
    result.setStatus(IResult.SUCCEEDED);
    } catch (Exception ex) {
    messageContext.getInvocationStatus().setErrorMessage(ex.getMessage());
    generateFault(ex.getMessage());
    return result;
    private void log(IMessageContext messageContext) throws Exception {
    String client = null;
    try {
    client = ((MessageContext) messageContext).getRemoteAddr();
    // HttpServletRequest httpServletRequest = (HttpServletRequest) messageContext.getProperty("javax.servlet.request");
    // if (httpServletRequest != null) {
    // client = httpServletRequest.getHeader("Host");
    } catch (Exception ex) {
    String msg = "Unable to extract the client IP address.";
    throw new Exception (msg);
    <continue capturing metrics and log to the database>
    The problem is, client is always null. I've tried both techniques I've found online and neither of them seem to produce any results. Could there be some server configuration that is preventing this information from be sent to OWSM?

    mrmora,
    After opening a Service Request and communicating with one of Oracle's reps, I was told that the HttpServletRequest (and I guess other client info) is never available for either the Server Agent or Client Agent.
    I created a Gateway, instead, and and I'm now getting the HttpServletRequest and the client's IP. Both of these codes now work:
    HttpServletRequest request = (HttpServletRequest)messageContext.getProperty("javax.servlet.request");
    String clientIP = httpSrvltRqst.getRemoteHost();
    =====
    String clientIP = ((MessageContext)messageContext).getRemoteAddr();
    Thanks.

  • ** OWSM Custom Step: Accessing OWSM Monitor Metrics Programmatically ?? **

    Hi all,
    I have posted this in the SOA Forum with no response, so trying my luck here.
    I would like to programmatically access the OWSM monitor metrics, specifically the Service Statistics (Traffic Analysis and Latency Variance).
    Is there any way to programmatically query the current Stats for the service protected by OWSM policies?
    I would like create a custom policy step that interrogates the current OWSM Monitor status of the Service, and then actions it accordingly.
    I have looked in the Extensibility Guide, but documentation is not very clear.
    I have found classes in com.cfluent.coreman.sdk.* and com.cfluent.webui.uibeans.opcockpit.* which seem useful, but no documentation is available as these APIs do not appear to be published.
    Any help would be greatly appreciated.

    I've come across the following Beans which look like they provide the details I need:
    com.cfluent.webui.uibeans.opcockpit.ServiceLatencyBean;
    com.cfluent.webui.uibeans.opcockpit.MessageTrafficBean;
    Has anyone used these and tried to access data via these beans directly?

  • OWSM - Build a Pause into a Custom Step

    Hi,
    We have been experiencing an EOF error in BPEL process on response step of remote Web Service invocation. The invocation is in a loop which will retrieve data from 3rd party web service until no data left to return, so could run through 100 invocations in quick succession. We are using a clustered 10.1.3.4 environment. I cannot replicate this in our UAT environment which is exactly the same build as our Production. Never get the error, no matter how big the payload in response or frequency of invocations. It shares the same environment, config, firewalls..etc. I have set the Disable Keep Alives which is still not resolving the issue. The problem is intermittant and only seems to occur on request/response steps taking over 3 seconds. We have had all the firewall policies checked on our side and on 3rd parties side, with not timeout policies found. In order to try and replicate the issue, I was hoping to build a wait into the reponse of message via OWSM custom step. However, no matter what I try, OWSM just ignores this and keeps processing.
    Used a template with a variable for sleep time in milliseconds to deploy custom step, which appears in policies and the variable can be assigned a value like 5000 (5 seconds). Invocation runs fine with message being returned from BPEL process, just does not wait! Has anyone got any ideas on the initial issue or how to get the wait to work.
    Thanks
    Custom Step Code below:
    import com.cfluent.policysteps.sdk.AbstractStep;
    import com.cfluent.policysteps.sdk.Fault;
    import com.cfluent.policysteps.sdk.IMessageContext;
    import com.cfluent.policysteps.sdk.IResult;
    import com.cfluent.policysteps.sdk.Result;
    public class SleepStep extends AbstractStep {
    public SleepStep() {
    public IResult execute(IMessageContext messageContext) throws Fault {
    IResult resultStatus = new Result();
    resultStatus.setStatus(IResult.FAILED);
    try {
    //Getting the SOAPMessage object from the context
    javax.xml.soap.SOAPMessage soapMessage = messageContext.getRequestMessage();
    // Code to generate a specific wait time in milliseconds
    long time = ((Long)messageContext.getProperty("time_to_sleep")).longValue();
    long start,stop;
    start=System.currentTimeMillis();
    do{
    stop=System.currentTimeMillis();
    } while ((stop-start)<time);
    resultStatus.setStatus(IResult.SUCCEEDED);
    //Set the SOAP Request back into the context
    messageContext.setRequestMessage(soapMessage);
    } catch (Exception ex) {
    String errMsg = ex.getMessage();
    generateFault(errMsg);
    return resultStatus;
    } }

    So it is not possible to use setInterval() inside a for()
    loop?
    "kglad" <[email protected]> wrote in message
    news:eth4g6$2np$[email protected]..
    > you can't. use an onEnterFrame() or setInterval() loop.

  • OWSM: Modify SOAPMessage in custom step

    I'm working on a custom step to provide web service authentication. For whatever reason, I've been told that to put the security token inside of of the SOAPBody and not in a header. Anyway, our request will look something like:
    &lt;SOAPBody&gt;
    &lt;FooRequest&gt;
    &lt;SecurityToken&gt;'security token'&lt;/SecurityToken&gt;
    &lt;/FooRequest&gt;
    &lt;/SOAPBody&gt;
    I have no problems extracting the contents of &lt;SecurityToken&gt;. Once extracted, I run the token through some processing to return a username. At that point, I want to replace 'security token' with the 'username' I computed.
    So my BPEL process will receive something like:
    &lt;SOAPBody&gt;
    &lt;FooRequest&gt;
    &lt;SecurityToken&gt;'username'&lt;/SecurityToken&gt;
    &lt;/FooRequest&gt;
    &lt;/SOAPBody&gt;
    Problem is I don't see how to easily accomplish this. For whatever reason, my SOAPElement does not have the setValue function available. I've gone as far as detaching the element and then recreating it. But in doing so, I'm not able to get the namespaces and prefixes setup easily.
    Any ideas?
    I think I'm going to have to convince some people that it would be better to put the 'security token' in WS-Security's BinarySecurityToken and then adding the UsernameToken to the SOAPHeader.

    I'm working on a custom step to provide web service authentication. For whatever reason, I've been told that to put the security token inside of of the SOAPBody and not in a header. Anyway, our request will look something like:
    &lt;SOAPBody&gt;
    &lt;FooRequest&gt;
    &lt;SecurityToken&gt;'security token'&lt;/SecurityToken&gt;
    &lt;/FooRequest&gt;
    &lt;/SOAPBody&gt;
    I have no problems extracting the contents of &lt;SecurityToken&gt;. Once extracted, I run the token through some processing to return a username. At that point, I want to replace 'security token' with the 'username' I computed.
    So my BPEL process will receive something like:
    &lt;SOAPBody&gt;
    &lt;FooRequest&gt;
    &lt;SecurityToken&gt;'username'&lt;/SecurityToken&gt;
    &lt;/FooRequest&gt;
    &lt;/SOAPBody&gt;
    Problem is I don't see how to easily accomplish this. For whatever reason, my SOAPElement does not have the setValue function available. I've gone as far as detaching the element and then recreating it. But in doing so, I'm not able to get the namespaces and prefixes setup easily.
    Any ideas?
    I think I'm going to have to convince some people that it would be better to put the 'security token' in WS-Security's BinarySecurityToken and then adding the UsernameToken to the SOAPHeader.

  • OWSM: How to reference Custom Step properties/parameters?

    Hi,
    When you define a Custom Step via a XML file. You can define properties/parameters. In the sample files that comes with OWSM (CustomAuthenticationStep.xml) Username and Password are defined. My problem is that I cannot figure out how to reference these in the Java Step source. In the sample file CustomAuthenticationStep.java there are no references. There are two class variables called expectedUsername and expectedUserPassword, but they are never set in the source? There are nothing in the Extensibility Guide about this. Anybody know how it works?
    Regards Peter

    I've made a couple of these now. It somehow walks through the xml file you upload and then the properties defined are matched with the appropriate get/set methods in the actual java code.
    One example I had to make was to add HTTP Basic Auth headers to a request. Here is the section of the xml file.
    <csw:PropertyDefinitionSet name="HTTP Basic Auth Params">
    <csw:PropertyDefinition name="httpBasicAuthUsername" type="string" isRequired="true">
    <csw:DisplayName>Username</csw:DisplayName>
    <csw:Description>Http Basic Auth Username</csw:Description>
    <csw:DefaultValue>
    <csw:Absolute>USERNAME</csw:Absolute>
    </csw:DefaultValue>
    </csw:PropertyDefinition>
    <csw:PropertyDefinition name="httpBasicAuthPassword" type="string" isRequired="true" displayType="password">
    <csw:DisplayName>Http Basic Auth Password</csw:DisplayName>
    <csw:Description>Password to access Private Key</csw:Description>
    <csw:DefaultValue>
    <csw:Absolute>PASSWORD</csw:Absolute>
    </csw:DefaultValue>
    </csw:PropertyDefinition>
    </csw:PropertyDefinitionSet>
    You then have these get/set methods at the bottom of the class I created.
    public String gethttpBasicAuthUsername() {
    return this._httpBasicAuthUsername;
    public void sethttpBasicAuthUsername(String username) {
    this._httpBasicAuthUsername = username;
    public String gethttpBasicAuthPassword() {
    return this._httpBasicAuthPassword;
    public void sethttpBasicAuthPassword(String password) {
    this._httpBasicAuthPassword = password;
    Then I had this and the properties were available for use.
    public class BasicAuthStep extends AbstractStep {
    private String _httpBasicAuthUsername = null;
    private String _httpBasicAuthPassword = null;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Custom Step for inserting SAML in OWSM

    Hi All,
    I am working on creating a custom step for SAML assertion in OWSM 10g.
    I did the following things
    1) Extented AbstractStep class, and Implemented its methods (init,destroy,execute...)
    2) Compiled and created java archieve; placed in the custom folder of owsm
    3) Created the step template xml with accordance to the class and imported it.
    In the java class i used com.cfluent.policysteps.security.saml.InsertSAMLSVStep.
    Can any one assist me in finding some documentation on the class?
    Edited by: Justin Smith on Dec 1, 2010 4:08 AM

    I shud have posted this question in SOA Suite forum, but still, any feed back is welcomed. :)

  • OWSM: Where to put additional jars for a custom step

    I'm in the process of creating a custom step for OWSM. The step relies on some additional libraries that are not found on the server at the moment. Where do I put them so that my custom step will find them?
    I'd like to avoid packaging them into the steps jar file if possible.

    You can put anywhere and probably create shared library in your server.xml and import them in following shared libraries:
    oracle.wsm.policymanager
    oracle.wsm.gateway
    oracle.wsm.coreman
    oracle.wsm.ccore
    HTH,
    Chintan

  • OWSM 10g Custom step deployment

    I try to deploy a custom step in OWSM 10g. Does anyone know where should I put the custom.jar and how to deploy it?

    Put the JAR file in $ORACLE_HOME/owsm/lib/custom
    Restart SOA Suite and away you go ...

  • OWSM Server Agent custom steps

    Can someone please lead me to a document and/or provide instructions that detail how to configure a custom step (like the one in C:\product\10.1.3.1\OracleAS_1\owsm\samples\customsteps) into an existing server agent policy as one of the pipeline steps. It's not obvious which option it is in the "Step Template" drop-down menu; unless I'm missing something; I'm also thinking the custom step (code/package) itself is a template and needs to be configured so that it appears in the pipeline "Step Template" drop-down.
    Thanks in advance!

    Found it.
    http://www.oracle.com/technology/obe/fusion_middleware/owsm/custom%20steps/custom%20steps.htm

  • Problems with upgrading interfaces of custom step types

    This question is about configuration management of custom step types.
    Here at Cummins, we have defined our own custom step types (CSTs) using MyTypes.ini. People all over the company use these CSTs in their seq files.
    All these CSTs are calls to individual sequences in a seq file (for simplicity, we'll call this file "Source.seq"). An example CST would be MyStep which calls the sequence MyStep_sequence in the file Source.seq.
    What we want to do going forward is: add one more parameter to the interface of this CST. That means, we will add one more parameter to the sequence MyStep_sequence and then upgrade the definition of the step in MyTypes.ini. We don't want to break existing users, and want the future users of this CST to be able to use this new parameter for newer functionality (ofcourse I did think about creating a new CST all together, but that seemed more maintenance in the future).
    In order to achieve this, my idea was to check mark the box "Use Default" in MyTypes.ini for the new parameter (I propose this because very few of the new users will want to care about this new parameter). At the same time, increment the version number of the step. So now, when an old file is brought up that was using this step, it should be usable just as is without any modifications (ofcourse it will need to be re-saved). When this step is used now by a new person, he will be able to see the new parameter and either not care about it (leave it checked as "Use Default") or pass a desired input to it.
    First question :, does this sound like a good long term approach for maintaining backward compatibility and CM control? Or are there any percieved issues with doing this due to which its recommended to just go ahead and create a new step?
    Second question: this seems to work only if the new parameter is added as a the last parameter in the sequence. if I move things around, (for ex: make this new parameter the first parameter of the sequence), it seems to mess things up. I am okay with making the new interface parameter the last one, but just wanted to throw out this observation I made and see if people had any comments..
    Third question: to make things a little more complex, some of the other sequences in Source.seq also USE MyStep. But I've realized that the only implication this has is, I'll have to open up Source.seq and re-save it beofore I send it out to the users..?

    Hi Anuj,
    Answer 1: Yes, this is a good long term approach in regard to compatibility, maintenance, and control.
    Answer 2: Yes, as of TestStand 4.0 this is expected behavior, as the programmatic reordering of prototypes is not a supported code generation teqnique.
    Answer 3: In short, yes you much open and save every sequence that contains your new CST. Be sure to save your step type first, making sure to increment your version number. This method will ensure that the step type conflict is automatically resolved in files that load this new type. If you forget to increment your version number you will have to manually resolve this conflict.
    Thanks
    Evan Prothro
    RF Systems Engineer | NI

  • How to import custom java jar/class into oracle to be used in java proc ?

    Hi
    I would like to know how to import custom java jar/class files into oracle to be used in java stored procedure.
    I am developing a oracle pl/sql procedure to call java program. The java program will be created as procedure and will be published.
    But, my question is that I do have a other external jar/class file that need to be imported into this java program.
    example
    raise_sal.java
    import java.util.*;
    import oracle.sql.*;
    <<reference other java programs >>
    import cmpmsgsvc.xxxx.* ;
    import cmpmsgsvc.yyyy.* ;
    import cmpmsgsvc.zzzz.* ;
    how do I import the cmpmsgsvc jar/class file into oracle so that I don't have any
    compilation errros on raise_sal.java program ??
    what are the steps to import/compile and validate to do this?
    thanks for your help in advance.
    Thanks
    rrb.

    Kuassi
    Problem is that, I have 6 jar files that are needed to be included in the main java program. And, there are more than 50+ classes, propertiers in those 6 jar files.
    It might be not good idea to have all those 50+ classes in the production database.
    Is there anyway that I keep all those 6 jar files in unix box (our's is oracle erp installation with oracle being installed on unix box) and just refer them in the main java program. I mean database will be loaded with main java program and it should able to refer other 6 jar files from unix.
    if we create a directory and keep all jar files in there and include that directory in classpath variable, does this works? or what is other method?
    Please let me know.
    Thanks

Maybe you are looking for

  • How to delete or add parameters in the list.

    hi, can someone please tell me how to delete/ add parameters (the parameter list that is displayed in the Address Node). actually in my application i have to similar scripts. so i if can copy the whole script and make some changes in the list of para

  • Error message on ipod

    I just received my older ipod touch back after sending it to apple for a new battery.  After connecting it to itunes it came up with an error message that says an error occurred while restoring this ipod oxe8004006.  What does this mean?

  • Big iphone problem, please help

    I was using the internet on my phone today and the iphone suddenly froze, i couldn't move the screen around and i could not use the sleep button to turn off the screen, or reset the phone. eventually the backlight dimmed, and the screen went black. I

  • Enterprise multiserver option missing during install

    Hello, I've been asked to install Coldfusion 10 Enterprise on a server. We have a Coldfusion 10 Enterprise upgrade key. I'm having a hard time to find a place at adobe.com to downlaod the install file. Finally I downloaded the trial, hoping it would

  • Formatting Issue When Exporting Podcast/Blog

    Has anyone experienced this: You add a blog entry or podcast entry and the new entry has nothing but a white background and text. It doesn't follow the template to the rest of the site. thanks!