ADDING xml to the SOAP Message from client

Hi, does anyone know how to add an xml file to the SOAP message passed by the client to the server?
I need to send an xml file, I have already tried attachments but they dont meet the purpose. I need to send the xml as part of the soap message in AXIS 1_4.
I read this somewhere about
SOAPEnvelope env = message.getSOAPEnvelope;
env.addBodyElement( new RPCElement("SOAPaccess","webservicename", new
          Object[] { }) );
FileInputStream file = new FileInputStream( "c:\\abcd.xml");
SOAPBodyElement aBody = new SOAPBodyElement( file );
file.close();
env.addBodyElement( aBody );
          However I am not certain how to go about doing this in axis.
I have been trying to find something related to this, but havent been able to.
Please let me know if you know how to add xml file to the body of a SOAP message.

If anyone is interested...I got this working,
//b is the byte form of the xml document.
InputStream is = new ByteArrayInputStream(b);
          Document doc =XMLUtils.newDocument(is);
          SOAPElement me = new MessageElement(doc.getDocumentElement());
          SOAPElement a=message.getSOAPBody().addChildElement(me);
          MessageContext mc=_call.getMessageContext();
          mc.setMessage(message);
          mc.getMessage().getSOAPBody().detachNode();
          SOAPBody sb = (SOAPBody)mc.getMessage().getSOAPPart().getEnvelope().addBody();
          sb.addChild(new MessageElement(doc.getDocumentElement()));
          mc.getMessage().saveChanges();
          System.out.println(mc.getMessage().getSOAPPart().getEnvelope());
          SOAPEnvelope env=(SOAPEnvelope)mc.getMessage().getSOAPPart().getEnvelope();

