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

Similar Messages

  • 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

  • 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

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

  • 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();

  • 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

  • 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

  • JWSDP1.4 Access the SOAP Message in an RPC server

    hi i am new to web services... i have created RPC using JSWDP 1.4.
    I used the wscompile and wsdeploy tool to create the WSDL and server side of the web service.
    but because of a requirement change now i have to get the SOAP message Header and verify the client details (log who is using my service). How can i access the SOAP header??

    Make a backup then edit this file,
    TomcatRoot: ./shared/classes/com/tarantella/tta/webservices/client/apis/Resources.properties
    Edit all locations to point to https://localhost:443

  • HT2284 Recurring "connection failed" when selecting TimeCapsule in the sidebar (internet connection works fine).  Clicking "Connect As" starts the cyle over again but ends in "There was a problem connection to the server" message.  Only fix is resetting T

    Recurring "connection failed" when selecting TimeCapsule in the sidebar (internet connection works fine).  Clicking "Connect As" starts the cyle over again but ends in "There was a problem connection to the server" message.  Only fix is resetting TC.
    The TC is the wifi base station, also have AirportExpress on the network, both of which work fine.  The TC has an external disc connected as well, which is also visible in the sidebar but also cannot be connected to.  Several MB computers use the network, all of which either can or cannot connect to the TC disc depending on when it is acting up.
    Any ideas other than clicking "connect as" or powering down the network every time? 

    Read up how to install 5.6 utility into ML.. it is pretty easy.
    I downloaded 5.6
    http://support.apple.com/kb/DL1482
    Download unpkg
    http://www.timdoug.com/unpkg/
    Open the dmg to get the pkg.. drag it onto unpkg.. and it will create a directory under desktop with all the files.. drag the application to the utility directory.. or just run it direct.
    Google if you want more explicit instructions.
    Much easier with a real tool instead of a toy.
    Hold the option key when you select firmware update.. all the old ones will appear.
    But this will not work on newer Gen4.. only on every other model and early Gen4. .I do not know when they turned the corner and started this only 7.6 nonsense.

  • Traping the SOAP message before making the call.

    We are using the axis for Web services, it works fine,
    Here is my question, before the call go out to third party services, I need to log the SOAP message into our logging system. How would I trap the message?
    Thanks in advance.
    -APK.

    I tried to achieve that using the following:
    http://e-docs.bea.com/wls/docs81/webserv/interceptors.html#1072668
    But it doesn't seem to work. try it!!
    -k

  • Problem: Applets cannot Create SOAP Message Objects using JAX Pack

    Hi all
    I want to invoke a simple webservice located at a url.
    I wish to send a SOAP Message . The Message is creating using
    javax.xml.soap package
    Here is the code
    public void init(){
    try{
    MessageFactory MF = MessageFactory.newInstance();
    SOAPMessage message = MF.createMessage();
    SOAPPart SP = message.getSOAPPart();
    SOAPEnvelope SE = SP.getEnvelope();
    SOAPHeader SH = SE.getHeader();
    SOAPBody SB = SE.getBody();
    Name bodyName = SE.createName
    ("testString","L","http://tempuri.org/");
    SOAPBodyElement SBE = SB.addBodyElement(bodyName);
    }catch(Exception e){}
    When I run the applet in a browser I am getting ExceptionInInitializerError or NullPointer Exception.
    The same application works when i run as a standalone application. But not in APPLET.
    Can somebody help me in this regard

    Im trying to do the same thing !!, i have a servlet that processes SOAP messages, and return SOAP messages back.
    Like you i have a implementation running with a stand alone client instead of an applet, which runs fine (there are several .jar files that have to be included in the jre/lib/ext directory, in total about a meg!).
    Im now looking to incorporate this client into an applet, but it moans about cannot find classes (the JAXM and SOAP classes).
    Have you found a solution to this yet ?? Surely you cannot expect the user to download all the required jar files along with the applet??
    With regards to your problem try setting up a button that fires off the SOAP Msg and processes the response, i read on the Sun Java Applet tutorials that some code should stay out of the init method(its a bit vague about WHAT should stay out..), maybe this is an example.
    Thanks,
    (i dont really expect a response as you posted this ages ago !!, but it would be nice.)

  • When trying to uninstall iTune (because the current install has problems), I get the error message 2324.  What should I do to reinstall the application?

    When trying to uninstall iTune (because the current install has problems; iTune error message states it cannot sync and that I should reinstall the application; also, it fails when I tried to upgrade to the latest release), I get the error message 2324.  What should I do to reinstall the application?

    That installer error is a "Can't open file" error
    It suggest that you may have a corrupt file.
    Try running a disk check
    http://windows.microsoft.com/en-US/windows7/Check-a-drive-for-errors
    If it fixes errors try uninstalling iTunes again.
    If that doesn't work, is it possible for find out the name of the problem file, is further information available? Try looking in your Action center - that's on the control panel. Another place is in the Windows Error logs. From the start menu , right click on "Computer" and select manage, then Event viewer.
    If nothing emerges, try a manual uninstall of iTunes and related programs according to this method:
    http://support.apple.com/kb/HT1923
    Don't worry if an uninstall fails, that is expected. Go on to the part where you have to delete files (2. Verify iTunes etc completely deleted) . Hopefully you manage to find a file that can't be deleted, that is the one we will need to deal with.

  • There was a problem connecting to the server message - displayed when pressing printer email address

    HP Photosmart B210, Windows 7...was able to print from iphone yesterday but now will not print. One the face of the printer if the ePrint symbol is pressed for the printer address the message "there was a problem connecting to the server" appears. I can find the device with my phone and on my computer. I can print from the computer but not phone

    I understand you are getting unable to connect to server error message on your printer. I would first unplug router and printer for about 1 minute. I would plug router up first then printer. I would then try to enable web services. If not successful and you get same error message. I would follow these steps.
    1. Obtain your printer's IP address
    a. This can be done by pressing the wireless icon on printer.
    2. Enter the printer's IP address in a browser.
    3. Select the network tab at the top of the page.
    4. On the left select networking.
    5. Select Network Address (IP)
    6. Select Manual DNS Server
    a. Manual Preferred DNS should read 8.8.8.8
    b. Alternate DNS Server should read. 8.8.4.4
    7. Select apply you might get a warning just select okay.

  • There was a problem connecting to the server message

    I have started to get the following message when I run Final Cut Pro X There was a problem connecting to the server “soundmedia”
    The “sound media” server is a PC running windows XP and is switched off.
    I closed all libraries & set up a new library - with nothing in it. There was a problem connecting to the server “soundmedia” still appears. when "ok" is clicked the message clears then reappears 10-15 sec later.
    I have tried the following:
    Cleared recent servers in Finder ie 
    Finder, Go, Connect to Server, then Click on the little clock in “connect to server window” then click clear recent servers.
    Deleted FCPX preferences by:
    press and hold Option + Cmd while launching FCP X from the Dock. A dialog appears asking if you want to trash Final Cut’s preference files. Clicked Delete
    Deleted all FCPX entries in OS X/ Library/Preferences  & deleted all entries in Trash before reloading FCPX
    Repaired permissions on system disc
    Created  a new user.  “There was a problem connecting to the server “soundmedia” has not reappear on the new user.
    If I switch on the soundmedia server & click “ok” the message disappears (when I am logged in
    to my original account.)
    I am the only user on this iMac, something must be wrong with my user account. Any ideas
    what it might be? Has anyone got a software patch that can be loaded to prevent the message
    from constantly reappearing? Once acknowledged it surely shouldn’t keep reappearing.
    It is a nuisance and a waste of energy having to have a server which is not required powered
    up just so the message does not reappear.

    I understand you are getting unable to connect to server error message on your printer. I would first unplug router and printer for about 1 minute. I would plug router up first then printer. I would then try to enable web services. If not successful and you get same error message. I would follow these steps.
    1. Obtain your printer's IP address
    a. This can be done by pressing the wireless icon on printer.
    2. Enter the printer's IP address in a browser.
    3. Select the network tab at the top of the page.
    4. On the left select networking.
    5. Select Network Address (IP)
    6. Select Manual DNS Server
    a. Manual Preferred DNS should read 8.8.8.8
    b. Alternate DNS Server should read. 8.8.4.4
    7. Select apply you might get a warning just select okay.

Maybe you are looking for

  • DMS and Content Server in ECC 6

    Dear colleagues. IN ECC 6 there is a internal BSP based content server, that allows store the document in the main SAP Database. In case of great number of documnets. managed in DMS, can in impact performance of all ECC 6 applications. Does it make s

  • [Solved]Installed AMD Catalyst drivers. Are they activated?

    This must be a really stupid question. I have installed the Catalyst drivers from the repo, but in KinfoCenter I'm getting something else: It's not a VMware installation, it's alongside Windows. So, am I using the Catalyst drivers or not? Thanks. Las

  • InCopy CS4 display language problem

    Our organization has just installed InCopy CS4 (Win version). Suppose we all install Chinese version, so the display of InCopy CS4 should be Chinese. However, we found that some of our computers display english. How can we change back to display Chin

  • Yostemite kills Apple wired keyboard

    After upgrading our school iMac suite to Yosemite I've discovered several stations no longer detect the Apple wired keyboard. 10.10.1 is installed on every machine. We have 5 Mid 2011 models and 15 Late 2012 models. The issue seems pretty random, app

  • I can open the program and see it's running, but the window is invisible or too small to see.

    I've tried scanning the help forums and was told that it's probably a corrupted file that saves my preferences upon closing, but all in the info I can find about this is for earlier releases. I've tried clearing caches, opening images that might forc