JAXM and entities in SOAP document

I've been trying out JAXM (1.0.0) and I've reached a situation where JAXM is telling me that I can't have entities (such as & lt ;) in my SOAP document. I've not seen this restriction mentioned anywhere before -- I can't find it in the SOAP 1.1 spec. Can anyone provide me with a clue here?
The exception is:
javax.xml.soap.SOAPException: Unable to create envelope from given source: Entities are illegal in a SOAP document Nested exception: Entities are illegal in a SOAP document at com.sun.xml.messaging.soap.dom4j.EnvelopeFactoryImpl.createEnvelope(EnvelopeFactoryImpl.java:76)
at com.sun.xml.messaging.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:92)
I'm trying to do the following; for testing I thought it would be useful to modify the simple.war/ReceiveServlet to return the message it receives in a SOAP response. That is, if I send a message like this.....
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<f:checksheet-request xmlns:f="http://someone.com/SOAP/checksheet" locale="en_GB">
<VIN>12345678901234567
</VIN>
</f:checksheet-request>
</soap-env:Body>
</soap-env:Envelope>
I'd get back the following......
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header/>
<soap-env:Body>
<Response><soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Body><f:checksheet-request xmlns:f="http://someone.com/SOAP/checksheet" locale="en_GB"><VIN>12345678901234567</VIN></f:checksheet-request></soap-env:Body></soap-env:Envelope>
</Response>
</soap-env:Body>
</soap-env:Envelope>
...and those are the messages that are sent (I watched the messages using the Axis project's tcpmon tool).
This is the code I'm using the read the message:
SOAPMessage response = connection.call(message, endpoint);
SOAPPart soapPart = response.getSOAPPart();
// The next line throws the exeption....
SOAPEnvelope env = soapPart.getEnvelope();
What's the problem with having entities in the response?
Many thanks
Richard

Thanks for the help. The onMessage implementation is as follows:
public SOAPMessage onMessage(SOAPMessage message)
        logger.debug("onMessage called in receiving servlet");
        try
            logger.debug("Here's the message: ");
               ByteArrayOutputStream bytes = new ByteArrayOutputStream();
               message.writeTo(bytes);
               String receivedMessage = bytes.toString();
            logger.debug(receivedMessage);
            SOAPMessage msg = fac.createMessage();
            SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
            env.getBody()
                .addChildElement(env.createName("Response"))
                .addTextNode(receivedMessage);
            return msg;
        catch(Exception e)
            logger.error("Error in processing or replying to a message", e);
            return null;
    }As you can probably tell, that's just a small change to one of the sample servlets in the JAXM distribution.
The client that sends the message is a junit test class as follows:
     public void testEchoSendRequest() throws SOAPException
          SOAPConnectionFactory scFactory =  SOAPConnectionFactory.newInstance();
          SOAPConnection connection = scFactory.createConnection();
          MessageFactory mf = MessageFactory.newInstance();
         SOAPMessage message = mf.createMessage();
           SOAPPart sp = message.getSOAPPart();
         SOAPEnvelope envelope = sp.getEnvelope();
         SOAPHeader header = envelope.getHeader();
          header.detachNode();
         SOAPBody body = envelope.getBody();
          Name bodyName = envelope.createName("checksheet-request",     
               "f", "http://someone.com/SOAP/checksheet");     
          SOAPBodyElement checksheetRequest = body.addBodyElement(bodyName);
          SOAPElement vin = checksheetRequest.addChildElement("VIN");
          vin.addTextNode("12345678901234567");
          checksheetRequest.addAttribute(envelope.createName("locale"), "en_GB");
          URLEndpoint endpoint = new URLEndpoint("http://127.0.0.1:9888/etis/soap-echo");     
          SOAPMessage response = connection.call(message, endpoint);
          assertTrue("Expected non-null response", response !=null);
          SOAPPart soapPart = response.getSOAPPart();
          SOAPEnvelope env = soapPart.getEnvelope();
          SOAPBody contents = env.getBody();
          assertTrue("Didn't expect a fault: "+ contents.getFault().getFaultString(), contents.hasFault() == false);
          Iterator it = contents.getChildElements(env.createName("Response"));
          assertTrue("Expected content in response", it != null && it.hasNext());
          SOAPBodyElement bodyElement = (SOAPBodyElement)it.next();     
          assertTrue("Expected non-empty response", bodyElement != null);
          String sentMsg = bodyElement.getValue();     
          System.out.println("Got back: "+sentMsg);
     }Thanks for looking into this.
