Adding xml fragment to SOAP body (SAAJ)

Hi all,
we are using SOAP (or better SAAJ) in a modular design as packaging/enveloping format for arbitrary payloads which are generated by different modules.
How is it possible to add a xml fragment (as InputStream or DOM Node) to a SOAP Body ?
Nick
[email protected]

Hi Vicky,
I guess, we have a little misunderstanding here. The core SOAP specification defines the structure of the envelope, the "SOAP with attachments" specification extends that by defining how to add binary attachments. This is accomplished by using MIME. Every attachment is another MIMEPart, but the SOAP Envelope always has to be present as first MIMEPart. Now I don't want to add any attachments, I only want to construct a SOAP Envelope that contains arbitrary xml docs (fragments) in the body.
Look at the example below, the tags with namespace "S" belong to the SOAP specification and are built by our SOAP layer, the tags with namespace "m" belong to some other namespace and are generated by a totally different component.
My question was how I could add (within SAAJ) the xml fragment starting with "m:PurchaseOrder" to the envelope without having to add element by element.
<S:Envelope>
     <S:Header>
          ...optional header tags
     </S:Header>
     <S:Body>
                <!---from here it is a different namespace, SOAP doesn't know about PurchaseOrders>
          <m:PurchaseOrder>
               <m:position>
                    <m:article>0815</m:article>
                    <m:description>mainboard</m:description>
                    <m:price>50</m:price>
               </m:position>
               <m:position>
                    <m:article>0816</m:article>
                    <m:description>cpu</m:description>
                    <m:price>100</m:price>
               </m:position>
          </PurchaseOrder>
                <!---from here, it is SOAP again>
     </S:Body>
</S:Envelope>

