Creating, Sending, Receive + Parsing SOAP messages

Hi all
I have a requirement to set up a system to send and receive SOAP messages. I googled for some tutorials and found one that used an Apache library. But I also see that Java 6 has got quite a bit of SOAP built-in. Are the built-in SOAP classes ready for prime time or should I use apache?
If anyone has a code snippet they could post that would also be appreciated.

JAX-WS (which is part of Java 6) is definitely ready for prime time.
It's also a whole lot easier to use.
I'd definitely go with the JAX-WS route.

Similar Messages

  • How to send a signed SOAP message with additional HTTP Header fields

    Our Partner's integration requirements are that we send them asynchronous SOAP messages, that are digitally signed, and whose HTTP headers contains 5 or 6 additional header fields, of which 3 or 4 will need to be dynamically set during the message mapping.  I believe we can use the HTTP adapter for adding new fields to the HTTP header, but don't believe it supports signing.  I believe that the SOAP adapter supports signing, but I'm not clear on how to use it to add fields to the HTTP header.  What is the most straight-forward way to achieve both the signing of the message and the addition of the HTTP header values?
    Thanks,
    Kurt

    >>>What is the most straight-forward way to achieve both the signing of the message and the addition of the HTTP header values?
    Use Java mapping for both.
    1) Signing the message
    You can digitally sign the soap message using many standard api like WSS4j? or  refer Java XML signature API which comes in Jdk1.6.
    Refer these links
    WSS4J  -  http://ws.apache.org/wss4j/axis.html
    Java XML signature : http://java.sun.com/developer/technicalArticles/xml/dig_signature_api/
    2) >>whose HTTP headers contains 5 or 6 additional header fields, of which 3 or 4 will need to be dynamically set during the message mapping
    Use Dynamic configuration API to set the additional header fields during message mapping.

  • Parse SOAP messages

    Hi,
    I would like to know how efficient would be to use Oracle Text to parse SOAP messages. The body of the SOAP messages are heterogeneous in terms of format and size (smallest messages is about 20 lines, biggest message is about 200 lines). The number of records to parse is approximately one hundred thousand every hour.
    Thank you.

    In what sense do you want to "parse" them? Do you just want to find individual strings in the SOAP messages, or are you looking to fully interpret the meaning and content of the SOAP messages? If it's the second of these, then Oracle Text is not the right solution - you could perhaps look at Oracle XML Database instead.

  • Parsing Soap Message Exception

    In my environment, flex looks like unable to parse soap
    message if MTOM and SWA of my web services were enabled. Can anyone
    help me?

    Which version of Flexbuilder are you using? FB2.01 just
    support SOAP 1.1,or am I wrong?
    What exactly do you mean with SWA (seems not to be any
    offical shortterm of w3c)?
    best regards
    kcell

  • 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

  • How to parse a entire SOAP Message

    It seems that there is no API in JAXM for parse a entire SOAP Message.
    And how to set encoding of a SOAP Message?

    I can use Apache SOAP for parsing before. There is a class named
    Envelope that has a method unmarshall(Element). So I can parse
    SOAP message as a common DOM, then change to SOAP Message
    using unmarshall. But in JAXP/JAXM, there is no such a class to work.

  • On my iPhone 5 I am having a problem sending / receiving e-mails and am receiving the message: the user name or password for "imap.gmail" is incorrect. Despite many attempts I am getting nowhere. Does anyone recognise this problem?

    I am having a problem sending/receiving e mail messages on my iPhone 5 and cannot access my account. The message I am receiving is: The user name or password for "imap.gmail" is incorrect.
    I do not know what imap.gmail is. I have also lost data which was contained on my diary which I believe is linked to the problem. Does anyone recognise this problem?
    Cheers,
    Morred

    Morred wrote:
    I am having a problem sending/receiving e mail messages on my iPhone 5 and cannot access my account. The message I am receiving is: The user name or password for "imap.gmail" is incorrect.
    I do not know what imap.gmail is. I have also lost data which was contained on my diary which I believe is linked to the problem. Does anyone recognise this problem?
    Cheers,
    Morred
    imap.gmail is the Google mail server. It doesn't recognize the password that is stored in the iPhone. The problem is that the password or email address you have in Settings for the gmail account is wrong. If you changed the password somewhere else that is the reason. You need to go to Settings/Mail,Contacts,Calendar, tap on the gmail account and enter the correct password. You also need to change it for outgoing mail in Settings.

  • LG G3 suddenly won't send/receive messages?

    I had just received this phone today via delivery (brand new through Amazon). For the first few minutes it was great - easy set up, able to send a few messages to my family about the new phone when suddenly (having literally only sent three messages prior) it stopped sending/receiving altogether. Messages sent will stay in a sending loop seemingly forever before saying it's failed. I've done every type of reset known (soft, factory, even opening up in safe mode) to no avail. I haven't downloaded any apps yet, so I know that's not the case...
    Any ideas on what I can do?
    (I'm also using the typical messenger app, not hangouts or messenger+. I did switch between the three to see if that would help at all, but I still ended up with nothing.)

    Wow - shortly after posting this I received a message (strange considering the fact that I really COULDN'T) from Verizon stating that this number does not have permission to send messages. Please consult the account manager to make changes (or something along those lines (which makes it even more bizarre considering I am the account manager...)). After prodding my Verizon account for a bit, I clicked on 'change features' option and after checking and unchecking certain items I somehow managed to get it all to work.
    Welp, that would explain why that endless torment of resets hadn't worked then I suppose.

  • " " in soap message

    Hi,
    We receive a soap message with the characters "&lt" and "&gt".  The soap adapter is unable to parse this as "<" and ">".  Is there a way to translate "&lt" to "<" without creating an adapter module?
    Thanks.

    Hi Sunil,
    The input payload is similar to the below
    <Request xmlns="http://test.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <RequestResult>&lt;ACKNOWLEDGEMENT VALUE="no"&gt;&lt;ERROR_CODE="test"/&gt;&lt;/ACKNOWLEDGEMENT&gt;</RequestResult>
      </Request>
    The string value is sent for the values in node, RequestResult.
    The output has to be the exact same but instead of the "& lt ;" and "& gt ;" represented in the node, RequestResult, it needs to be translated to "<" and ">" xml nodes and not string values.
    Thanks for your help.
    Best Regards.

  • Server which accepts soap messages

    Hello everyone
    Could you tell me if there is any way to create server which accepts SOAP messages, and this service is not a WebService?
    Thanks in advance.

    hi,
             Please try to use this webservice using External Tools, i.e SOAP UI Tool or Altova XML Spy. Firstly it should work with these tools.
             Secondly ask your basis to toc check that ports are open to recieve or send request to 3rd Party Application which consumes webservice. There should be no firewall issue. You can check this by using webservice URL in Internet Explorer. It should open webservice Definition.
             Thirdly execute your scenario after above confirmations. Check SOAP receiver Adapter log in CC Monitoring. If it shows green there with status Message Successfully processed. It means , it's out from XI and there is no issue in XI. Ask your 3rd Party Application to check at their end.
    I hope it helps.
    Regards,
    Anurag Garg

  • 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

  • Empty soap message

    I use abapProxy to invoke an external webservice via SOAP adapter but i get an error "invalid http response: null" in sxmb_moni  so i thought that there might be an mistake in request SOAP message and I installed TCPGateway to see logs about sending and coming message.
    When i invoke the proxy, sending part of TCPGateway is empty but as you guess , coming part of it shows an error "java.net.ConnectException: Connection timed out : connect"
    What maybe the reason for that SOAP adapter sends an empty SOAP message?
    Thanks

    Hi Abhishek;
    As i mentioned , i used TCPGateway program on XI server to see going message to external webservice..this gateway program takes request and forwards it but it still comes as empty  SOAP message from XI adapter to this TCPGateway program.
    as you guess, when you send empty soap message , external webservice doesnt respond to this request so it gets timeout error.
    ps: i tried to invoke this webservice via another third-party tool, it works properly.
    What would another reason except firewall settings for this issue ? because i do all of these control on XI server, namely before empty soap message goes.
    Thanks

  • I receive an error message when I try to save my 3 security questions. As a result you can't download apps

    I receive an error message when I try to save my 3 security questions. As a result you can't download apps

        Congratulations on your new phone, Nonaleigh.
    We would love to get to the bottom of your message mystery.
    I'm guessing you are getting the error for all messages you attempt to send, is that correct?
    What type of phone did you upgrade from? We ask because if you have switched from an Apple device (e.g., iPhone) to a non-Apple device (e.g., Android, Blackberry, etc.) and previously used the iMessage service, you may experience issues sending/receiving SMS/MMS messages with Apple device users. You need to deactivate the iMessage service within your Apple account to restore normal SMS/MMS functionality.
    TamaraH_VZW
    Follow us on Twitter @VZWSupport 

  • Failed to send text and text message color?

    Hey Guys, well yesterday I got my Iphone 4 and activated it earlier today with a T-Mobile micro sim card and after I entered in all of my contacts , I tried to send a text to my friend but it failed and it noticed that when tried to send it the text color was green then i sent another text to a different friend and this time it was blue. My brother told it that the blue text good for iphone users while green was good for anything other than iphone. I turned off  "enable 3g" and cellular data and I turned on mms messaging, "send as SMS'', and group messaging and I tried again to send the text to the green user but it failed to send again. Can Iphone users send texts to android, etc. users?

    Yes, you can send texts to Android, etc.  They will all be green as you say above.  But text messages are at the discretion of your cellular carrier.  You have to have a plan in place with them to send/receive (green) text messages.

  • Why can't I receive group text messages?

    Why can't I receive group text messages?  I can send group messages and receive a response and texting to individuals works also.  My carrier is AT&T

    crosby1 wrote:
    iPhone 5 with iOs 7.0.4
    Do I really have to have my LTE/3G data enabled in order to send/receive group text messages????  YES.
    If so, that's a complete waste of my data package as far as I'm concerned. ... I'm not sure why I can't send/receive group text messages as plain texts????
    Group messages are considered MMS, not SMS.  MMS is transmitted over the cellular (data) network.  It does NOT use your data plan, it uses your texting allowance.  But data DOES need to be enabled to send and receive group and picture texts.

Maybe you are looking for