Richard

Similar Messages

  • Accounts and entities do not match in application ownership

    Hi all,
    I'm working on NW 7.5 SP07 (upgrading in SP09 isn't an option at the moment) and when running Consolidation i am getting the error "Accounts and entities do not match in application ownership".
    I am very familiar with Consolidation and created consol appsets numerous times, so I am confident I have set up the dimensions correctly (with all the right properties), appset and app web parameters all look ok, business rules are good, ownership and rate data is all in correct place...but no matter what i do i still get this error.
    FX, carry-forward and calc accounts all work ok, so it is simply something wrong with the ownership app or with how finance is talking to it.
    There was only 1 thread I could find where others had this issue - many people had the same problem and there was never a clear solution to it ..... [Accounts and entities do not match data in application OWNERSHIP; 
    Any ideas besides upgrading to SP09?
    Tom.

    Hi Tom
    Thank you for answer. I found some missing data in my ownership cube and now  'Accounts and entities do not match in application ownership' gone but new error appears after validate script in se38 'GETWA_NOT_ASSIGNED'. Have you ever had this kind of error?
    SAP sent me some tasks list but it seems to me that I have all settings they sent in that document.
    I have a couple of questions and will be very appreciate if you can answer me.
    Are additional members in O_Acct  necessary? If I use only METHOD PCON PGROUP POWN in my input schedules.
    METHOD_SYS
    PCON_SYS
    PCTRL
    PCTRL_SYS
    POWN_SYS
    POWND
    POWND_SYS
    Are you using those above for your consolidation process?
    Are you using dynamic hierarchy editor or input schedules to maintain your ownership data?
    Regards!
    Justyna

  • Web service error: WS Security can only be applied on a SOAP document

    Hello,
    I am facing the problem that when calling a web service I got this error message:
    005056B855B2002A0000013B000032C70005105EF7348C38 : WS Security can only be applied on a SOAP document.
    Some information about the webservice:
    Transport Binding: HTTP SOAP with Attachments
    Authentication: Basic
    Netweaver version: 7.01.06
    The webservice is based on EJB. Basically I want to add two operations in the webservice: one to accept attachment as input. the other one returns a file as attachment.
    Does anyone knows why this happens and how to resolve it? Thanks in advance!
    Regards,
    Grant

    Grant,
    Please refer this SNote, it may help you...
    1319507 - Overview: Analysis of ABAP Web Service
    Configuration
    Warm Regards,
    Agustuss

  • Receiving and parsing a SOAP Message

    Hi All.
    I have just installed the JAXM package, cause I want to programm a network message broker using SOAP. The server code is written in C# and I tested it. All messages are send and processed via SOAP and it all works.
    So I now want to try to receive these messages with a JAVA program. But when I looked up the API I didnt find any class or method for only receiving SOAP messages. I guess that I have overlooked the part where this is explained, or I got something wrong. But I would be grateful, if anyonle could tell me if and how this will work.
    Thanx in advance,
    Christian

    Hi
    To get a service to only receive messages you must use a class that implements Onewaylistener, and this class must be supported in a container environment e.g. servlet or J2EE container. It defines one method, public SOAPMessage onMessage(SOAPMessage) which is called by the container when it receives a message. For example say I want to create a servlet that receives SOAP messages for a purchasing application
    public class PurchasingServlet extends JAXMServlet implements
              OnewayListener{
         public SOAPMessage onMessage(SOAPMessage message){}
    The JAXMServlet is a helper servlet to handle SOAP messages but it is not necessary to implement.
    Hope this helps.

  • JAXM and a non Java Web Service Client

    How can I acces a web service buit using JAXM with a client written using other technology?
    Where do I have to send the SOAP message from the client?
    I saw that JAXM optains the messeage from the HttpRequest! How do I put the SOAP message there?
    Thanks

    if you are not taking advantage of asynchronous messaging via a messaging provider, but want a standard web service that speaks to non java clients then JAX-RPC should be the API of your choice. It is simpler then JAXM and more standard compliant.
    If you want to do asynchronous messaging your client has to have some kind of messaging provider, too, to be able to continously listen to messages. Then the SOAP messages are then exchanged between the two message providers who both in turn notify onMessage the relevant application (message consumer).
    I hope this helps you solve your problem ;-)

  • Reliable messaging between XI and BizTalk using SOAP

    I came across this document describing how reliable messaging between XI and BTS can be implemented using the SOAP extensions. This document has been authored by
    - André Fischer, Project Manager CTSC, SAP AG
    - Matthias Allgaier, Consultant XI, SAP Deutschland AG & Co.
    - KG Jürgen Daiberl, SAP Program Manager CTSC, Microsoft Corporation
    Does anyone know if the prototype code is available for download from SDN or elsewhere? A search on SDN did not produce any results...
    Thanks.
    - KishenM

    Larry,
    Let me see if I understood this - You need to use the SOAP adapter to integrate with BizLink. Bizlink Provides its own SOAP Header and hence you are not sure how to do this.
    Got a few questions,
    1. Has Bizlink given you a XSD / WSDL. Does this have the entire SOAP Payload including the SOAP Header and SOAP body? If yes, create the mapping as needed and instead of the SOAP adapter use the HTTP adapter or use the SOAP adapter and in the SOAP adapter select option Do Not Use SOAP Envelope.
    2. If you do not have a XSD that contains the entire SOAP Enevelope - SOAP header and body then use XSL or Java Mapping that creates this output structure and use the SOAP adapter with the DoNotuseSOAP Envelope option or the HTTP adapter.
    The SOAP adapter in the DONotUseSOAP Emvelope mode basically becomes a http adapter.
    Regards
    Bhavesh

  • Advantages and Disadvantages of Soap

    Advantages and Disadvantages of Soap
    Hi Firends,
                  Could you please tell me the Advantages and Disadvantages of using Soap adapter, i need them urgently.
    Note: High reward points will be given for each answer

    Hello
    SOAP is an XML-based protocol for exchanging information in a decentralized, distributed environment. It was made for Web, a combination of XML and HTTP opens up new options for distributed data exchange and interaction in a loosely coupled web environment. SOAP is a technology that allows XML to move easily over the Web. SOAP does this trough an XML envelope for delivering XML content and specifying a set of rules for services to follow when they receive a SOAP message.
    The fundamental change brought about by SOAP has been the ability to move data anywhere across the Web. Before SOAP there were only two main options for moving data between partners.
    One was to build a wide area network spanning a broad geographic region and let the partners plug into it. This was the approach taken by EDI, which defined messages and protocols for data transfer but left the network details up to the partners. The result was a collection of networks that pretty much locked the partners in and made it difficult and expensive to reach out to other EDI networks and costly to bring in new partners.
    The second approach for moving data between partners was to build a distributed object infrastructure than ran over the internet. This was the approach taken by Common Object Request Broker (CORBA), Remote Method Invocation (RMI) and Distributed Component Object Model (DCOM). The problem was that each had to decide on a protocol that could sit on top of TCP/IP and handle inter object communication. CORBA Chose Internet Inter-ORB Protocol (IIOP), DCOM chose object Remote Procedure Call (ORPC), and RMI chose Remote Method Protocol (JRMP). While this approach reduced the need to share the same underlying network, the drawback was that CORBA could talk to CORBA, RMI to RMI and DCOM to DCOM, but they neither could talk to each other nor directly to the web except through special sockets that required adding extra layers to an already complex architecture.
    SOAP the third option, combines the data capabilities of XML with the transport capabilities of HTTP, there by overcoming drawbacks of both EDI and tightly coupled distributed object system such as CORBA, RMI and DCOM. It does this by breaking dependence between data and transport and in doing so opens up a new era of loosely coupled distributed data exchange.
    SOAP Carries an XML RPC tradition by defining an XML language for packaging arbitrarily XML inside an XML envelope. Although SOAP does not depend on HTTP, the momentum behind SOAP is attributable to the fact that HTTP will usually be used for transfer protocol for SOAP messages.
    SOAP is a transport protocol similar to IIOP for CORBA, ORPC for DCOM or JRMP for RMI.
    SOAP differs from CORBA, RMI or DCOM in several ways.
    IIOP, ORPC and JRMP are binary protocols, while SOAP is a text based protocol that uses XML. Using XML for data encoding makes SOAP easier to read than a binary stream.
    1) Because SOAP is text based, it is able to move more easily across the firewalls than IIOP, ORPC or JRMP.
    <p2) SOAP is based on XML, which is standard driven rather than vendor driven. Potential adaptors are less likely to fear vendor lock in with SOAP. </p2>
    The net effect is that SOAP can be picked up by different transport protocol and delivered in different ways. For example, when used with HTTP it can be delivered to a web server, when used over FTP it can be deposited directly into a file system and when used with SMTP it can be delivered to a user's mailbox.
    Many companies exchange data between established partners is proving totally satisfactory way to leverage the benefits of XML and the web. In this scenario the required are an agreed upon schema either DTD or an XML schema, for XML data being exchanged and the SOAP server capable of handling the incoming XML as it arrives over the web. Details about what kind of schemau2019s to expect and who will check the XML conforms to the schema are decided offline by individuals participating in the process. On the software side senderu2019s needs to be involved in packaging their data in an XML document. For those companies already storing data in XML, this should require only minimal effort. If the stored XML data is not in the form required by the agreement, an XSL Transformation(XSLT) style sheet can be programmed to automate the transformation.
    SOAP messages define one way data transmission from sender to the receiver. However SOAP messages are often combined to implement patterns such as request-response. When using HTTP binding with SOAP, SOAP messages can use the same connection as the inbound request.
    Regard's
    CHETAN AHUJA

  • I upgraded my 3rd generation ipad to ios 6.0.1 and now am experiencing various issues.  Neither Pages or Numbers will open.  I just see a gray screen that says Pages or Numbers at the top and all of my documents are gone.

    I upgraded my "new ipad" (the 3rd generation I think) to ios 6.0.1 and now am experiencing various issues. 
    1- Neither Pages or Numbers will open.  I just see a gray screen that says Pages or Numbers at the top and all of my documents are gone. The icon that allows me to create a new document also does not appear.  I went to icloud.com to see whether my documents still existed, which brings me to the 2nd problem.
    2- It appears that all of my Pages documents are still on icloud, but all of my Numbers documents are gone.  There were only about 10, but I access 2 of them nearly every day, so this is a big issue for me.
    I went into Settings and all of the icloud information is correct and it "Documents & Data" is on.  When I look at the storage, I see the Pages documents but not the Numbers ones.  The next thing I did was turn my ipad off and back on, but this didn't fix anything.  Since my Pages documents are still on icloud, I then tried to delete the Pages app from the ipad so that I could reinstall it, which resulted in the 3rd problem.
    3- I cannot delete any apps.  I can get all of the icons to shake and the small x IS available, but everything freezes when I click it.  I can't do anything at that point except reset the ipad or wait until it eventually restarts itself.  I've tried this with Pages as well as multiple other apps, all with the same result.  I've also tried downloading a new app (which worked fine) and then deleting that one, but I got the same result.
    3a- A small related issue to this that I am far less concerned about is that when the ipad restarts itself, it comes back on and the screen is really dark and I can barely make out what appears on the screen.  If I enter my password right away, it stays that way until I go into Settings - Brightness & Wallpaper and touch the brightness setting (although I'm not actually changing the setting because it already shows that the brightness is turned up a little over halfway).  If I don't enter my password right away and let it go completely dark, then click the home button, the brightness is fine.
    So now I'm stuck.  My guess is that I will need to restore it, but wanted to check before I take that step.  Unfortunately, my laptop is on its deathbed so I haven't been synching my ipad to it and I fear my Numbers documents are gone forever.  I'd like to try everything I can to fix these issues before doing the restore in hopes that I can get the Numbers documents back.
    Any suggestions for any or all of these problems?

    Purplehiddledog wrote:
    I do backup with iCloud.  I can't wait until the new iMac is available so that I can once again have my files in more than 1 location without needing to rely solely on the cloud. 
    I also rely on iTunes and my MacBook and Time Machine as well as backing up to iCloud. I know many users know have gone totally PC free, but I chose to use iCloud merely as my third backup.
    I assume that the restore would result in my ability to open Pages and Numbers and fix the problem with deleting apps, but this would also mean that if my Numbers documents still exist solely within the app and are just not on iCloud for some reason that they would be gone forever.  Is that right?
    In a word, yes. In a little more detail.... When you restore from an iCloud backup, you must erase the device and start all over again. There is no other way to access the backup in iCloud without erasing the device. Consequently, you are starting all over again. Therefore, it would also be my assumption that Pages and Numbers will work again and that the deleting apps issues would be fixed as well.
    If the documents are not in the backup, and you do not have a backup elsewhere, the documents could be gone forever.

  • Reporting for clearing, residual and payment of AR documents

    The request is to create a report (ALV) that will show the billing document/accounting document, the clearing document with amount, the residual document with amount and if it is a shortpay.
    The BSEG and BSAD tables have been looked at but some cases are not easy to break apart to code.
    Is function module available that will generate this information?
    Much appreciated!

    BSEG provided all the answers, but the coding to get all the required information is tricky and complex.
    Start with the invoice document and get the clearing document. This could be a DZ or an AB. If an AB, go back to BSEG and find the DZ using the clearing document. Finally, get residual using the AB where the document is both the clearing document and the document number.
    Many variations can exist so be sure to check for business process on how clearing is accomplished.

  • My iMac just crashed, and I had some documents open in Pages that were unsaved. Is there a temporary file or backup file that I can access as on a PC? (I have just looked in Timemachine which I had operating, but it did not seem to have any temp files).

    My iMac just crashed, and I had some documents open in Pages that were unsaved. Is there a temporary file or backup file that I can access as on a PC? (I have just looked in Timemachine which I had operating, but it did not seem to have any temp files in it at all - not sure what it would be useful for then).
    Any suggestions?

    Question asked and answered several times.
    If you didn't save, nothing is recoverable.
    iWork apps don't create temp files so, as far as you on't save something, Time Machine can't archive it.
    Yvan KOENIG (VALLAURIS, France) mardi 5 juillet 2011 12:25:31
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own
    before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • I don't know if this is the right section but I experience the following issue with Adobe Acrobat Pro XI installed on Windows 8.1. When I start Acrobat the related window opens normally but, after some scroll up and down along the document, it blocks, Acr

    I don't know if this is the right section but I experience the following issue with Adobe Acrobat Pro XI installed on Windows 8.1. When I start Acrobat the related window opens normally but, after some scroll up and down along the document, it blocks, Acrobat doesn't respond to any command I can give and, in place of the pointer arrow, a vertical bar, as the one of the text editor appears. The only way I can stop Acrobat is by means of the task manager. I tried to de-install and the re- install Acrobat but the behaviour is always the same. What can I do??

    Have you opened Acrobat and gone to Help>Updates to get an updated install?

  • How can I change one section of the document to a landscape orientation and not the whole document?

    How can I change one section of the document to a landscape orientation and not the whole document?

    Page Setup, including page orientation, is done in the File menu. The setting applies to the whole document. As Peter says, you can rotate the contents of a page (not including the text layer of a word processing document).
    As an alternative, you could use Numbers, where Sheets are empty canvases onto which you may place images, charts, tables and text boxes, and where page orientation may be set for individual Sheets. The main tradeoff is that you lose many of the built-in word processing and page layout features of Pages.
    Regards,
    Barry

  • Is there a way to save and view Microsoft Office documents on the iPhone?

    I have just transitioned from a Blackberry to an iPhone 4 for business. On the Blackberry I was able to save and open Microsoft Office documents such as Word, Excel etc. do I have this capability on the iPhone and if so, what is the app required to do so?

    I can't even begin to guess what your needs are. I'm sure my needs are significantly different. Look at the features, read the reviews, and decide.
    This is a technical support forum for the iPhone. We're not here to make recommendation on 3rd party products.

  • Recentley printing most documents in firefox print on 1/4 of the page and not the complte document. When I print the same thing in safari it prints fine. Please advise how I can get proper printing in firefox

    When using Firefox to print most documents ( boarding passes, mastercard statements,genealogy documents) the printing only shows on 1/4 of the page, is in the lower left quarter and does not print part of the right side of the information. When I go into Safari and print the same documents within 2 minutes they always print fine. We like Firefox and would prefer to continue to use but if we can't print we will have to use Safari more often

    I have the same problem with cutting of the page since installing the new version. If you manually zoom out the print it only shows 1/4 of the page on a whole page of paper. Something is wrong here.
    I have done all these steps and it still does NOT print correctly!
    I am a IT professional and something is not right with the new firefox browser. Please supply with fix or we will have to permanently switch back to Internet Explorer, which works perfectly.

  • In Windows 7 using Adobe Reader XI (11.0.07) was able to copy an item (name, number, date) and paste in another document.  In Windows 8.1 using same version of Adobe Reader XI (11.0.07) not able to do this.  Any solutions?

    In Windows 7 using Adobe Reader XI (11.0.07) was able to copy an item (name, number, date) and paste in another document.  In Windows 8.1 using same version of Adobe Reader XI (11.0.07) not able to do this.  Any solutions?

    With computer running Windows 7 using the curser can select an item, then right click and select copy.   With computer running Windows 8 there is a hand instead of a curser therefore unable to select an item, therefore unable to copy.  Is there a way to have a curser rather than the hand?
    Eureka!!!   Just found by right clicking on the hand can then select “Select Tool” and then copy.  Hurray!!!

Maybe you are looking for

  • Workshop 8.1 beta - problem with creating Database control

    I am using Workshop 8.1 beta to create a webservice, which uses a database control to query the Db, as simpel as it comes. However, I get the following exception when I try to create the new DBControl: java.lang.AssertionError      at workshop.pagefl

  • How to delete with one click in ios7, How to delete with one click in ios7

    In ios 7 how to delete a text message/mail with one swipe? Also when u double click the home button how ro close open apps?? Thanks

  • Standard workflow trigger..

    I have a standard workflow (<b>WS20000080</b> for release of RFQ, u can check it…) in SWUI transaction. Now I want to know what are all the steps that I have to do -> <b>So that that workflow will trigger automatically whenever we release that RFQ.</

  • Select * from TABLE(tst_name_pw.list);

    Windows XP + Oracle 10.2.0.1.0 I did desc tst_name_pw and show as below: PROCEDURE Argument Name Type IN/OUT Default LIST (FUNCTION) <return value> TABLE OUT unknown I don's see table name as tst_name_pw or list in the database. Would anyone please e

  • I have Duplicates on Ipod Touch, Not Itunes.

    Okay so when i go to listen to music on my ipod, there is about 10-15 sings that are duplicated. But when i go to itunes, it says every song is a single song and i have no duplicates. I dont wish to restore my ipod because not everything is saved fro