Similar Messages

  • JAXB XML output as SOAP Body

    Hey,
    I currently have a psuedo webservice that pulls a string out of an http request and returns a corresponding xml document (based on a schema) to the caller. Pretty basic and it works fine. I use JAXB for the Marshalling of my objects to xml, based on the schema, so I know that my xml document is correct (well-formed and valid).
    Now, I would like to do the same thing, except as a SOAP-RPC call. I figure, for the service side, I can just wrap what I already generate in a SOAP Envelope, in response to a SOAP request. Creating the client is easy but I am having trouble with the client side. How can I simply pass an xml document as the SOAP body using Axis/JAX-RPC or whatever, instead of re-mapping to Java object, which might not guarantee the response document conforms to my schema?
    I've looked at SAAJ for this a bit, but this seems more about sending a message to a service rather than creating a response from a service....
    Any ideas?
    Mike

    Yes, it's been ten months, but have you figured out how to integrate SOAP and JAXB? I am attempting to make my SOAP client application code easy for a Java beginner to understand, so JAXB would be ideal.

  • Attaching xml document to SOAP body

    Hi,
    i have two question.
    Q1: Is it allowed to attach xml document (org.w3c.dom.Document) to SOAP body when sending request to web service.( I have implemented web service to accept attached xml document.)
    Q2: If it is allowed, how thoes the WSDL look like.
    Thanx,
    Alan.

    Hi,
    I am facing the same issue., I want to transform the xml proxy request to SOAP requesting that the business service expects.
    Did you manage to solve the issue, if so, can you please share your solution?
    Thanks

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

  • Adding XML fragments to a document in a XMLType table

    Hi,
    Is there a direct way to insert an XML fragment into a
    document held in a XMLtype, or does this have to be done
    via the updatexml function?
    thanks
    Pete

    Thank you Jeffrey. I converted the file to PDF and it worked! Very happy.

  • How to add exactly 2 NON XML caracters at the end of a SOAP body

    Hello all I am trying to add two (and only two) extra non xml caracters "AA" at the END of a SOAP body using the JAXWS handlers as so:
    HTTP/1.1 200 OK
    Content-Type: text/xml;charset=UTF-8
    Content-Length: 131
    Content-Length: 131
    Server: Jetty(7.x.y-SNAPSHOT)
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>
    AA
    The problem is that if you try to add them to the SOAP body (see code below) you get a XML Unmarshalling exception. If I add "AA" as a soap attachment I get MORE than 2 caracters after the SOAP body (which I don't want)
    Here is the my SOAPHandler code :
    @Override
    public boolean handleMessage(SOAPMessageContext mc) {
    if (Boolean.TRUE.equals(mc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) {
    try {
    SOAPMessage message = context.getMessage()
    String stringSoapMessage= getMsgAsString(message);
    stringSoapMessage += "ss";
    message.getSOAPPart().setContent((Source) new StreamSource(new ByteArrayInputStream(msg.getBytes())));
    message.saveChanges();
    context.setMessage(message);
    } catch (Exception e1) {
    return true;
    public String getMsgAsString(SOAPMessage message) throws SOAPException {
    String msg = null;
    try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    message.writeTo(baos);
    msg = baos.toString();
    } catch (Exception e) {
    e.printStackTrace();
    return msg;
    so my question is this: is there any way to add exactly 2 non xml caracters at the end of the soap body using jaxws handlers ? I have spent several weeks on this so it is not an easy question...
    Thanks,
    Fred.

    Yes I have done it using CFX interceptors. But the runtime dependencies needed were too big for this particular use. I mean having to use these:
    apache/cxf/cxf-bundle/2.6.0/cxf-bundle-2.6.0.jar
    org/apache/neethi/neethi/3.0.2/neethi-3.0.2.jar                    
    wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar
    /org/codehaus/woodstox/wstx-asl/3.2.4/wstx-asl-3.2.4.jar
    org/apache/ws/xmlschema/xmlschema-core/2.0.2/xmlschema-core-2.0.2.jar
    org/mortbay/jetty/jetty-util/6.0.2/jetty-util-6.0.2.jar
    org/eclipse/jetty/jetty-util/7.5.4.v20111024/jetty-util-7.5.4.v20111024.jar
    org/apache/geronimo/specs/geronimo-servlet_2.5_spec/1.1.2/geronimo-servlet_2.5_spec-1.1.2.jar
    org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.7.1/geronimo-javamail_1.4_spec-1.7.1.jar
    org/apache/geronimo/specs/geronimo-servlet_3.0_spec/1.0/geronimo-servlet_3.0_spec-1.0.jar
    org/eclipse/jetty/jetty-http/7.5.4.v20111024/jetty-http-7.5.4.v20111024.jar
    org/eclipse/jetty/jetty-server/7.5.4.v20111024/jetty-server-7.5.4.v20111024.jar
    org/eclipse/jetty/jetty-io/7.5.4.v20111024/jetty-io-7.5.4.v20111024.jar
    org/eclipse/jetty/jetty-continuation/7.5.4.v20111024/jetty-continuation-7.5.4.v20111024.jar
    to add two caracters at the end of a soap message seems like over kill. If this is the only way to do this then i'll do it this way but it just seems like the implementation of the JAXWS API in JDK 6 seems inches away from being able to do this no ?
    Thanks for the replies,
    Fred

  • Soap body xml different on server

    Hello,
    I am trying to verify a soap body string using a signature in the soap header. But am getting a slightly modified version of the soap message on the server side handler.
    Here is how my client side handler soap body looks:
    <n1:xyz xmlns:n1="http://localhost/edm/DocMgmtParametersRetriever">
    </n1:xyz>
    On the server side,
    <n1:xyz xmlns:n1="http://localhost/edm/DocMgmtParametersRetriever"></n1:xyz>
    The differences are:
    1.There is an extra space between n1:xyz and xmlns on the client side.
    2.There is a line break before </n1:xyz> on the client side which is not present on the server side.
    When I add following lines of code on client side, the soap body looks the same and server is able to verify the signature.
    soapBody = soapBody.replaceAll(" xmlns:"," xmlns:");
    soapBody = soapBody.replaceAll("\n","");
    soapBody = soapBody.replaceAll("\r\n","");
    soapBody = soapBody.replaceAll("\r","");
    The server is on weblogic 8.1 sp3. The webservice java client is using saaj-api.jar
    Any clue as to why there is a difference?
    Thank you

    Welcome to the forums.
    As a tip for future posts [url https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360002]2. How do I ask a question on the forums?
    That said, a basic example that pulls the contents of the body out is
    declare
      l_ws_rsp    XMLTYPE;
      l_body_rsp  XMLTYPE;
    begin
      -- Retrieving the SOAP message
      l_ws_rsp := DHL_SOAP_RESPONSE_XMLTYPE;
      -- Extracting out the body
      SELECT xt.body_xml
        INTO l_body_rsp
        FROM XMLTable(XMLNamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV"),
                      '/SOAP-ENV:Envelope/SOAP-ENV:Body/*'
                      PASSING l_ws_rsp
                      COLUMNS
                      body_xml   XMLTYPE PATH '.') xt;
       dbms_output.put_line(l_body_rsp.getClobVal());
    end;If you Google
    XMLTable soap site:forums.oracle.com
    you can find plenty of examples on these forums regarding how to parse a web service response.
    The bigger question is, what are you going to do with the data in the response. As the example above alludes too, you can actually parse the entire WS response with one SQL statement and return the results as one or more rows. Will you be performing PL/SQL logic on the returned results or will you simply be INSERTing them into the database for something else to use?

  • SOAP body and XML

    Hi,
    how can I get the body content of SOAP messages in XML format?
    I have a service that get as input a XML string, I want to create a Web Service, with this service, without change all but I have not understand how take the XML to give it to the old service.
    TIA
    Aslas

    You should check out the following in details. It
    explains to you how soap works and how you can
    implement a listener to retrieve the XML doc in
    the body.
    http://xml.apache.org/soap/docs/index.html
    Amlan

  • How to create a SOAP body based on a Serializable Object?

    Hello,
    I have a serializable object such as this one
            HeaderSection header = new HeaderSection();
            RequestName requestName = new RequestName();
            requestName.setActivityName("this is an activity");
            NNSVMessage nnsvMessage = new NNSVMessage();
            nnsvMessage.setHeaderSection(header);
            nnsvMessage.setRequestSection(request);
            nnsvMessage.setResponseSection(response);I create a SOAP message using SAAJ API
            SOAPMessage message = messageFactory.createMessage();
            SOAPPart soapPart = message.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();
    ...How can I stuff this object into the SOAP body?
    Thanks,
    Mustafa

    Hi Saleem,
    Herewith an example:
            Dim oDoc As SAPbobsCOM.Documents
            oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
            oDoc.CardCode = "530010"
            oDoc.DocDate = Date.Now
            oDoc.DocDueDate = Date.Now
            oDoc.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Service
            oDoc.Lines.ItemDescription = "Line 1"
            oDoc.Lines.Price = 100
            oDoc.Lines.VatGroup = "O1"
            oDoc.Lines.AccountCode = "0000090000"
            oDoc.Lines.Add()
            oDoc.Lines.ItemDescription = "Line 2"
            oDoc.Lines.Price = 200
            oDoc.Lines.VatGroup = "O1"
            oDoc.Lines.AccountCode = "0000090201"
            If oDoc.Add <> 0 Then
                MessageBox.Show(oCompany.GetLastErrorDescription)
            Else
                MessageBox.Show("Added")
            End If
    Hope it helps,
    Adele

  • Assign default namespace to XML fragment using XQuery

    Hi everybody!
    I need to add a default namespace declaration to a XML fragment using XQuery. I wrote following statement to assign fragment to $body:
    <soap-env:Body>{
    fn-bea:inlinedXML($content/text())}
    </soap-env:Body>
    The problem is "$content/text()" has no namespace declaration so I need to assign a default namespace (xmlns="") to it in order to apply some XQuery transformations to its content.
    I know this can be easily done with a XSLT but I would like use XQuery instead.
    Could anyone tell me how I could perform this task?
    Thank you in advance,
    Daniel.

    Re: xquery function - send namespace as binding variable and define it in a tag

  • How to alter xml output of SOAP reponse

    Hi,
    I’m using Axis2 to provide a web service, but it would helpful if I could customize the SOAP response.
    Right now I’m getting the response as mentioned below, But I have to eliminate the tags <ns:getReportDetailsResponse> and <ns:return>
    <ns:getReportDetailsResponse xmlns:ns="https://xyz.com/xyz-ws/xsd">
    <ns:return>
    <root>
    </root>
    </ns:return>
    </ns:getReportDetailsResponse>
    Does anybody have idea about how to do it?
    Thanks in advance!
    i have added wsdl, xsd, and service.xml details below,
    <!--------------------------------------------------------------DataService.wsdl------------------------------------------------------------------------------>
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:sws="https://xyz.com/xyz-ws" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns="https://xyz.com/xyz-ws/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:swr="https://xyz.com/xyz-ws/schemas/xyzwsResponse" targetNamespace="https://xyz.com/xyz-ws">
         <wsdl:types>
              <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="https://xyz.com/xyz-ws/xsd">
                   <xs:element name="getReportDetails">
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name="eid" nillable="true" type="xs:string"/>
                             <xs:element name="userName" nillable="true" type="xs:string"/>
                             <xs:element name="dataSample" nillable="true" type="xs:string"/>
                             <xs:element name="sampleDef" nillable="true" type="xs:string"/>
                                  <xs:element name="reportType" nillable="true" type="xs:string"/>
                             </xs:sequence>
                        </xs:complexType>
                   </xs:element>
              </xs:schema>               
         </wsdl:types>
         <wsdl:message name="getReportDetailsMessage">
              <wsdl:part name="part1" element="ns:getReportDetails"/>
         </wsdl:message>
         <wsdl:portType name="DataServicePortType">
              <wsdl:operation name="getReportDetails">
                   <wsdl:input message="sws:getReportDetailsMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsaw:Action="ns:getReportDetails"/>
                   <wsdl:output message="sws:ResponseMessage" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsaw:Action="ns:getReportDetails"/>
              </wsdl:operation>
         </wsdl:portType>
         <wsdl:binding name="DataServiceSOAP11Binding" type="sws:DataServicePortType">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <wsdl:operation name="getReportDetails">
                   <soap:operation soapAction="ns:getReportDetails" style="document"/>
                   <wsdl:input>
                        <soap:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>     
         </wsdl:binding>
         <wsdl:binding name="DataServiceSOAP12Binding" type="sws:DataServicePortType">
              <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
              <wsdl:operation name="getReportDetails">
                   <soap12:operation soapAction="ns:getReportDetails" style="document"/>
                   <wsdl:input>
                        <soap12:body use="literal"/>
                   </wsdl:input>
                   <wsdl:output>
                        <soap12:body use="literal"/>
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <wsdl:service name="DataService">
              <wsdl:port name="DataServiceSOAP11port" binding="sws:DataServiceSOAP11Binding">
                   <soap:address location="https://xyz.com/xyz-ws/services/DataService"/>
              </wsdl:port>
              <wsdl:port name="DataServiceSOAP12port" binding="sws:DataServiceSOAP12Binding">
                   <soap12:address location="https://xyz.com/xyz-ws/services/DataService"/>
              </wsdl:port>
         </wsdl:service>
    </wsdl:definitions>          
    <!--------------------------------------------------------------service.xml---------------------------------------------------------------------------------->
    <service name="DataService" targetNamespace="https://localhost:8080/xyz-ws/schemas/xyzwsResponse" >
    <description>xyz web services</description>
    <parameter name="ServiceObjectSupplier" locked="false">
    org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
    </parameter>
    <parameter name="SpringBeanName" locked="false">axis2ServiceEndpoint</parameter>
    <operation name="getReportDetails" />
    <messageReceivers>
    <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
    class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
    <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
    class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </messageReceivers>
    </service>
    <!--------------------------------------------------------------xyzWSResponse.xsd---------------------------------------------------------------------------------->
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:dop="https://localhost:8080/xyz-ws/schemas/xyzwsResponse" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="https://localhost:8080/xyz-ws/schemas/xyzwsResponse">
         <xsd:annotation>
              <xsd:documentation xml:lang="eng">Output XML schema </xsd:documentation>
         </xsd:annotation>
         <xsd:element name="root">
              <xsd:complexType>
                   <xsd:sequence>
                        <xsd:element name="dataC" type="dop:DataContextType" minOccurs="0"/>
                        <xsd:element name="meta" type="dop:MetadataType"/>
                        <xsd:element name="cData" type="dop:DataType" minOccurs="0" maxOccurs="unbounded"/>
                   </xsd:sequence>
              </xsd:complexType>
         </xsd:element>
         <xsd:complexType name="MetadataType">
         </xsd:complexType>     
    </xsd:schema>

    Ranjit_d wrote:
    Hi,
    I’m using Axis2 to provide a web service, but it would helpful if I could customize the SOAP response.You have use Axis handlers to customize the response of a web service. Write a Axis handler and then configure it in the outflow. Here is guide to write handlers.

  • Can't create SOAP body

    I've taken the schema for SOAP and can create an envelope, a header and a body
    with no data content. But now I can't add content; I can't create put anything
    in the body.
    It appears you can only set a Body with a Body object, but I want to put my XML/string
    into the body. Seems easy in theory, but I can't figure out how to do it. I tried
    parsing the content using a BodyDocument, but that created a fragment and I got
    weird errors:
    XmlValueNotNillableException
    or
    Tree copy contents NYI
    Help!
    Ken.

    I think all my problems were because I had old xmlBeans and interfaces. Simple
    set() methods worked, but any attempt to set a complex type failed. I just recompiled
    my schemas and tried again and it worked. The new beans have addNewXXX() methods;
    the old beans had ensureXXX() methods. Now I'm cooking with gas. ;->
    Ken.
    "Ken Kress" <[email protected]> wrote:
    >
    Eric,
    Samir passed along the suggestion to call the addBody method, but
    there is no such method in the soap interfaces I have.
    I got the schema for SOAP from: http://www.w3.org/2001/09/soap-envelope
    and compiled it. The interfaces the Body portion only list Factory methods
    of
    newInstance, parse, load, newValidatingXMLInputStream and coerce.
    The envelope has ensureBody and setBody methods, but I haven't figured
    how how
    to use them. For instance, if I do this:
    envelope.ensureHeader();
    Body tmpBody = envelope.ensureBody();
    // add the Body
    envelope.setBody( tmpBody );
    I get:
    Exception in thread "main" java.lang.RuntimeException: Tree copy contents
    NYI
    at com.bea.xbean.values.XmlObjectBase.set(XmlObjectBase.java:1480)
    at com.bea.xbean.schema.ComplexTypeMethodHandler.invoke(ComplexTypeMetho
    dHandler.java:512)
    at com.bea.xbean.schema.SchemaTypeImpl.executeComplexTypeMethod(SchemaTy
    peImpl.java:1552)
    at com.bea.xbean.values.XmlObjectBase.invoke(XmlObjectBase.java:1030)
    at $Proxy1.setBody(Unknown Source)
    at MMIMain2.buildEnvelope(MMIMain2.java:129)
    at MMIMain2.printLogonRequest(MMIMain2.java:89)
    at MMIMain2.main(MMIMain2.java:70)
    The same thing happens if I try to create my own body and then use setBody.
    Ken.
    "Eric Vasilik" <[email protected]> wrote:
    Sounds like you may want to use XmlCursor. If you get the XmlObject
    corresponding
    to the body, call newCursor(). This will return an XmlCursor whichcan
    be positioned
    insode the body (it is initiall positioned just outside the body). Then,
    create
    another cursor on the content you want to place inside the body andcall
    move()
    or copy() on the source cursor, passing the destination cursor. This
    will move/copy
    the stuff you want in the body to the body.
    "Ken Kress" <[email protected]> wrote:
    I've taken the schema for SOAP and can create an envelope, a headerand
    a body
    with no data content. But now I can't add content; I can't create put
    anything
    in the body.
    It appears you can only set a Body with a Body object, but I want to
    put my XML/string
    into the body. Seems easy in theory, but I can't figure out how to
    do
    it. I tried
    parsing the content using a BodyDocument, but that created a fragment
    and I got
    weird errors:
    XmlValueNotNillableException
    or
    Tree copy contents NYI
    Help!
    Ken.

  • Using value of  a variable in XML fragment

    Hi,
    I am assigning an xml fragment to a webservice variable. The XML fragment is as mentioned below:
    <ns2:ArrayOfKeyValuePair xmlns:ns2="http://www.themindelectric.com/package/com.taw.cca.common/"
    xsi:type="soapenc:Array"
    soapenc:arrayType="ns2:KeyValuePair[1]"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <item xsi:type="ns2:KeyValuePair">
    <key xsi:type="xsd:string">key</key>
    *<value xsi:type="xsd:string" > 1234</value>*
    </item>
    </ns2:ArrayOfKeyValuePair>
    In the above mentioned xml fragment, for the tag value I need to pass the data of a variable instead of the hardcoded string 1234. How can I resolve my issue?
    Thanks

    In the worst case, you could always resort to using scriptlets to retrieve the parameter. and set it up as an attribute in the local page scope.
    <%
    String param = (String)request.getParameter("collection");
    Collection userCollection = (Collection)request.getAttribute(param);
    pageContext.setAttribute("local_collection", userCollection);
    %>
    <forEach var="user" items="${local_collection}">
    ,,,I think this should work.
    JSTL is great, but it can't yet replace every scriptlet, much as I would like it to.

  • Missing namespace prefix in the soap body

    Hello
    The soap body that is produced along with soap header for my webservice. I
    am the client talking to a server. The first piece in RED color is what
    weblogic generates to send to the client but does NOT work. The one below
    though works fine which is what I manipulated by hand to send to the
    server. I have no idea why weblogic drops the namespace prefix in the
    BODY.
    -Narahari
    The message is as shown below
    POST /FS HTTP/1.1
    Host: asgappsrv10:6211
    Content-Type: text/xml; charset=utf-8
    Connection: close
    SOAPAction: "ListDomains"
    <?xml version="1.0" encoding="utf-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    <n1:Credentials xmlns:n1="urn:criticalpath:fs:api:1.0"
    xsi:type="n1:Credentials">
    <Username xsi:type="xsd:string">admin@default</Username>
    <Password xsi:type="xsd:string">password</Password>
    <SessionId xsi:nil="true"/>
    </n1:Credentials>
    </env:Header>
    <env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <Fulfill xmlns:n2="urn:criticalpath:fs:api:1.0"
    xsi:type="n2:Fulfill">
    <Request xsi:type="xsd:string">ListDomains</Request>
    <RequestAttributes soapenc:arrayType="n2:Attribute[0]"/>
    <Async xsi:type="xsd:boolean">false</Async>
    </Fulfill>
    </env:Body>
    </env:Envelope>
    When you see the data carefully, the env:Body has the Fulfill element. But
    it does have a namespace prefix on it. This causes the call to fail. If I
    change the above segment manally to look like
    POST /FS HTTP/1.1
    Host: asgappsrv10:6211
    Content-Type: text/xml; charset=utf-8
    Connection: close
    SOAPAction: "ListDomains"
    <?xml version="1.0" encoding="utf-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <env:Header>
    <n1:Credentials xmlns:n1="urn:criticalpath:fs:api:1.0"
    xsi:type="n1:Credentials">
    <Username xsi:type="xsd:string">admin@default</Username>
    <Password xsi:type="xsd:string">password</Password>
    <SessionId xsi:nil="true"/>
    </n1:Credentials>
    </env:Header>
    <env:Body
    env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <n2:Fulfill xmlns:n2="urn:criticalpath:fs:api:1.0"
    xsi:type="n2:Fulfill">
    <Request xsi:type="xsd:string">ListDomains</Request>
    <RequestAttributes soapenc:arrayType="n2:Attribute[0]"/>
    <Async xsi:type="xsd:boolean">false</Async>
    </n2:Fulfill>
    </env:Body>
    </env:Envelope>

    Hi All,
    we are also facing the same issue, Please provide the solution if anyone knows. We are also using the SOA Suite 11g Version.

  • Extract fields from the SOAP body during mapping

    Hi all,
    I have an Abap Proxy to SOAP scenario with a main payload and an attachment. During mapping I need the reference of the attachment to store the reference in the main payload. I don't need the attachment itself.
    SOAP-Body:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Eingangs-Message
      -->
    - <SAP:Manifest xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7">
    - <SAP:Payload xlink:href="cid:payload-E742FF47D930DE5CE1000000C107826A @sap.com">
      <SAP:Name>MainDocument</SAP:Name>
      <SAP:Description />
      <SAP:Type>Application</SAP:Type>
      </SAP:Payload>
    - <SAP:Payload xlink:href="cid:payload-EE42FF47D930DE5CE1000000C107826A @sap.com">
      <SAP:Name>hugo.txt</SAP:Name>
      <SAP:Description />
      <SAP:Type>ApplicationAttachment</SAP:Type>
      </SAP:Payload>
      </SAP:Manifest>
    I need the attachment reference as string inside my main payload: cid:payload-EE42FF47D930DE5CE1000000C107826A @sap.com
    I wrote an user defined function to select the MessageId, but the MessageId is only part of the reference to the main payload.
    String constant;
    java.util.Map map;
    map = container.getTransformationParameters();
    constant = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
    return constant;
    Has anybody an idea to get the reference of the attachment from the SOAP body with an user defined function or an adapter module?
    Thanks and kind regards
    Frank

    Hello,
    thank you all for the information. I found a solution for my problem on the sender side. I wrote an own helper class with  the method create_attach_from_txt_withref. This method  build an attachment with an own reference and write the reference back to the payload.
    This reference will not be changed within the execute_asynchronous method of the proxy.
    Method parameters:
    P_DATA        Importing   Type     STRING
    P_TYPE        Importing   Type     STRING
    P_NAME        Importing   Type     STRING
    P_ATTACHMENT  Exporting   Type Ref IF_AI_ATTACHMENT
    P_AREF        Exporting   Type     STRING
    Method coding:
    METHOD create_attach_from_txt_withref.
      DATA: lo_attachment TYPE REF TO cl_ai_attachment,
            l_payload     TYPE REF TO if_xms_payload,
            l_pref        TYPE        sxms_mf_s,
            l_guid        TYPE        guid_32,
            l_aref        TYPE        string.
      CLASS cl_ai_factory DEFINITION LOAD.
    " create the attachment
      p_attachment = cl_ai_factory=>create_attachment_from_text(
                    p_data = p_data             " attachment data
                    p_type = p_type             " attachment type
                    p_name = p_name ).          " attachment name
    " we need an implementing class of the interface if_ai_attachment
      lo_attachment ?= p_attachment.
    " get the new payload
      l_payload = lo_attachment->get_payload( ).
    " get the reference of the payload
      l_pref = l_payload->getreference( ).
    " build an own reference
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_32 = l_guid.
      CONCATENATE 'payload-' l_guid '@sap.com' INTO l_aref.
      CONCATENATE 'cid:'     l_aref            INTO l_pref-href.
    " set our own reference
      l_payload->setreference( reference = l_pref ).
    " write back the modified payload
      lo_attachment->set_payload( p_payload = l_payload ).
    " return of the reference
      p_aref = l_aref.
    ENDMETHOD.
    If anybody has an idea how to read the soap body within an adapter module please let me know.
    Regards
    Frank

Maybe you are looking for

  • After partition using fdisk, i can not see the new device file (/dev/sdd1)

    I used fdisk -l to partition /dev/sdd, use the entire disk as partition 1. it looks successful: # fdisk -l /dev/sdd Disk /dev/sdd: 10.7 GB, 10737418240 bytes 64 heads, 32 sectors/track, 10240 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes

  • Bridge Fails to Load Thumbnails

    Bridge can not load a folder with 200 images in CR2 and jpg format. Getting answers from Adobe is worse than trying to penetrate the NSA. Anyone out there have any suggestions. I've purged cache, set the to the middle of the slider, clicked compact c

  • File Sender, Content Conversion - how to define variable length last field?

    XI 3.0 SP17 With a File Sender communication channel, that uses Content Conversion - how do I define a 'variable length' last field? The scenario - the input file has four fields, of which the first three are a known fixed length, and the last (fourt

  • How can I set Address Book to stop auto importing all addresses

    My Addresss Book seems to add any and all email addresses, willy nilly, from emails sent me. I have over 3000 entries , most of which are addresses I do not know. I want this to stop. What setting do I use? Where? I only want addresses which I decide

  • SOAP : No adapter registered for this channel

    hello everybody, i'm working with a PI 7.1 i have a interface RFC - PI - SOAP. when i look on Communication Channel Monitor i see this error on my soap CC No adapter registered for this channel i restart J2ee and applicate CPA cache refresh. i tryed