Modify SOAP message

Is there any tool which can help me to modify the SOAP response before sending back to the client. I have used tools like tcpmon which just shows the traffic, but I can't modify the message with this.
Thanks
Sanat

forumKid2 wrote:
user575089 wrote:
Can a JAX-WS handler alter SOAP message ? In other words, can we modify the SOAP message using JAX-WS handler ?
Yes.
Thanks

Similar Messages

  • JCAPS 5.12 - modifying SOAP header for webservice Invocation

    I am trying to call an external web service from JCAPS 5.1.2 and need to set a token in the SOAP header. I am able to do this in other client implementations, however, the methods to modify the header don't seem to be exposed within JCAPS 5.1.2 or I do not know how to find the methods.
    Has anyone tried this before?

    Hi Experts,
    I'm trying to protect a web service deployed in jcaps 5.1.1, using SAML assertions against an Access Manager 7/7.1, the web services clients are both, web and standalone applications, I also have read netbeans tutorials, that expose how to implement identity webservices using AppServer 9.1 + AccessManager 7.1 using the SAML Holder of key and other security mechanisms, but this implementation requiere modifications to the server.policy file to add support to SOAP message security providers and HttpServlet message security providers, the addition of a library called amwebservicesprovider.jar to the classpath suffix (this library implements the jsr-196 java Authentication Service Provider Interface for Containers) and aditional configuration required in the AM side that is not detailed in the tutorials.
    Could someone guide me on how to protect the acces to a web services deployed in the jcaps logicalhost based on AM roles assigned to users?
    Any help is aprecciated
    Juan

  • Attaching Header to SOAP Message

    Hi Guys,
    Can anybody tell me how to attach the Header to the message body in case of SOAP messages?
    My SOAP Message is as follows( in XML format):
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p1="http://sup/bpmscenarios">
      <soap:Body>
        <p1:mt_source_SOAP>
          <row>
            <EmpNo>10</EmpNo>
          </row>
        </p1:mt_source_SOAP>
      </soap:Body>
    </soap:Envelope>
    And SOAP action is :
    http://sap.com/xi/WebService/soap1.1
    Regards,
    Supriya.

    Hi,
    My client is Altova XML Spy, is sending the message without header.
    So, at PI end message is getting failed.
    I want to send the message by Altova only, so want to modify the message by adding header to it.
    But I am not able to understand how to add header.
    Regards,
    Supriya.

  • Monitoring SOAP messages with JWSDP?

    Hi!
    Is it possible to monitor SOAP messages generated from the JWSDP during the connection between a client and the Web Service?
    Thank you.

    A useful standalone tool is TcpTrace (http://www.pocketsoap.com/tcptrace/)
    This is a windows program and I have found it very useful.
    The easiest way I have found to use it with JWSDP is to modify the tomcat port in JWSDP_HOME\conf\server.xml, and then configure TcpTrace to listen on the original tomcat port value, and forward to the new one.
    But if you do this, TcpTrace must be running whenever you attempt to install or modify anything which requires contacting the tomcat server.
    //Daniel.

  • Client intercept SOAP message

    We are developing a client application which accesses Web Services. I have been told to log all and every SOAP message it sends or receives.
    My client connects the Web Service through an static proxy we created using WSDL2Java(Axis). How could I get the SOAP messages (in the client side)?
    At this point we can't change the JAX-RPC client to pure SOAP nor the static proxy to a dynamic one (the application is almost finished and we are a bit short in time).
    We have been searching (google) and I have found this:
    http://e-docs.bea.com/wls/docs81/webserv/interceptors.html
    It says it is possible to do what I need by using a javax.xml.rpc.handler.Handler implementation class, but when I have tried to add the handler to the Web Service client it plainly ignores my handler.
    Does anybody know how to specify a handler to "intercept" the incoming server SOAP messages? (The server is a 3rd party (so we have no access at all to its source code)).
    This is my handler:
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    public class MyHandler implements Handler{
    private HandlerInfo handlerInfo;
    public MyHandler() {
         super();
    public boolean handleRequest(MessageContext arg0) {
         SOAPMessageContext messageContext = (SOAPMessageContext) arg0;
         System.out.println("** Request: "+messageContext.getMessage().toString());
         return true;
    public boolean handleResponse(MessageContext arg0) {
         SOAPMessageContext messageContext = (SOAPMessageContext) arg0;
         System.out.println("** Response: "+messageContext.getMessage().toString());
         return true;
    public boolean handleFault(MessageContext arg0) {
         SOAPMessageContext messageContext = (SOAPMessageContext) arg0;
         System.out.println("** Fault: "+messageContext.getMessage().toString());
         return true;
    public void init(HandlerInfo arg0) {
         this.handlerInfo = arg0;
    public void destroy() {
    public QName[] getHeaders() {
         return handlerInfo.getHeaders();
    I try to add it to the Web Service client by doing this:
    ServiceServiceLocator locator = new ServiceServiceLocator();
    try {
    Service port = locator.getws();
    // To obtain the SOAP messages
    QName portName = new QName( "http://endpoint_WS", "wsHello");
    HandlerRegistry registry = locator.getHandlerRegistry();
    List handlerList = new ArrayList();
    handlerList.add( new HandlerInfo( MyHandler.class, null, null ) );
    registry.setHandlerChain( portName, handlerList );
    port.sayHelloTo("Peter");
    Anybody knows where am I mistaken?
    I am trying to avoid modifying the generated client (static) proxy, the Web Service is still in development and it would mean I would have to edit it always they change the Web Service (leading to a lot of wasted work).

    I managed to intercept messages SOAP without proxy, but I do not obtain it with proxy (JAX-RPC or Axis)
    Any Suggest?
    Thank you.

  • Writting attached file from SOAP message to a FTP folder

    Hi everybody,
    Our scenario is an interface which receives a SOAP message with a file attached. As we don't need to do any mapping into the attachment, we are supposed to deliver that file as it is into a FTP folder.
    Our problem is that we cannot find how to configure File comm channel to write the attached file and no the SOAP XML message which is what we are getting now. Any help on this?
    Thanks in advance.

    Hi
    check these forum posts
    SOAP with attachments
    Mail Sender Adapter - Attachment Handling
    Regards
    Vishnu

  • Unable to open PWA in browser and MSP on application server in project server 2007. ERROR: Sending the Soap message failed or no recognizable response was received.

    Hi All,
    I am using project server 2007 and WSS 3.0. 
    I have been facing a strange issue for couple of days. I am unable to open PWA in browser and MS Project Pro on application server.
    Everything is correct whether it is URL or MS Project profile account on MSP.  This is strange because i can open same PWA/MSP from other computers (Database server / Client PCs) but not locally on server.
    When i try to connect to MSP on App server, i get the following errors in event viewer.
    Event Type: Error
    Event Source: MSSOAP
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description:
    Soap error: Connection time out..
    Event Type: Error
    Event Source: MSSOAP
    Event Category: Client 
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description:
    Soap error: An unanticipated error occurred during the processing of this request..
    Event Type: Error
    Event Source: MSSOAP
    Event Category: Client 
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description: Soap error: Sending the Soap message failed or no recognizable response was received.
    Event Type: Error
    Event Source: MSSOAP
    Event Category: Client 
    Event ID: 16
    User: N/A
    Computer: APP-Server-Name
    Description:
    Soap error: Unspecified client error..
    One more issue i am facing and i guess that is related to above issue. The Issue is, when i am creating a new project, It's workspace gets created but doesn't get linked to the project and i can't link it manually because it already exists for the project.
    sandeep

    Hi Paul ,
    Thanks for reply. The project server URL was already added to the Trusted
    Sites/Local Intranet areas in IE. 
    sandeep

  • How to get full SOAP message in WebService

    hi,
    Is it possible to get SOAP message while Request operation during transaction in WebService.
    I tried with Handler, while retreiving message it is having a MessageContext. How to initilize that like example
    public boolean handleRequest(MessageContext mc) {
              SOAPMessageContext messageContext = (SOAPMessageContext) mc; 
              System.out.println("** Request: "+ messageContext.getMessage().toString());
              return true;
         }while i make a class called SoapHdlr i have implemented all methods including the above.
    In that from my class if i want to call the above method i need to pass MessageContext how to give that MessageContext or any other ways to get SOAPMessage fully.
    plz can any one guide me there
    ThanKQ

    I think, there are some concepts missunderstood. First if you use JAX-WS- Metro framework, this kind of handlers will work. Also you should identify your SOAPHandler for your web service. For ex: in Netbeans 6, you can right click on service and select configure handlers. Then you decide your handler.
    Then automatically, Metro framework directs SOAPMessages to your SOAPHandler to handle full SOAPs. HandleMessage() method will work.
    If you have problem again, just ask.

  • Trying to parse a Soap Message

    I'm working on creating webservices that will be consumed by
    Director and working with the client programmer, we've come to
    recognize the problem, but we don't know how to resolve it.
    Problem: the XMLParser doesn't follow href parameters in tags
    that refer to subobjects, which result in a #getProp Ref error.
    I have a web service method that will return a list of names
    and it returns the following XML response:
    &lt;?xml version=&quot;1.0&quot;
    encoding=&quot;UTF-8&quot; ?&gt;
    &lt;soapenv:Envelope xmlns:soapenv=&quot;
    http://schemas.xmlsoap.org/soap/envelope/&quot;
    xmlns:xsd=&quot;
    http://www.w3.org/2001/XMLSchema&quot;
    xmlns:xsi=&quot;
    http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    &lt;soapenv:Body&gt;
    &lt;getStudentsResponse soapenv:encodingStyle=&quot;
    http://schemas.xmlsoap.org/soap/encoding/&quot;&gt;
    &lt;getStudentsReturn href=&quot;#id0&quot;
    /&gt;
    &lt;/getStudentsResponse&gt;
    &lt;multiRef id=&quot;id0&quot;
    soapenc:root=&quot;0&quot; soapenv:encodingStyle=&quot;
    http://schemas.xmlsoap.org/soap/encoding/&quot;
    soapenc:arrayType=&quot;xsd:anyType[6]&quot;
    xsi:type=&quot;soapenc:Array&quot; xmlns:soapenc=&quot;
    http://schemas.xmlsoap.org/soap/encoding/&quot;&gt;
    &lt;multiRef
    xsi:type=&quot;soapenc:string&quot;&gt;Bob B
    Bobbly&lt;/multiRef&gt;
    &lt;multiRef
    xsi:type=&quot;soapenc:string&quot;&gt;Andy A
    Anderson&lt;/multiRef&gt;
    &lt;multiRef
    xsi:type=&quot;soapenc:string&quot;&gt;Carl C
    Carlson&lt;/multiRef&gt;
    &lt;/multiRef&gt;
    &lt;/soapenv:Body&gt;
    &lt;/soapenv:Envelope&gt;
    When it hits the getStudentsReturn element and tries to refer
    to a child node, and obviously fails.
    The server is Tomcat 5.5, using Axis 1.4 for web services. I
    can post a wsdl if desired.
    The web service is configured for rpc/encoded style.
    What is the way to get out of this particular jam? Neither me
    nor the client programmer have extensive knowledge of how Director
    (or the relevant Xtra) handles SOAP messages or parse them. I've
    stepped through the code and seen the XML parser object render the
    response into an object tree, but it doesn't respect the href's.
    I can provide follow up to any questions or comments about
    this problem.
    Regards,
    Jeff Vandenberg

    Hi Jeff,
    While I don't have much experience with web services, I'm
    about to
    embark on something that involves extensive use of them, so
    your post
    caught my eye.
    If I understand correctly, the href attribute associated with
    the
    getStudentsReturn node is supposed to "automatically" link to
    the
    following multiRef array. Is that correct?
    Assuming it *did* link correctly, how would this manifest
    itself? Is it
    not a matter of you the parser watching for href tags and
    resolving them
    yourself? Why would you not simply provide the multiRef nodes
    as
    children of the getStudentsReturn node? Is there
    documentation somewhere
    for the href attribute and this form of linking?
    Have you tried using the Flash Asset xtra for parsing, and
    does it
    behave "correctly"?

  • External WebService call from CAF Core returns Invalid soap message

    I am trying to perform the very simple action of calling a WebService from a CAF Core app service.
      1. I imported the WS (Axis Web service running on NW 2004s SP9 server) with WSDL (option 2 on import external service page).
      2. I then assembled the call in an app service method and invoke it.
      3. I made sure to configure the end point for the service and the method using the External Service configuration.
    When I execute the CAF core method using a simple Callable Object test client, I get the following error:
    com.sap.caf.mp.base.exception.EngineException: Invalid soap message received
         at com.sap.caf.mp.core.data.service.manager.wsdl11.SOAPToMessageValueConverter.processComplexTypeMode(SOAPToMessageValueConverter.java:290)
         at com.sap.caf.mp.core.data.service.manager.wsdl11.SOAPToMessageValueConverter.generateComplexTypeValue(SOAPToMessageValueConverter.java:179)
         at
    truncated.
    I have also captured the XML request/reponse trace using tcpmon :
    REQUEST:
    POST /NWTestExpressWAR/services/TestExpressService HTTP/1.1
    Host: 192.168.99.120:8078
    Content-Type: text/xml; charset=UTF-8
    Content-Length: 348
    SOAPAction: http://www.testsys.com/TestExpressService/getAvailableModels
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><ns1:GetAvailableModels xmlns:ns1="http://www.testsys.com/TestExpressService"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
    RESPONSE:
    HTTP/1.1 200 OK
    Server: SAP J2EE Engine/7.00
    Set-Cookie: saplb_*=(J2EE11743000)11743050; Version=1; Path=/
    Content-Type: text/xml; charset=utf-8
    Date: Mon, 04 Dec 2006 02:19:39 GMT
    Transfer-Encoding: chunked
    Set-Cookie: JSESSIONID=(J2EE11743000)ID1261187150DB11296929644926762709End; Version=1; Domain=192.168.99.120; Path=/
    1f3
    <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><GetAvailableModelsResponse xmlns="http://www.testsys.com/TestExpressService"><modelNames><name>Great Oak Manufacturing-January03 Test</name><name>PriceCheck-default</name></modelNames><errorMessagesReturn/></GetAvailableModelsResponse></soapenv:Body></soapenv:Envelope>
    0
    The only problem I can think off is that the transfer-encoding is marked as chunked which is causing the characters '1f3' and '0' to appear after and before the response and that this is causing the app to crash.
    192.168.99.120 is the server the hosts the WS. It is also a 2004s SP9 server. The client server that hosts the CAF core service is of the same configuration. 8078 is the port I redirect for tcpmon purposes.
    Could anyone shed some light on my problem?
    Thanks,
    Pratap.

    It looks like NW WS client cannot handle Transfer-encoding of chunked even though this is part of HTTP 1.1. What seems to be happening is that the NW WS client is creating a HTTP 1.1 request. The service (axis ws running on NW) seeing this is creating a HTTP 1.1 response w/ chunked encoding. However, the client cannot handle this encoding and barfs. The solution is to change the service to return a HTTP/1.0 response since NW cant handle HTTP 1.1.
    Pratap.

  • How To : Call External Webservice from BPEL and pass SOAP Message to the WS

    Hello All-
    Greetings to all BPEL gurus. I am currently facing difficulties in calling an External Webservice from my BPEL Process and passing SOAP Message to it. The details are below:
    <strong>1. The BPEL process, using database polling feature of DB Adapter, will get the records from the database.</strong>
    <strong>2. Transform the message</strong>
    <strong>3. Call the External Webservice and pass the transformed message as the input to it. However the Webservice expects the BPEL process to send SOAP headers in the input message.</strong>
    I am struggling on how to put the transformed message within a SOAP envelope in the BPEL process.
    If anyone had similar requirements and have successfully been able to send SOAP messages from BPEL process to an external webservice, kindly let me know.
    Also if there is some kind of documentation or any link in the forum that I can refer, please let me know that as well.
    I am new to Webservice integration using BPEL and would really appreciate your help.
    Thanks In Advance
    Regards,
    Dibya

    Hi Dharmendra,
    I am trying to send a SOAP message from my BPEL process to a web service. I have a complete SOAP message in a complex variable defined in the wsdl for the partnerlink (web service). My problem is that when I invoke the partnerlink it fails even though the content shown in the BPEL console looks valid.
    I have set up obtunnel to see what I am actually sending out from BPEL. You mention that BPEL creates the SOAP envelope automatically.
    I think that my problem is a result of this automatic SOAP envelope that BPEL is creating. Do you know if there is a way to turn it off?
    This is what I see in the TCP monitor, please note the double SOAP env:Body:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <RCMR_IN000002NR01 xmlns="urn:hl7-org:v3" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <env:Header>
    <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://testhost/CCS/Service_Endpoint</wsa:To>
    <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://localhost/CCS/Service_Endpoint</wsa:Address>
    <wsa:Metadata>
    <device xmlns:hl7="urn:hl7-org:v3">
    </device>
    </wsa:Metadata>
    </env:Header>
    <env:Body>
    <RCMR_IN000002NR01>
    </RCMR_IN000002NR01>
    </env:Body>
    </RCMR_IN000002NR01>
    </env:Body>
    </env:Envelope>
    Any help is appreciated.
    Regards,
    Aagaard
    Edited by: Aagaard on Oct 30, 2008 8:59 PM
    Should have mentioned. I am using BPEL 10.1.3.4
    Edited by: Aagaard on Oct 31, 2008 8:43 AM
    I have opened a new thread for this question so as to not confuse the issue more than necessary.
    How many SOAP envelopes do you really need?

  • How to Call web service operation by creating plain SOAP message in client?

    Hi
    Thank you for reading my post.
    I have some questions about using web methods of a web service which i would be very gratfull if you could answer.
    I should implement a web service that should receive a file with some other parameters from client and another web service which should receive some parameters and return a file.
    I used a mechanism like the following one to handle the condition and it just works. But I have a problem, I need to create dynamic invocation and I must create soap message and send it to webservice (no IDE generated code)
    What i need is one or two tips or a sample that shows how we can send and receive files by web services.
    I want to know how we can create the SOAP message ourself and then send it to the web service endpoint and it call the web method and ....
    Imagine the following web method, How i can invoke it by creating soap message myself and sending it to end point.
    @WebMethod
    public String saveFile(@WebParam(name = "fileName") String fileName, @WebParam(name = "fileContent") byte[] fileContent) {
    // TODO implement operation
    return "Something";
    Another question is :
    Does this mechanism that i used to transfer files is OK?
    Is it optimized or there are some other ways to do this job.
    I should say that i put one week on handlers to use soap attachments and i get no result.
    So, Please let me know if you know or have some sample that show me how to do the above job.
    Thanks.

    Hi
    From NW04s SP8 you can create webservice systems from within VC , and you will have the option of adding a user and password to authenticate. You can find it at Tools>>Define web service system. You will see a check box url requires user and password.
    If for some reason you can not do it in VC then you should create the system in the portal and fill out the usermapping screens.
    Jarrod Williams

  • Error while posting SOAP message

    I am trying to post a SOAP message but I keep getting this error. Can anybody help me on this. I tried using ALTOVA spy and SOAP Ui but the result is the same error.
         <SOAP:Body>
              <SOAP:Fault>
                   <faultcode>SOAP:Server</faultcode>
                   <faultstring>Server Error</faultstring>
                   <detail>
                        <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                             <context>XIAdapter</context>
                             <code>ADAPTER.JAVA_EXCEPTION</code>
                             <text><![CDATA[
    com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve binding for the given channelId: Binding:CID=null;
    *     at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBindingByChannelId*(AbstractLookupManager.java:173)
         at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:431)
    Scenario is SOAP Sender and IDOC reciever.

    I tried reconfiguring also.
    When I test from Integration Engine in RWB using the test message it is sucsseful. Infact I can see the IDOC too.
    But when the basis guy tested with Adapter engine in RWB using the test tool, it gives the following error:
    Error While Sending Message: Additional error text from response: com.sap.engine.interfaces.messaging.api.exception.ConfigException: ConfigException in XI protocol handler. Failed to determine a receiver agreement for the given message. Root cause: com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve outbound binding for the given P/S/A values: FP=;TP=;FS=BusComp_Siebel1;TS=;AN=SI_Sales_Order_OB_Async;ANS=http://trm.com:o2b:SalesOrderCreate; in the current context [Unknown].
    Any idea where is the problem.
    When we tried the WSN step we are facing this error in the very first step.
    WSDL1.1, WSDL 2.0 definition element expected. Found [html: null] .
    Edited by: Chandra Gunapati on Oct 7, 2009 10:00 PM

  • Adding PDF file as attachment to SOAP message

    Hi,
    I want to add a pdf file from the hard disk to a soap message as attachment. I have the following code:
    // CREATE MESSAGE
    SOAPMessage msg= fac.createMessage();
    SOAPEnvelope nEnv= msg.getSOAPPart().getEnvelope();      
    //READ FILE FROM THE HD
    String pdfFileName = "somepdffile.pdf";      
    FileReader fr = new FileReader(pdfFileName);
    BufferedReader buffr = new BufferedReader(fr);
    String sPdf="";
    String line = testB.readLine();
    while(line!=null)
    sPdf += line;
    line = testB.readLine();
    //WRITE THE FILE TO BYTE ARRAY AND THEN TO STREAM
    byte[] pdfData = sPdf.getBytes();
    ByteArrayInputStream stream = new ByteArrayInputStream(pdfData);
    //CREATE ATTACHMENT ADD THE STREAM AS CONTENT
    AttachmentPart attPDF = msg.createAttachmentPart();          
    attPDF.setContent(stream, "application/pdf");
    msg.addAttachmentPart(attPDF);          
    return msg;
    I GET THE NEXT EXCEPTION:
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:851)
    at javax.activation.DataHandler.writeTo(DataHandler.java:305)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1089)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:635)
    at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
    at com.sun.xml.messaging.soap.MessageImpl.saveChanges(MessageImpl.java:356)
    at javax.xml.messaging.JAXMServlet.doPost(JAXMServlet.java:192)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
    at java.lang.Thread.run(Thread.java:536)
    javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.messaging.JAXMException: Bad response: (500, Internal Server Error)
    at com.sun.xml.messaging.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:93)
    at mp.soap.SendingServlet.getPolisPrint(SendingServlet.java:320)
    at mp.soap.SendingServlet.doPost(SendingServlet.java:234)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
    at java.lang.Thread.run(Thread.java:536)
    CAN ANYONE TELL ME WHAT THE SOLUTION IS ?
    PLEASE HELP ME !!!
    Birol

    testB == buffr ! Sorry.
    IT IS STILL NOT WORKING !!!!!
    // CREATE MESSAGE
    SOAPMessage msg= fac.createMessage();
    SOAPEnvelope nEnv= msg.getSOAPPart().getEnvelope();
    //READ FILE FROM THE HD
    String pdfFileName = "somepdffile.pdf";
    FileReader fr = new FileReader(pdfFileName);
    BufferedReader buffr = new BufferedReader(fr);
    String sPdf="";
    String line = buffr.readLine();
    while(line!=null)
    sPdf += line;
    line = buffr.readLine();
    //WRITE THE FILE TO BYTE ARRAY AND THEN TO STREAM
    byte[] pdfData = sPdf.getBytes();
    ByteArrayInputStream stream = new ByteArrayInputStream(pdfData);
    //CREATE ATTACHMENT ADD THE STREAM AS CONTENT
    AttachmentPart attPDF = msg.createAttachmentPart();
    attPDF.setContent(stream, "application/pdf");
    msg.addAttachmentPart(attPDF);
    return msg;

  • SAAJServet error when sending a SOAP message on 10.1.2

    Hi,
    We have deployed a server application in OC4J 10.1.2 with a servlet listening for SOAP messages (SAAJ 1.2). If we use Standalone OC4J with SSL enabled and HTTPS communication between client app and server, it works fine, but when we move it to an Application Server environment where client goes HTTPS to the frontend HTTP_Server and then AJP to the OC4J, the following exception appears on the application.log:
    07/03/27 17:48:36 application/gpm-0.1: Servlet error
    javax.servlet.ServletException: SAAJ POST failed Unable to internalize message
    at com.sun.xml.messaging.soap.server.SAAJServlet.doPost(SAAJServlet.java:212)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
    at com.evermind
    Any ideas what can go wrong here, or where else to look?
    Message was edited by:
    [email protected]

    The standalone OC4J is 10.1.3, sorry. Nevertheless, we include all the libraries we use (saaj and dependencies) in the appliaction .ear archive that we deploy in both environments. May be a configuration issue?

Maybe you are looking for