Similar Messages

  • How to capture the message recived to the soap server from client -onMessag

    Hi,
    I want to send JAXM message from client to server
    and In server print the message to a text file.
    My client
    SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
    SOAPConnection con = scf.createConnection();
    MessageFactory mf = MessageFactory.newInstance();
    SOAPMessage msg = mf.createMessage();
    SOAPPart part = msg.getSOAPPart();
    SOAPEnvelope envelope = part.getEnvelope();
    SOAPBody body = envelope.getBody();
    javax.xml.soap.Name name = envelope.createName("Text");
    javax.xml.soap.SOAPBodyElement bodyElement = body.addBodyElement (name);
    bodyElement.addTextNode ("Some Body text");
    This is the way i'm accessing now in theserver
    public SOAPMessage onMessage(SOAPMessage msg) {
    try {
    FileOutputStream out; // declare a file output object
    PrintStream p;
    out = new FileOutputStream("E:/Accepter.txt");
    p = new PrintStream(out);
    int count = msg.countAttachments();
    p.println("write");
    msg.writeTo(out);
    This creates the text file and write unwanted characters
    1)How do i access the message content and store in a text file or
    String variable??
    2)How do i access the message content in name wise in he case of many messages recived to the server
    Thanks for your time .
    suda

    * To save a message to a file.
    File file = new File("file.xml");
    msg.writeTo(new FileOutputStream(file));
    * To recreate a message (without attachments) from a file.
    MessageFactory mfactory = MessageFactory.newInstance();
    SOAPMessage msg = mfactory.createMessage();
    SOAPPart part = msg.getSOAPPart();
    StreamSource streamSource =
    new StreamSource(
    new FileInputStream("file.xml"));
    part.setContent(streamSource);
    // to view the recreated message
    msg.writeTo(System.out);
    * You should also be able to use DOMSource to recreate the message as:
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document domDoc =
    builder.parse(
    new File("file.xml"));
    Source domSource = new
    javax.xml.transform.dom.DOMSource(domDoc);
    MessageFactory mfactory = MessageFactory.newInstance();
    SOAPMessage msg = mfactory.createMessage();
    SOAPPart part = msg.getSOAPPart();
    part.setContent(domSource);
    Hope this helps.

  • The embedded oc4j in JDeveloper returned a wrong data from the SOAP message

    Greetings,
    I made a webservice in .NET to send simply the current time of the server. then, I developed another client in JDeveloper to receive the time.
    and the object declared in j2ee as Calendar object.
    everythings went fine, but what I have noticed when I print the Calendar object, the time came plus 3 hours later as the .NET time.
    FYI, I had checked the soap message that was received by embedded OC4J ,it was correct time, but the problem when you print it. and both .NET and Jdeveloper in the same machine
    example:
    <?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">
    <soap:Body>
    <HelloWorldResponse xmlns="http://tempuri.org/">
    <HelloWorldResult>2008-10-14T10:40:21.12</HelloWorldResult>
    </HelloWorldResponse>
    </soap:Body>
    </soap:Envelope>
    when I printed the data, I got 2008-10-14T13:40:21.12
    so, does anyone have an idea about what is going on ??
    thanks in advance.

    ANY HELP :(

  • 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 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

  • Help, how to monitor the soap message sent by JAX-WS

    Hi,everyone:
    I want to monitor the soap message sent by JAX-WS using apache TCPMon.
    For example, the JAX-WS is deployed on port 8080 , I make TCPMon listening on port 4444 and send soap request to port 4444 using JAX-WS.
    Code in client:
    @WebServiceClient(name = "JAX_WS", targetNamespace = "http://www.example.org/JAX_WS/", wsdlLocation = "file:/E:/zwz/EclipseWorkspace/JAX_WSDemo/WebRoot/META-INF/JAX_WS.wsdl")
    public class JAXWS_Service extends Service {
         private final static URL JAXWS_WSDL_LOCATION;
         private final static Logger logger = Logger
                   .getLogger(demo.client.JAXWS_Service.class.getName());
         static {
              URL url = null;
              try {
                   //URL baseUrl;
                   //baseUrl = demo.client.JAXWS_Service.class.getResource(".");
                   url = new URL("http://localhost:4444/JAX_WSDemo/JAXWSBean");
              } catch (MalformedURLException e) {
                   logger
                             .warning("Failed to create URL for the wsdl Location: 'file:/E:/zwz/EclipseWorkspace/JAX_WSDemo/WebRoot/META-INF/JAX_WS.wsdl', retrying as a local file");
                   logger.warning(e.getMessage());
              JAXWS_WSDL_LOCATION = url;
         public JAXWS_Service(URL wsdlLocation, QName serviceName) {
              super(wsdlLocation, serviceName);
         public JAXWS_Service() {
              super(JAXWS_WSDL_LOCATION, new QName("http://www.example.org/JAX_WS/","JAXWSBeanService"));  //JAX_WS
         @WebEndpoint(name = "JAX_WSPort")
         public JAXWS getJAXWSSOAP() {
              return super.getPort(new QName("http://www.example.org/JAX_WS/","JAX_WSPort"), JAXWS.class);  //JAX_WSSOAP
    }But i get the exception:
    Exception in thread "main" com.sun.xml.internal.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException.
    java.net.SocketException: Unexpected end of file from server
    java.net.SocketException: Unexpected end of file from serverAnd the TCPMon doesn't receive anything.
    If i use Axis2, the TCPMon will work fine.
    I cannot figure out how to configure the webservices.
    Could anyone help me? Thanks a lot.

    [http://blog.vinodsingh.com/2007/02/monitor-soap-messages.html|http://blog.vinodsingh.com/2007/02/monitor-soap-messages.html]
    Edited by: vinod.singh on 7 Apr, 2009 11:03 AM

  • Process wait SQL*Net message from dblink /SQL*Net message from client

    Hi There,
    We have an ETL process that we kindly need your help with. The process been running since Sun, where it transfers the data from one server (via remote query). The process was running ok till last night where it appeared
    to have stopped working and/or the session is just idling doing nothing.
    Here are some tests that we did to figure out what's going on:
    1. when looking at the session IO, we noticed that it's not changing:
    etl_user@datap> select sess_io.sid,
      2         sess_io.block_gets,
      3         sess_io.consistent_gets,
      4         sess_io.physical_reads,
      5         sess_io.block_changes,
      6         sess_io.consistent_changes
      7    from v$sess_io sess_io, v$session sesion
      8   where sesion.sid = sess_io.sid
      9     and sesion.username is not null
    10     and sess_io.sid=301
    11  order by 1;
                        logical   physical
      SID BLOCK_GETS      reads      reads BLOCK_CHANGES CONSISTENT_CHANGES
      301  388131317   97721268   26687579     223052804             161334
    Elapsed: 00:00:00.012. Check there is nothing blocking the session
    etl_user@datap> select * from v$lock where sid=301;
    ADDR     KADDR           SID TY        ID1        ID2      LMODE    REQUEST      CTIME      BLOCK
    684703F0 6847041C        301 DX         35          0          1          0      45237          0
    684714C4 684714F0        301 AE     199675          0          4          0     260148          0
    619651EC 6196521C        301 TM      52733          0          3          0      45241          0
    67F86ACC 67F86B0C        301 TX     458763      52730          6          0      45241          03. Check if the session is still valid:
    etl_user@datap> select status from v$session where sid=301;
    STATUS
    ACTIVE4. Check if there is anything in long ops that has not completed:
    etl_user@datap> SELECT SID, SERIAL#, opname, SOFAR, TOTALWORK,
      2      ROUND(SOFAR/TOTALWORK*100,2) COMPLETE, TIME_REMAINING/60
      3      FROM   V$SESSION_LONGOPS
      4      WHERE
      5      TOTALWORK != 0
      6      AND    SOFAR != TOTALWORK
      7     order by 1;
    no rows selected
    Elapsed: 00:00:00.005. Check if there is anything in long ops for the session:
    etl_user@datap> r
      1* select SID,SOFAR,TOTALWORK,START_TIME,LAST_UPDATE_TIME,TIME_REMAINING,MESSAGE from V$SESSION_LONGOPS where sid=301
      SID      SOFAR  TOTALWORK START_TIM LAST_UPDA TIME_REMAINING MESSAGE
      301          0          0 22-JUL-12 22-JUL-12                Gather Table's Index Statistics: Table address_etl : 0 out of 0 Indexes done
    Elapsed: 00:00:00.00This is a bit odd!! This particular step have actually completed successfully on the 22nd of July, and we don't know why it's still showing in long opps!? any ideas?
    6. Looking at the sql and what's it actually doing:
    etl_user@datap> select a.sid, a.value session_cpu, c.physical_reads,
      2  c.consistent_gets,d.event,
      3  d.seconds_in_wait
      4  from v$sesstat a,v$statname b, v$sess_io c, v$session_wait d
      5  where a.sid= &p_sid_number
      6  and b.name = 'CPU used by this session'
      7  and a.statistic# = b.statistic#
      8  and a.sid=c.sid
      9  and a.sid=d.sid;
    Enter value for p_sid_number: 301
    old   5: where a.sid= &p_sid_number
    new   5: where a.sid= 301
                 CPU   physical    logical                                   seconds
      SID       used      reads      reads EVENT                             waiting
      301    1966595   26687579   97721268 SQL*Net message from dblink         45792
    Elapsed: 00:00:00.037. We looked at the remote DB where the data resides on, and we noticed that the remote session was also waiting on the db link:
    SYS@destp> select a.sid, a.value session_cpu, c.physical_reads,
      2  c.consistent_gets,d.event,
      3  d.seconds_in_wait
      4  from v$sesstat a,v$statname b, v$sess_io c, v$session_wait d
      5  where a.sid= &p_sid_number
      6  and b.name = 'CPU used by this session'
      7  and a.statistic# = b.statistic#
      8  and a.sid=c.sid
      9  and a.sid=d.sid;
    Enter value for p_sid_number: 388
    old   5: where a.sid= &p_sid_number
    new   5: where a.sid= 390
           SID SESSION_CPU PHYSICAL_READS CONSISTENT_GETS EVENT                                                    SECONDS_IN_WAIT
           390         136              0            7605 SQL*Net message from client                                        46101
    SYS@destp>We have had an issue in the past where the connection was being dropped by the network when the process runs for few days, hence we have added the following to the sqlnet.ora and listener.ora files:
    sqlnet.ora:
    SQLNET.EXPIRE_TIME = 1
    SQLNET.INBOUND_CONNECT_TIMEOUT = 6000
    listener.ora:
    INBOUND_CONNECT_TIMEOUT_LISTENER = 6000What else can we do and/or further investigate to work out the root cause of the problem, and may be help resolve this. We don't want to just stop and start the process again as it took few days already. We have
    had a chat to the infrastructure team and they've assured us that there have been no network outages.
    Also, the alert logs for both instances (local and remote) shows no errors what so ever!
    Your input is highly appreciated.
    Thanks
    Edited by: rsar001 on Jul 25, 2012 10:22 AM

    Ran the query on both local/remote db, and no rows returned:
    etl_user@datap> SELECT DECODE(request,0,'Holder: ','Waiter: ')||vl.sid sess, status,
      2  id1, id2, lmode, request, vl.type
      3  FROM V$LOCK vl, v$session vs
      4  WHERE (id1, id2, vl.type) IN
      5  (SELECT id1, id2, type FROM V$LOCK WHERE request>0)
      6  and vl.sid = vs.sid
      7  ORDER BY id1, request
      8  /
    no rows selected
    Elapsed: 00:00:00.21

  • Changing the value of the SOAPElement in the SOAP message

    Now another problem I encountered was of overwriting a value in the SOAP message by my value. SOAPElement interface which extends Node interface provides me the method getValue() to get the value of the node but doesnt give me any method to set any other value instead of this.
    <token xsi:type="xsd:string">token123</token>
    I want to replace the value "token123" with my value.
    Is there no provision for altering a value in the SOAP message? Is this due to security contraints?
    If yes then can we detach the same node and add a similar node with the new value. I wanted to try the same using addChildElements() method but then the problem here is how do I create a new SOAPElement in the handler as its an interface and not a class. Why I want to add a similar node is because I am having the definition of this object in the WSDL file, so if I attach the node corresponding to the parameter of the object then I would get the object populated with this value at J2EE or .net layer.
    Also I thought of adding an attribute to the same node but then since this attribute will not be defined in the WSDL, the value of this attribute will not populate the java object at the J2EE layer. Hence attribute introduction also didnt help.
    This is the userData object in the soap body:
    </q1:FetchDetailsInput><q2:UserData xmlns:q2="java:com.anthem.enb.common.data" xsi:type="q2:UserData" id="id2">
    <password xsi:type="xsd:string">12345</password>
    <token xsi:type="xsd:string">token123</token>
    <userID xsi:type="xsd:string">vikas123</userID>
    </q2:UserData>
    This is my code to extract the values from the above message:
    Iterator i = ctx.getMessage().getSOAPPart().getEnvelope().getBody().getChildElements();
    System.out.println(" i.hasNext() =" + i.hasNext());
    while (i.hasNext())
    Object obj = i.next();
    System.out.println(" obj :" + obj.getClass());
    if (obj instanceof SOAPElement)
    SOAPElement e = (SOAPElement) obj;
    System.out.println("e :" + e);
    String operationName = e.getElementName().getLocalName();
    LOG.info(CLASS_NAME + "operationName :" + operationName);
    if (operationName.equals("UserData"))
    Iterator j = e.getChildElements();
    LOG.info(CLASS_NAME + " j.hasNext() : " + j.hasNext());
    while (j.hasNext())
    Object obj2 = j.next();
    LOG.info(CLASS_NAME + " obj2 :" + obj2);
    LOG.info(CLASS_NAME + " obj2 :" + obj2.getClass());
    if (obj2 instanceof SOAPElement)
    SOAPElement eGrandChild = (SOAPElement) obj2;
    String operationName2 =
    eGrandChild.getElementName().getLocalName();
    if (operationName2.equals("userID"))
    String strPass = eGrandChild.getValue();
    LOG.info(CLASS_NAME + " strPass:" + strPass);
    else if (operationName2.equals("password"))
    String strUserID = eGrandChild.getValue();
    LOG.info(CLASS_NAME + " strUserID:" + strUserID);
    else if (operationName2.equals("token"))
    String strToken = eGrandChild.getValue();
    Please help.

    how do I create a new SOAPElement in the handler as its an interface and not a class?Here is an example:
    <example>
    MessageFactory messageFactory = MessageFactory.newInstance();
    SOAPMessage m = messageFactory.createMessage();
    SOAPEnvelope env = m.getSOAPPart().getEnvelope();
    SOAPBody body = env.getBody();
    SOAPElement fResponse =
    body.addBodyElement(env.createName("fResponse"));
    fResponse.addAttribute(env.createName("encodingStyle"),
    "http://schemas.xmlsoap.org/soap/encoding/");
    SOAPElement result =
    fResponse.addChildElement(env.createName("result"));
    result.addTextNode("test");
    ctx.setMessage(m);
    </example>
    Jong

  • Error when parsing SOAP message from JSP

    i write a class to call SOAP message from a servlet on jdev 1013
    when i run the class alone it works fine
    soapMessage = this.buildSOAPMessagee();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    soapMessage.writeTo(output);
    SOAPConnectionFactory connf = SOAPConnectionFactory.newInstance();
    SOAPConnection conn = connf.createConnection();
    SOAPMessage smsg= conn.callsoapMessage, "http://190.0.0.16:8988/mmsc/httpReceiver");
    smsg.writeTo(out);
    but when running same class same method from jsp page...i have Exception
    javax.xml.soap.SOAPException: Unable to get header stream in saveChanges     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:576)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:622)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:686)     at oracle.j2ee.ws.saaj.soap.MessageImpl.writeTo(MessageImpl.java:702)     at test.test2.ret(test2.java:341)     at untitled1.jspService(_untitled1.java:45)     [untitled1.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)Caused by: java.io.IOException: SOAP exception while trying to externalize: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:220)     at oracle.j2ee.ws.saaj.soap.MessageImpl.getHeaderBytes(MessageImpl.java:522)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:574)     ... 23 moreCaused by: javax.xml.soap.SOAPException: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:104)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:76)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:215)     ... 25 moreCaused by: oracle.xml.parser.v2.XMLParseException: Start of root element expected.     at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)     at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:333)     at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:295)     at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:78)     ... 27 more
    dose anybody can help why that happend when running the code from JSP

    i write a class to call SOAP message from a servlet on jdev 1013
    when i run the class alone it works fine
    soapMessage = this.buildSOAPMessagee();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    soapMessage.writeTo(output);
    SOAPConnectionFactory connf = SOAPConnectionFactory.newInstance();
    SOAPConnection conn = connf.createConnection();
    SOAPMessage smsg= conn.callsoapMessage, "http://190.0.0.16:8988/mmsc/httpReceiver");
    smsg.writeTo(out);
    but when running same class same method from jsp page...i have Exception
    javax.xml.soap.SOAPException: Unable to get header stream in saveChanges     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:576)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:622)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:686)     at oracle.j2ee.ws.saaj.soap.MessageImpl.writeTo(MessageImpl.java:702)     at test.test2.ret(test2.java:341)     at untitled1.jspService(_untitled1.java:45)     [untitled1.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)Caused by: java.io.IOException: SOAP exception while trying to externalize: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:220)     at oracle.j2ee.ws.saaj.soap.MessageImpl.getHeaderBytes(MessageImpl.java:522)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:574)     ... 23 moreCaused by: javax.xml.soap.SOAPException: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:104)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:76)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:215)     ... 25 moreCaused by: oracle.xml.parser.v2.XMLParseException: Start of root element expected.     at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)     at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:333)     at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:295)     at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:78)     ... 27 more
    dose anybody can help why that happend when running the code from JSP

  • SQL*Net message from client - huge wait in trace file

    Dear All,
    I am facing a performance issue in a particular operation ( which was completed in 21 Minutes earlier). Now the same operation takes more than 35 Minutes. I took a trace for those session ( 10046 level 12 trace ) and found Lot of waits in SQL*Net message from client.
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQLNet message from client 611927 10.00 1121.35*
    I copied only the highest wait in the tkprof output.
    And I found from the tkprof and even in raw trace file this event waits more time after excuting
    SELECT sysdate AS SERVERDATE from dual;
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 115 0.00 0.00
    SQLNet message from client 115 10.00 724.52*
    Please help me to find out why this wait taking long time, especially on the above query..
    Regards,
    Vinodh

    Vinodh Kumar wrote:
    Hi,
    This is what available in the trace file
    PARSING IN CURSOR #2 len=38 dep=0 uid=60 oct=3 lid=60 tim=7052598842 hv=3788189359 ad='7d844fa0'
    *"SELECT sysdate AS SERVERDATE FROM dual"*
    END OF STMT
    PARSE #2:c=0,e=12,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=7052598839
    BINDS #2:
    EXEC #2:c=0,e=42,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=7052599002
    WAIT #2: nam='SQL*Net message to client' ela= 1 driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=7052599058
    FETCH #2:c=0,e=15,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=1,tim=7052599110
    *** 2012-01-02 17:07:30.364
    WAIT #2: nam='SQL*Net message from client' *" ela= 10007957"* driver id=1952673792 #bytes=1 p3=0 obj#=-1 tim=7062607120Please find the last line WAIT -- in the complete trace after executing this query
    In awr report , this query taken less than a sec for more than 2000 executions.
    Regards,
    VinodhGood idea to check the raw trace file. It is important to notice that this particular wait event appears after the fetch of the result from the database. The client receives the SYSDATE from the database server, and then the client performs some sort of action for about 10 seconds before submitting its next request to the database. The SQL statement that immediately follows and immediately preceeds this section of the trace file might provide clues regarding what caused the delay, and where that delay resides in the client side code. Maybe a creative developer added a "sleep for 10 seconds" routine when intending to sleep for 10ms? Maybe the client CPU is close to 100% utilization?
    Charles Hooper
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • [NOTE] Adding xsi type to SOAP messages

    Here is a quick 2.0.10 note.
    Some older SOAP stack require xsi type information embedded in the SOAP message to unmarshall the XML message into the appropriate object representation.
    Most customers do no want the overhead of xsi type definition into the SOAP message given that most modern SOAP stack perform the unmarshalling based on the WSDL/XML Schema.
    To address both requirements, we now by default do not add the xsi:type information to the SOAP traffic that the BPEL PM server generates.
    But we have added a new configuration property to the partnerLinkBinding element of the bpel.xml deployment descriptor so that you can ask the BPEL PM server to selectively decorate the SOAP messages targeted at a specific partnerLink. Here is how this looks like:
    <partnerLinkBinding name="XXXXX">
    <property name="sendXSIType">true</property>
    </partnerLinkBinding>
    Note: the challenge here is that if you invoke a service that requires XSI type information and you forget to set that flag in the deployment descriptor you will get a BindingFault with no detail :-( We are very aware of this limitation and are working very diligently towards addressing this problem with a much nicer error message in the 2.1 (aka end of September release).
    Edwin

    Hi,
    thanks for the quick answers.
    The Werbservice is MS CRM Dynamics. The "GUI" is still working. so the webservice is active and alive.
    I want to query the CRM, so i sent a fetch statement to file, which is being picked up and sent as SOAP message to the webservice.
    With point 6 in the mentioned blog the error message in the rwb is gone now, but the message in SXMB_MONI is flagged red and i'm struggling to finfd out what the next error is....may be someone can point out where to look at

  • How to intercept the soap messages.

    hi,
    I have developed a web service using jax-rpc. i know that when a client invokes the web service a SOAP message is sent to the server. Is there any tool that can intercept the SOAP message so that i can edit the message before it is sent to the server. I tried to download this tool called soapmonitor from westbridgetech.com but the site was not working. please help.
    regards,
    kartik.

    Maybe TCPMon would do the trick for you:
    http://ws.apache.org/commons/tcpmon/tcpmontutorial.html

  • Problem to serialise the soap message in a handler

    I'm using a sun web service with a handler on the server side.
    In this handler I want to analize the soap message.
    First I try to serialize it :
    public boolean handleRequest(MessageContext arg0) {
        SOAPMessageContext context = SOAPMessageContext) arg0;
        SOAPMessage mes = context.getMessage();
        Document doc= mes.getSOAPPart();
        OutputFormat format = new OutputFormat(doc);
        format.setLineSeparator(LineSeparator.Windows);
        format.setIndenting(true);
        format.setLineWidth(0);            
        format.setPreserveSpace(true);
        StringWriter sw = new StringWriter();
        XMLSerializer serializer = new XMLSerializer(sw , format);
        serializer.asDOMSerializer();
        serializer.serialize(doc);             
        System.out.println(sw.toString());
    }The result I get looks like that :
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope><soapenv:Header>
    Where are the namespaces ?
    This xml is not correct because the soapenv prefix is not bound.
    How can I get a correct xml from the SOAP message ?

    Hi,
    Is ZYBTT a new attribute? Have you changed the status of the attribute to implemented or released (in SWO1: Edit -> Change release status)?
    And actually I think that your syntax is wrong too (BOR world is different compared to classes). If you want to use an attribute, I think that the syntax should be something like this:
    SWC_GET_PROPERTY <Object> <Attribute> <AttributeValue>.
    Read more here:
    http://help.sap.com/saphelp_nw04/helpdata/en/c5/e4acef453d11d189430000e829fbbd/content.htm
    Regards,
    Karri

  • MQ Adapter does not clear the rejected message from the queue

    Hi All,
    I'm using a MQ Adapter to fetch the message from the queue without any Backout queue configured. However, whenever there is any bad structured message found in the queue, MQ adapter rejects the message and moves the message to the rejmsg folder but does not clear it off the queue, as a result of which it keeps retrying the same hence, filling the logs and the physical memory. Somehow we do not have any backout queue configured so I can move the message to blackout queue. I have tried configuring the jca retry properties and global jca retry as well but to no avail.
    - Is it not the default behaviour of MQ Adapter to remove the rejected message from the queue irrespective of Backout queue is configured or not? The same behaviour working well with the JMS and File Adapter though.
    - Is there any way I can make MQ Adapter delete the message from that queue once it is rejected?
    Regards,
    Neeraj Sehgal

    Hi Jayson,
    Check this URL which answers a problem with com.sap.engine.boot.loader.ResourceMultiParentClassLoader problem:
    http://209.85.175.132/search?q=cache:RnFZ9viwuKkJ:https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.sdn.folder.sdn!2fcom.sap.sdn.folder.application!2fcom.sap.sdn.folder.roles!2fcom.sap.sdn.folder.navigationroles!2fcom.sap.sdn.role.anonymous!2fcom.sap.sdn.tln.workset.forums!2fforumtest!2fcom.sap.sdn.app.iview.forumthread%3FQuickLink%3Dthread%26tstart%3D45%26threadID%3D1020700+com.sap.engine.boot.loader.ResourceMultiParentClassLoader&hl=en&ct=clnk&cd=3&gl=in&client=firefox-a
    Please check that the JDK compliance level is at 5.0
    Window->Preferences->Java->Compiler->Compiler compliance level set this to 5.0
    Set the installed JRE to the one you have mentioned JDK 5.0 update 16
    Window->Preferences->Java->Installed JRE's->
    Click on the add button to select the path of your JDK.
    once completed click on the check box next to it.
    regards,
    AKD

  • Who will write the SOAP message

    when wrting simple Webservice .Who will write the SOAP message?
    weather it generate automatically? or we need write?
    is there any automatic tools are there to generte the SOAP message?
    Please send me a Simple Webservice Example?
    Thanks in advance
    Raju

    Check out http://jax-ws.dev.java.net and look at the samples provided. Netbeans 5.5 beta also makes it very easy to publish a web service. All of the hard work is done for you automatically, to you as a developer it looks just like you are makiing an normal method invocaiton, the framework underneath converts that invocation to/from a soap message.

Maybe you are looking for

  • AP Report- Vendor account and PO by Expense account

    SAP Guru- I am trying to produce a report that provides by expense account the vendor account and PO by period.  I tried amond others the following account :S_P99_41000099 or S_ALR_87012085 and they are not what I need. Does anyone have any inputs on

  • Error during SC creation - Jurisdiction code could not be determined

    Hi All, For testing purpose , I have set up one user id. While creating SC with that ID, I  am getting one error, it says "Jurisdiction code could not be determined ". Plant , company code everything enetred in the SC is perfect. On another hand, I c

  • Sorry, something went wrong. Please try again.

    Hi.I had 32 bits and i changed to 64 bits and now i cant connect to skype. I have a Microsoft account and i cant connect even with Facebook. It says Sorry, something went wrong. Please try again. Please helpP.S: I dont have .net framework. Is it beca

  • CP5 simulation image quality poor

    I am a very new CP5 user. I have successfully run the software simulation process with one problem. The image quality of the output file when previewing the project "bands" the images and distorts gradients. I am capturing images from Firefox on the

  • AR and AP upload -T Code F-02.

    Hi Team, Let me know correct approach BDC or BAPI or LSMW for AR AP upload - T Code F-02. Thanks MMV