SOAP APIs needed to extract SOAP request arguments for message handler implementation

1. I am facing problem in using the Message Handler approach for the implementation
of webservices using SOAP on BEA weblogic 8.1. A SOAP request(XML format) can
be interrupted using the message handler and hence can be modified before it invokes
the webservice method. I have been able to successfully extract the SOAP Name
space xml format as a part of the SOAP request using the APIs given below
APIs:
SOAPBody body = env.getBody();
Name Spaces format:
<m:sayHello xmlns:m="http://www.bea.com/servers/wls70/samples/examples/webservices/basic/statelessSession">
<intVal xsi:type="xsd:int">100</intVal>
<string xsi:type="xsd:string">vikas</string>
</m:sayHello>
The above is a Hello world example which invokes the sayHello method with arguments
as an integer and a string. I have not been able to find the SOAP APIs to extract
these arguments from the SOAP Body.
2. But there are XML apis which can extract the tag data from the SOAPBody e.g
NodeList nl = body.getChildNodes();
for(int i = 0; i < nl.getLength(); i++)
Node node = (Node)nl.item(i);
if(node instanceof SOAPElement){
SOAPElement se = (SOAPElement)node;
String operationName = se.getLocalName();
String value = se.getValue();
The SOAPBody interface implements the following interfaces (Ref : http://java.sun.com/j2ee/1.4/docs/api/index.html
javax.xml.soap > SOAPBody )javax.xml.soap.Node, javax.xml.soap.SOAPElement(SOAP APIs)
org.w3c.dom.Node, org.w3c.dom.Element (XML Parser APis)
3. But webservice implementation of Weblogic Application server 8.1(webservice.jar)
doesn't support the XML parser APIs and only supports the SOAP APIs.
i.e. The SOAPBody Interface of Weblogic Application Server only implements the
javax.xml.soap.Node, javax.xml.soap.SOAPElement (SOAP APIs) and not the XML APIs
(org.w3c.dom.Node, org.w3c.dom.Element)
So the code snippet written as a part of point 2 will not be compiled(give compilation
error) using the webservice.jar of Weblogic 8.1.
4. I have tried to compile the same code using the saaj-1_2-fr-api.jar (SOAP 1.2
apis jar) which I have downloaded from java.sun site. And the code got successfully
compiled.
In this latest version of SOAP APIs jar the SOAPBody interface implements both
the SOAP as well as XML parser Apis.
5. I was not able to run this code on the Weblogic server , bcoz at the runtime
weblogic 8.1 is using its webservice.jar instead of saaj-1_2-fr-api.jar. And
this code was giving me runtime error as
java.lang.NoSuchMethodError: javax.xml.soap.SOAPBody.getChildNodes()Lorg/w3c/dom/NodeList;
(see Fault Detail for stacktrace)</faultstring>
So now I need to find out the version of the webservice.jar of Weblogic 8.1 which
supports SOAP Apis as well as XML parser apis.
Otherwise I have to find out the SOAP apis which can extract the tag data from
the SOAP body.
Please Help.

You can use the SAAJ APIs to get the child nodes.
Example here:
http://manojc.com/tutorial/sample4/ServerHandler.java
so instead of using body.getChildNodes(), you have to use
body.getChildElements() which returns an iterator of SOAPElements.
Regards,
-manoj
http://manojc.com
"Vikas Garg" <[email protected]> wrote in message
news:40dfb5e0$1@mktnews1...
>
1. I am facing problem in using the Message Handler approach for theimplementation
of webservices using SOAP on BEA weblogic 8.1. A SOAP request(XML format)can
be interrupted using the message handler and hence can be modified beforeit invokes
the webservice method. I have been able to successfully extract the SOAPName
space xml format as a part of the SOAP request using the APIs given below
APIs:
SOAPBody body = env.getBody();
Name Spaces format:
<m:sayHelloxmlns:m="http://www.bea.com/servers/wls70/samples/examples/webservices/basic
/statelessSession">
<intVal xsi:type="xsd:int">100</intVal>
<string xsi:type="xsd:string">vikas</string>
</m:sayHello>
The above is a Hello world example which invokes the sayHello method witharguments
as an integer and a string. I have not been able to find the SOAP APIs toextract
these arguments from the SOAP Body.
2. But there are XML apis which can extract the tag data from the SOAPBodye.g
>
NodeList nl = body.getChildNodes();
for(int i = 0; i < nl.getLength(); i++)
Node node = (Node)nl.item(i);
if(node instanceof SOAPElement){
SOAPElement se = (SOAPElement)node;
String operationName = se.getLocalName();
String value = se.getValue();
The SOAPBody interface implements the following interfaces (Ref :http://java.sun.com/j2ee/1.4/docs/api/index.html
javax.xml.soap > SOAPBody )javax.xml.soap.Node, javax.xml.soap.SOAPElement(SOAP APIs)
org.w3c.dom.Node, org.w3c.dom.Element (XML Parser APis)
3. But webservice implementation of Weblogic Application server8.1(webservice.jar)
doesn't support the XML parser APIs and only supports the SOAP APIs.
i.e. The SOAPBody Interface of Weblogic Application Server only implementsthe
javax.xml.soap.Node, javax.xml.soap.SOAPElement (SOAP APIs) and not theXML APIs
(org.w3c.dom.Node, org.w3c.dom.Element)
So the code snippet written as a part of point 2 will not be compiled(givecompilation
error) using the webservice.jar of Weblogic 8.1.
4. I have tried to compile the same code using the saaj-1_2-fr-api.jar(SOAP 1.2
apis jar) which I have downloaded from java.sun site. And the code gotsuccessfully
compiled.
In this latest version of SOAP APIs jar the SOAPBody interface implementsboth
the SOAP as well as XML parser Apis.
5. I was not able to run this code on the Weblogic server , bcoz at theruntime
weblogic 8.1 is using its webservice.jar instead of saaj-1_2-fr-api.jar.And
this code was giving me runtime error as
java.lang.NoSuchMethodError:javax.xml.soap.SOAPBody.getChildNodes()Lorg/w3c/dom/NodeList;
(see Fault Detail for stacktrace)</faultstring>
So now I need to find out the version of the webservice.jar of Weblogic8.1 which
supports SOAP Apis as well as XML parser apis.
Otherwise I have to find out the SOAP apis which can extract the tag datafrom
the SOAP body.
Please Help.

Similar Messages

  • SOAP request and response message

    Hi,everyone:
    I am working on one jaxrpc project.
    I would like to get a concrete SOAP request and response message.
    Do somebody know how and where i can get these two message?
    thanks in advance
    Hui
    [email protected]

    I am also interested in the sample. Please post, any examples, I just finished the tutorial looking for further resources too.
    R

  • Request focus for message area

    Dear All,
    As my screen is long hence if an error comes we will require to scroll down so I have added a message area UI element and in do modify method of the view i have request focus to my message area but it is not working.  Below is the code which I have written:
    try{
              IWDMessageArea msgarea=(MessageArea)view.getElement("MessageArea");
            msgarea.requestFocus();
            catch(Exception e)
    Is there any other property or changes need to be made.
    Thankyou.
    Regards,
    Santosh

    Hi,
    In would say, create an input field at the top left corner of the screen. Set its width to zero and bind it to a context attribute say Va_ShowMesg of type string. Now insert a MessageArea UI element just below the inputfield to display all the erro message at the top left.
    Now if you request focus for the input field using the following code, the focus will automatically come to the Message Area as well.
    wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute(
              wdContext.currentContextElement().VA__SHOW_MESG));
    You can call this code whenever you need to display message to user in the message area and shift focus of the screen to the message displayed.
    Regards,
    Tushar Sinha

  • SOAP requests hang for 5 minutes. Why?

    As a first step in using the SOAP features integrated in Java 6 I went through the JAX-WS 2.0 tutorial at http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/.
    I created the simple webservice as well as the client (I am not using the Netbeans IDE but I did the corresponding in my IDE).
    I started the service in a local VM and started the local client application as well.
    What's really odd is: the service and the client worked on first attempt (and I verified this by inserting println statements into the code), but the return of the result always hangs for pretty exactly 5 minutes (by when - I guess - some timeout strikes).
    I.e. the client issues the request and the server-side gets called practically immediately, but the result is passed back to the client only 5 minutes later.
    At first I had thought, that things didn't work, but when I got distracted and later returned to my screen I found, that my WebService requests had actually worked as designed.
    But why does the return of the response take 5 minutes? Any ideas, anybody?
    Michael

    I've seen similar behavior, but not on every invocation. In my case:
    1) Nightly backups were starting at 5:30PM every day - every request then timed out;
    2) Our development servers were virtual machines - they were often slow to wake up.
    Otherwise, the web services responded normally.

  • Need Help with command line arguments for a class method

    Hey guys,
    I'm fairly new to programming in java.
    I want to a write a class method that adds up its command line arguments which are numbers. For example, if the input was .... 5 2 3....then the output would be 10.
    I have been told to use the Convert to convert a string to a double. I'm ok for writing the class method but I have no idea how to use Convert and why I need it in the method.
    Can anybody help please?

    Hey guys,
    I'm fairly new to programming in java.
    I want to a write a class method that adds up its
    command line arguments which are numbers. For
    example, if the input was .... 5 2 3....then the
    output would be 10.Okay. So you would receive the numbers to add as the String[] argument to a main method. The steps are simple:
    1) declare a variable for the count
    2) for each String in the array:
    2.1) extract the value as a double
    2.2) add this to the count
    3) output the resulting count
    I have been told to use the Convert to convert a
    string to a double.
    I'm ok for writing the class
    method but I have no idea how to use ConvertThere is no class Convert in the Java API.
    and why
    I need it in the method. Do you understand you need to somehow convert each String to a double (step 2.1)? Since Convert is unknown to me, maybe you should just take a look at class Double. It can help you do step 2.1, the rest should be trivial enough.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Double.html
    Give it a go and feel free to post back with a specific problem you are having, accurately described if you please :-)

  • Which is the better format for message handling - flat files or SOAP?

    We have the possibility to specify from our EDI partner how to send messages into XI. We can ask them to send the messages in as SOAP or flat files.
    Is there a definite preference for one format over the other? Can somebody advise with reasons?
    BR,
    Tony.

    >>We have the possibility to specify from our EDI partner how to send messages into XI. We can ask them to send the messages in as SOAP or flat files.
    I would strongly suggest you go with SOAP rather than File.
    Reason : In case of file, the EDI partner will send a file to a machine in your network where FTP server is running and you make your XI server poll the particular folder every 10 min or so. But in case of SOAP, the <b>communication is real time</b>. Your EDI partner can invoke either the SOAP adapter directly or send a SOAP msg directly to Integration Server.
    Just my ideas.
    Regards,
    Jai Shankar

  • Need to extract only decimal numbers for a glob of text [SOLVED]

    If you have a look at /dev/zero's thread here, you'll see that users have been posting the output of his script which are numbers that range from 2 to 5 decimal places.  If I dump this entire thread to txt file, how can I:
    1) Delete everything except for numbers of the following formats (where 'x' is a digit and '.' is a decimal point)?
    2) Format the output to be one target per line?
    x.xx
    x.xxx
    x.xxxx
    x.xxxxx
    xx.xx
    xx.xxx
    xx.xxxx
    xx.xxxxx
    I have experimented with some sed strings but am not making any traction.  Perhaps your perl or awk ninjas have a good solution?
    Here is the source file which was generated from a copy/paste of that thread into an empty text file: http://pastebin.com/ZkRFhFAr
    Last edited by graysky (2012-12-21 11:19:05)

    Ooh, a challenge...
    * 1 hour later *
    #!/usr/bin/perl -an
    @ary = grep /^\d{1,2}\.\d{2,5}$/, @F;
    print join("\n", @ary) . "\n" if @ary;
    Run as ./script.pl unixness_thread.txt
    Not perfect, it grabs 10.04 which is an Ubuntu version in context, and 4.10 which is an Xfce version... but not too far off. Stick a "sort -n" on the end and knock off the obvious outliers and you'll be half there.
    Edit -- just noticed it skips at least one number in parentheses: (8.73086). Was thinking the default splitting behavior would not be a problem but I was wrong. Not sure how to fix this but I think it can be done with -F.
    Edit again -- changing the shebang as follows seems to work:
    #!/usr/bin/perl -an -F/[^\d\.]/
    Last edited by Trent (2012-12-21 01:55:08)

  • Need to Extract Image from Database for Report

    Greetings,
    I have two databases that I could work with; both are for card access users.  One is an old Access 98 database, the other is a SQL database,
    In the tables I can "see" references to employee_photo and badge_picture_path respectively, but when I run the Report, the Image is not retrieved.
    Any ideas how I can overcome this ?
    I am trying to create a hard copy in a binder, so that new guards can thumb through the binder and familiarize themselves with employees.
    Thanks
    Peter

    Hi Peter,
    What format are the pcitures saved in.  I believe they have to be either BMP or JPEG.  Any other formats will not work in Crystal. 
    Have a look with the sample Extreme database.  The Employee table has a picture field, very similar to what you are using.  If you create a simple report with it, can you see the pictures? 
    Thanks,
    Brian

  • Web Service Options - Editing SOAP request Options

    I am trying to invoke a Web Service using Adobe LiveCycle ->
    Foundation -> Web Service.
    In the Web Service Options editor, while giving the SOAP request, I
    would want to be able to manipulate the data I send in the SOAP
    request.
    For example, I have a input Request XML which is in process_data [and
    which is the incoming request from Flex]. I am reading data from that
    XML and setting it to a corresponding tag in the SOAP request. I want
    to be able to have this feature wherein I dont include a tag at all in
    the SOAP request of I see that the corresponding tag in Request XML is
    empty.
    So if there is a  tag in Request [empty tag], I dont
    want to include the ContactName tag at all in the SOAP request.
    Meaning, I dont want to send an empty tag or a tag with NULL value. I
    want to delete that tag altogether in the SOAP request.
    Any ideas how I can go about this?
    Thanks!

    You can try making the whole SOAP Request a varibale of type XML. Then use a setValue before the web service call and built it the way you want.
    Jasmin

  • What is needed on non-weblogic client to make soap request

    Hi, I am trying to make a soap request from a client that is not weblogic to a
    weblogic6.1 server. I was under the impression that all I needed was the client.jar
    created by wsgen. But when I try to access the service through the client I get
    the below exception. It appears to be trying to access a weblogic class that is
    not contained in the client.jar. Does this mean I also need to include the weblogic.jar
    on the client(I'm hoping not to). Thanks
    java.lang.NoClassDefFoundError: weblogic/net/http/HttpsURLConnection
         at weblogic.soap.http.SoapContext.lookup(SoapContext.java:87)
         at javax.naming.InitialContext.lookup(InitialContext.java:350)
         at index_1._jspService(index_1.java:68)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:484)

    Hi Jane,
    Looks like you have run smack dab into one of the first "myths" about web services
    - "SOAP client software is not vendor- dependent" :-) This is in fact, exactly
    the opposite! And it's not just WebLogic's SOAP client API that has this "vendor-dependent"
    code. Apache SOAP, Apache AXIS, Systinet WASP, GLUE, etc. exhibit the same behavior.
    The difference is that WebLogic's client.jar, is not really a "standalone, SOAP
    client package". It's a "web service-specific" client package.
    JAX-RPC (and the other APIs in the Java Web Services Developer's Pack) is attempting
    to reduce a fair amount of this "vendor-dependency", but there will always be
    some :-) WLS 6.1 doesn't use JAX-RPC, so...
    Anyway, how many "vendor classes" you need, depends on what you are attempting
    to do in the client. If you are just consuming a web service that uses "SOAP encoding",
    then you'll need less. If you are consuming a web service that uses "literal encoding",
    you'll need more. An easy (albeit time consuming) way to figure out which classes
    you need from the weblogic.jar file, to use WebLogic's Web Service client package
    inside Tomcat, is to use the "-verbose:class" option, on the Java command used
    to start Tomcat. This will produce a lot of output, so I suggest you capture it
    to a log, instead of sending it to stdout :-) But, as I said, this is a very,
    very, very time consuming way to determine all the classes you need from the weblogic.jar
    file. Trust me, I've done this before and it took me about 3 hours to find every
    class that's needed! It's simpler just to include the weblogic.jar file in the
    CLASSPATH you start Tomcat with :-)
    Another option is to just use the Apache SOAP package to create the web service
    client. This works wonderfully, if you don't want to use WSDL (Apache SOAP doesn't
    support WSDL). If you want to use WSDL, go with the Apache AXIS package. It has
    an implementation of JAX-RPC, and is pretty close to the Web Services implementation
    in WLS 7.0 (which I'm assuming you'll eventually upgrade to anyway, right?).
    Regards,
    Mike Wooten
    "Jane" <[email protected]> wrote:
    >
    Hi, I am trying to make a soap request from a client that is not weblogic
    to a
    weblogic6.1 server. I was under the impression that all I needed was
    the client.jar
    created by wsgen. But when I try to access the service through the client
    I get
    the below exception. It appears to be trying to access a weblogic class
    that is
    not contained in the client.jar. Does this mean I also need to include
    the weblogic.jar
    on the client(I'm hoping not to). Thanks
    java.lang.NoClassDefFoundError: weblogic/net/http/HttpsURLConnection
         at weblogic.soap.http.SoapContext.lookup(SoapContext.java:87)
         at javax.naming.InitialContext.lookup(InitialContext.java:350)
         at index_1._jspService(index_1.java:68)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
         at org.apache.tomcat.core.Handler.service(Handler.java:235)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
         at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
         at java.lang.Thread.run(Thread.java:484)

  • Sample SOAP request for Data Loader API

    Hi
    Can anyone please help me out in giving a sample SOAP request for Data Loader API .This is to say import 1K records from my system to the CRM instance I have .

    Log into the application and then click on Training and Support there is a WS Library of Information within the application

  • Need to get SOAP request and SOAP response message.

    Hi All,
    I need to know that how can I get the SOAP request and SOAP response message. Now I am using WSDL2Java tool from Axis to generate the stub classes (such as ServiceLocator, SoapBindingStub, and soapPort ) and applying the classes to make the SOAP request. I have seen the solution for getting the SOAP request with Dynamic invocation interface (DII) style (http://mail-archives.apache.org/mod_mbox/ws-soap-user/200310.mbox/%[email protected]%3e), but not Static stub like what I did. Could anyone suggest me how to do it please ( I can't run tcpcom on the linux server, because x-window is not allowed to install ). Thank you for any help in advance.

    You can try writing a client-side handler.
    Handler gets called before the actual request is sent, and you can get the SOAP
    message in it.
    You have to deploy the handler in client-config.wsdd.
    Handler is just like Servlet Filter.
    I think there might be a simpler solution, but I dont know.

  • Need help to get JSESSION cookie after making a SOAP request.

    Hello All,
    I need to know that how can I check JSESSION cookie, and get its value after sending a SOAP request. I need this JSESSION value to present in each HTTP stream until it expired. One more question, can I log HTTP request and response by configuring the client-config.wsdd or not. If yes, could any one let me know how to do it please. Thank you in advance.

    Turn the machine on it's side and try shaking them out. You can also see if You Tube has any videos on how to do this, they certainly do for folks that have SD cards in theirs. Removing coins should be similar.

  • Web Service Call From Proxy Client in ABAP: View SOAP Request

    Hello All,
    We are working on a scenario where we have to connect to a web service from ABAP. We have extracted the WSDL, and generated the client proxy, and configured a Logical Port. However, at the time of actual call, we receive an error message "Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.". We suspect that this is a problem with the SOAP Header, which might be missing some tags, which are required by the Web Service. Problem is, we can not trace the Web Service SOAP Header. We can not see it in SOAMANAGER, or any other transaction as such. Does any body have an idea where to look for the complete SOAP Request, in case of a Client Proxy call?
    Thanks and Regards,
    Sid

    Hello Sebastian,
    Thanks for replying. We are using a higher support pack level, and hence we do not use LPCONFIG; rather we use SOAMANAGER to manage the web service logical ports. Further, SMICM would display us ICM Logs, where as we need the exact SOAP request that has been generated. We tried ST11 with no luck.
    Finally, I feel this is a wrong forum to ask such an application related question. I will close this thread and open a new thread in either PI or ABAP Forum.
    Thanks and Regards,
    Sid

  • SOAP HTTP header in SOAP request

    Hi,
    How to add the soap HTTP additional header in the SOAP request?
    I want to add the headers not through coding. I want to add it manually.
    I can able to add the HTTP headers through SOAPUI. But i need to add the same inside the request.
    Could someone please help me?

    I am sending the SOAP request through SoapUI.
    Here is the sample request which i have used.
    <?xml version="1.0"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://requisition.api.newscale.com">
    <soapenv:Header>
    <req:AuthenticationToken>
    <req:Username>***</req:Username>
    <req:Password>***</req:Password>
    </req:AuthenticationToken>
    </soapenv:Header>
    <soapenv:Body>
    <req:getRequisitionStatus>
    <req:loginUserName>***</req:loginUserName>
    <req:requisitionId>123456</req:requisitionId>
    </req:getRequisitionStatus>
    </soapenv:Body>
    </soapenv:Envelope>
    Here i have to add the additional HTTP header with this request.

Maybe you are looking for

  • Forms 4.5 fmb's cannot be opened in 6i

    I got 100 Forms4.5 fmb's and cannot open them on my Windows XP Forms 6i notebook... Error: Cannot open file, when doubleclicking in the Open-File Dialog. I thought Forms 6i can open 4.5, 5.0 and 6.0 files ?

  • P13n Issue in Weblogic 10

    Hi, Currently, while trying to publishing an EAR Project on the server, we are getting the following exception- Module named 'EAR Project Name' failed to deploy. weblogic.application.WrappedDeploymentException: com/bea/p13n/property/EntityPropertyMan

  • Installed LR4.3 but 4.2 continues to load

    I've tried the install multiple times.  I'm currently using a mac running osx 10.6.8.  4.2 will start up when I click on the LR icon but there is no GH3 support.  Any thoughts?  Thanks.

  • Route value is not changing for item level in VA02 when we change shipping

    Hi experts, I was facing a problem in VA02. When we change shipping condition type in header level, the item level route data has to be changed. But in  my case it is not happening. This is happening for only one line item and rest of the line items

  • Need help for data extraction from table

    Hi all, i have a requirement where i need to identify fields PERNR,BEGDA,ENDDA,REASN,fmlan in table PA0672 .If all these field are identical for an employee in more than one record, then greatest value of REMAN field out of these records should be di