SOAP.streamEncode loses trailing nulls

I am trying to base64 encode data for a web service call using the SOAP.streamEncode method but am losing any trailing characters.
The following code, that encodes a string and then decodes the stream shows the problem I am having;
>var string2 = new String("\xF4\x09\xB2\x0q\x00\x00\x00\x00");
var encode2 = SOAP.streamEncode(SOAP.streamFromString(string2), "base64");
var decode2 = SOAP.streamDecode(SOAP.streamEncode(SOAP.streamFromString(string2), "base64"), "base64");
console.println("string2.length " + string2.length);
console.println("string2 " + string2.toSource());
var encode2String = SOAP.stringFromStream(encode2);
console.println("encode2.length " + encode2String.length);
console.println("encode2 " + encode2String);
var decode2String = SOAP.stringFromStream(decode2);
console.println("decode2.length " + decode2String.length);
console.println("decode2 " + decode2String.toSource());
This displays the following on the console;
>string2.length 10
string2 (new String("\xF4\t\xB2x0q\x00\x00\x00\x00"))
encode2.length 8
encode2 9AmyeDBx
decode2.length 6
decode2 (new String("\xF4\t\xB2x0q"))
The last line should have returned the same string as I started with.
Has anyone else encountered this problem and found a workaround?
My initial aim was to submit attached documents to my web service. These are generally Word documents which appear to always contain trailing spaces. I know I could use hex encoding (and am currently doing this) but hex encoding doubles the size of attachment and I am getting complaints about the response times

Having played with this problem some more it seems the SOAP.stringFromStream function stops when it encounters the first null character (as PDL mentioned above, though JavaScript handles nulls as the length of string2 in the example above is 10). This also seems to be the case when using a ReadStream object as a parameter to a web service call or when using Message Transmission Optimization Mechanism (MTOM), which I assume use the same function.
I have written my own Base64 encoding but have not yet worked out if the time taken is worth saving the 33% of the transmission size.
If anyone is interested;
var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split("");
function EncodeHexString(hexString)
var result = "";
var padding = "";
for (i = (hexString.length * 2) % 3; i > 0 && i < 3; i++)
padding += '=';
hexString += "00";
for (i = 0; i < hexString.length; i += 6)
var n = (parseInt(hexString.substring(i, i+2), 16) << 16) + (parseInt(hexString.substring(i+2, i+4), 16) << 8 ) + (parseInt(hexString.substring(i+4, i+6), 16));
result += base64chars[(n >>> 18) & 63] + base64chars[(n >>> 12) & 63] + base64chars[(n >>> 6) & 63] + base64chars[n & 63];
return result.substring(0, result.length - padding.length) + padding;
This takes the hex string that you would get from a call to SOAP.streamEncode, e.g.
>SOAP.stringFromStream(SOAP.streamEncode(pdf.getDataObjectContents("file"), "hex"))

Similar Messages

  • SOAP Fault Exception [Actor null]

    Hi All,
    Im trying to call a webservice from portal This web service is in ECC. When I try to call it, it throws the following error:
    #1.5 #00E0ED0BA5EF005C000000C500001E350004532D85C22E36#1217354889571#com.sap.portal.SOAPLogger#sap.com/irj#com.sap.portal.SOAPLogger#TESTUSER#9868##n/a##4b8f60d05d9911dda9db00e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_4##0#0#Warning#1#/System/Server#Java###Call failed
    [EXCEPTION]
    {0}#1#SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'
    <Host>undefined</Host>
    <Component>APPL</Component>
    <ChainedException>
      <Exception_Name>CX_SOAP_CORE</Exception_Name>
      <Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element &apos;ItItem&apos;</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_SXMLP</Exception_Name>
      <Exception_Text>XSLT exception</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
      <Exception_Text>System expected element &apos;ItItem&apos;: Main Program:/1BCDWB/WSSC9FCD3336732797F332| Program:/1BCDWB/WSSC9FCD3336732797F332| Line: 11| Valid:X</Exception_Text>
    </ChainedException>
    #1.5 #00E0ED0BA5EF005C000000C700001E350004532D85C23109#1217354889572#System.err#sap.com/irj#System.err#BHARDWS#9868##n/a##4b8f60d05d9911dda9db00e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_4##0#0#Error##Plain###SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'
    <Host>undefined</Host>
    <Component>APPL</Component>
    <ChainedException>
      <Exception_Name>CX_SOAP_CORE</Exception_Name>
      <Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element &apos;ItItem&apos;</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_SXMLP</Exception_Name>
      <Exception_Text>XSLT exception</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
      <Exception_Text>System expected element &apos;ItItem&apos;: Main Program:/1BCDWB/WSSC9FCD3336732797F332| Program:/1BCDWB/WSSC9FCD3336732797F332| Line: 11| Valid:X</Exception_Text>
    </ChainedException>
    #1.5 #00E0ED0BA5EF005C000000C800001E350004532D85C231DF#1217354889572#System.err#sap.com/irj#System.err#BHARDWS#9868##n/a##4b8f60d05d9911dda9db00e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_4##0#0#Error##Plain###We are in Exception and got the message778: SOAP Fault Error (n.a) : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'ItItem'#
    Has anyone come across this? Please help by giving directions on how to fix this.
    Thanks
    SB

    Hi Alex,
    Please ignore the above bapi call, it is too complex since it is a custom BAPI that Im trying to call. For now, I am trying to call a very simple BAPI --> BAPI_CUSTOMER_GETDETAIL just to make sure that communication is happening.
    Here is the WSDL:
      <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:rfc:functions">
    - <wsdl:documentation>
      <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" />
      </wsdl:documentation>
    - <wsdl:types>
    - <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">
    - <xsd:simpleType name="char1">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="1" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char10">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="10" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char130">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="130" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char16">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="16" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char2">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="2" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char20">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="20" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char220">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="220" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char3">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="3" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char30">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="30" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char31">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="31" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char32">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="32" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char35">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="35" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char4">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="4" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char5">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="5" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="char50">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="50" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="cuky5">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="5" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="date">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="10" />
      <xsd:pattern value="\d\d\d\d-\d\d-\d\d" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="lang">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="1" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="numeric3">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="3" />
      <xsd:pattern value="\d*" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:simpleType name="numeric6">
    - <xsd:restriction base="xsd:string">
      <xsd:maxLength value="6" />
      <xsd:pattern value="\d*" />
      </xsd:restriction>
      </xsd:simpleType>
    - <xsd:complexType name="BAPIRET2">
    - <xsd:sequence>
      <xsd:element name="TYPE" type="tns:char1" />
      <xsd:element name="ID" type="tns:char20" />
      <xsd:element name="NUMBER" type="tns:numeric3" />
      <xsd:element name="MESSAGE" type="tns:char220" />
      <xsd:element name="LOG_NO" type="tns:char20" />
      <xsd:element name="LOG_MSG_NO" type="tns:numeric6" />
      <xsd:element name="MESSAGE_V1" type="tns:char50" />
      <xsd:element name="MESSAGE_V2" type="tns:char50" />
      <xsd:element name="MESSAGE_V3" type="tns:char50" />
      <xsd:element name="MESSAGE_V4" type="tns:char50" />
      <xsd:element name="PARAMETER" type="tns:char32" />
      <xsd:element name="ROW" type="xsd:int" />
      <xsd:element name="FIELD" type="tns:char30" />
      <xsd:element name="SYSTEM" type="tns:char10" />
      </xsd:sequence>
      </xsd:complexType>
    - <xsd:complexType name="BAPIKNA101">
    - <xsd:sequence>
      <xsd:element name="FORM_OF_AD" type="tns:char30" />
      <xsd:element name="FIRST_NAME" type="tns:char35" />
      <xsd:element name="NAME" type="tns:char35" />
      <xsd:element name="NAME_3" type="tns:char35" />
      <xsd:element name="NAME_4" type="tns:char35" />
      <xsd:element name="DATE_BIRTH" type="tns:date" />
      <xsd:element name="STREET" type="tns:char35" />
      <xsd:element name="POSTL_CODE" type="tns:char10" />
      <xsd:element name="CITY" type="tns:char35" />
      <xsd:element name="REGION" type="tns:char3" />
      <xsd:element name="COUNTRY" type="tns:char3" />
      <xsd:element name="COUNTRNISO" type="tns:char3" />
      <xsd:element name="COUNTRAISO" type="tns:char3" />
      <xsd:element name="INTERNET" type="tns:char130" />
      <xsd:element name="FAX_NUMBER" type="tns:char31" />
      <xsd:element name="TELEPHONE" type="tns:char16" />
      <xsd:element name="TELEPHONE2" type="tns:char16" />
      <xsd:element name="LANGU" type="tns:lang" />
      <xsd:element name="LANGU_ISO" type="tns:char2" />
      <xsd:element name="CURRENCY" type="tns:cuky5" />
      <xsd:element name="CURRENCY_ISO" type="tns:char3" />
      <xsd:element name="COUNTRYISO" type="tns:char2" />
      <xsd:element name="ONLY_CHANGE_COMADDRESS" type="tns:char1" />
      </xsd:sequence>
      </xsd:complexType>
    - <xsd:complexType name="BAPIRETURN">
    - <xsd:sequence>
      <xsd:element name="TYPE" type="tns:char1" />
      <xsd:element name="CODE" type="tns:char5" />
      <xsd:element name="MESSAGE" type="tns:char220" />
      <xsd:element name="LOG_NO" type="tns:char20" />
      <xsd:element name="LOG_MSG_NO" type="tns:numeric6" />
      <xsd:element name="MESSAGE_V1" type="tns:char50" />
      <xsd:element name="MESSAGE_V2" type="tns:char50" />
      <xsd:element name="MESSAGE_V3" type="tns:char50" />
      <xsd:element name="MESSAGE_V4" type="tns:char50" />
      </xsd:sequence>
      </xsd:complexType>
    - <xsd:element name="BAPI_TRANSACTION_COMMIT">
    - <xsd:complexType>
    - <xsd:sequence>
      <xsd:element name="WAIT" type="tns:char1" minOccurs="0" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
    - <xsd:element name="BAPI_TRANSACTION_COMMITResponse">
    - <xsd:complexType>
    - <xsd:sequence>
      <xsd:element name="RETURN" type="tns:BAPIRET2" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
    - <xsd:element name="BAPI_CUSTOMER_GETDETAIL">
    - <xsd:complexType>
    - <xsd:sequence>
      <xsd:element name="CUSTOMERNO" type="tns:char10" />
      <xsd:element name="PI_DISTR_CHAN" type="tns:char2" minOccurs="0" />
      <xsd:element name="PI_DIVISION" type="tns:char2" minOccurs="0" />
      <xsd:element name="PI_PASS_BUFFER" type="tns:char1" minOccurs="0" />
      <xsd:element name="PI_SALESORG" type="tns:char4" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
    - <xsd:element name="BAPI_CUSTOMER_GETDETAILResponse">
    - <xsd:complexType>
    - <xsd:sequence>
      <xsd:element name="PE_ADDRESS" type="tns:BAPIKNA101" />
      <xsd:element name="RETURN" type="tns:BAPIRETURN" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      </xsd:schema>
      </wsdl:types>
    - <wsdl:message name="BAPI_TRANSACTION_COMMIT">
      <wsdl:part name="parameters" element="tns:BAPI_TRANSACTION_COMMIT" />
      </wsdl:message>
    - <wsdl:message name="BAPI_TRANSACTION_COMMITResponse">
      <wsdl:part name="parameter" element="tns:BAPI_TRANSACTION_COMMITResponse" />
      </wsdl:message>
    - <wsdl:message name="BAPI_CUSTOMER_GETDETAIL">
      <wsdl:part name="parameters" element="tns:BAPI_CUSTOMER_GETDETAIL" />
      </wsdl:message>
    - <wsdl:message name="BAPI_CUSTOMER_GETDETAILResponse">
      <wsdl:part name="parameter" element="tns:BAPI_CUSTOMER_GETDETAILResponse" />
      </wsdl:message>
    - <wsdl:portType name="YCUST">
    - <wsdl:operation name="BAPI_TRANSACTION_COMMIT">
      <wsdl:input message="tns:BAPI_TRANSACTION_COMMIT" />
      <wsdl:output message="tns:BAPI_TRANSACTION_COMMITResponse" />
      </wsdl:operation>
    - <wsdl:operation name="BAPI_CUSTOMER_GETDETAIL">
      <wsdl:input message="tns:BAPI_CUSTOMER_GETDETAIL" />
      <wsdl:output message="tns:BAPI_CUSTOMER_GETDETAILResponse" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="YCUST" type="tns:YCUST">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="BAPI_TRANSACTION_COMMIT">
      <soap:operation soapAction="" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="BAPI_CUSTOMER_GETDETAIL">
      <soap:operation soapAction="" style="document" />
    - <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
    - <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="service">
    - <wsdl:port name="YCUST" binding="tns:YCUST">
      <soap:address location="http://myportal:8040/sap/bc/srt/rfc/sap/ycust/040/ycust/ycust" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    As you will see below in my portal component, Im populating the four fields that it requires:
    public class WS_ECC_Service extends PageProcessorComponent {
      public DynPage getPage(){
        return new WS_ECC_ServiceDynPage();
      public static class WS_ECC_ServiceDynPage extends JSPDynPage{
         protected IPortalComponentRequest request;
               protected IPortalComponentResponse response;
               protected IPortalComponentSession session;
               protected IPortalComponentContext context;
               protected IPortalComponentProfile profile;
               protected String userId;
         //      protected IUser epUser;
               protected String sapSystem;
               protected String fileName;
               private DAO DAO = null;
         //      private FileUploadUtility FIU = null;
         //      private ReadExcelData RED = null;
               private final static int SUCCESS_STATE = 0;   
               private final static int INITIAL_STATE = 1;
               private final static int ERROR_STATE = 2; 
               private int state = INITIAL_STATE;
        public void doInitialization(){
          this.communicate();
          // fill your bean with data here...
         public void communicate()throws IllegalArgumentException{     
                                  try{                  
                                          IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
                                       IYBAPI_Service myService = (IYBAPI_Service)runtimeResources.getService(IYBAPI_Service.KEY);
                                                         System.err.println("b4 passing object to service Anurag-"+IYBAPI_Service.KEY);
                                       com.ybapi.BAPI_CUSTOMER_GETDETAIL param = new com.ybapi.BAPI_CUSTOMER_GETDETAIL();
                                       com.ybapi.BAPI_CUSTOMER_GETDETAILResponse result1 = new com.ybapi.BAPI_CUSTOMER_GETDETAILResponse();
                                       com.ybapi.Char10 custno = new com.ybapi.Char10();
                                       custno.setValue("0000009702");                 
                                       param.setCUSTOMERNO(custno);
                                       com.ybapi.Char2 distr = new com.ybapi.Char2();
                                       distr.setValue("12");                 
                                       param.setPI_DISTR_CHAN(distr);
                                       param.setPI_DIVISION(distr);
                                       com.ybapi.Char1 buff = new com.ybapi.Char1();
                                       buff.setValue("w");                 
                                       param.setPI_PASS_BUFFER(buff);
                                       com.ybapi.Char4 sorg = new com.ybapi.Char4();
                                       sorg.setValue("0001");                 
                                       param.setPI_SALESORG(sorg);
                                       result1 = myService.BAPI_CUSTOMER_GETDETAIL(param);
                                    System.err.println("message message dear message : - " + result1.getPE_ADDRESS().getNAME());
                                  }catch (IllegalArgumentException ex){
                                  System.err.println("Getting details2 " + ex.getMessage());
                                  }catch (Exception e) {
                                  e.printStackTrace();
                                  System.err.println("We are in Exception and got the message778: " + e.getMessage());
                                  }//end try catch
        public void doProcessAfterInput() throws PageException {
        public void doProcessBeforeOutput() throws PageException {
          this.setJspName("uploadutility.jsp");
    and this is what it is throwing the error, exactly the same that I got in my above post which I asked you to ignore.
    #1.5 #00E0ED0BA5EF006E0000015A00001E350004533EB66A08B6#1217428720322#com.sap.portal.SOAPLogger#sap.com/irj#com.sap.portal.SOAPLogger#BHARDWS#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Warning#1#/System/Server#Java###Call failed
    [EXCEPTION]
    {0}#1#SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'
    <Host>undefined</Host>
    <Component>APPL</Component>
    <ChainedException>
      <Exception_Name>CX_SOAP_CORE</Exception_Name>
      <Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element &apos;CUSTOMERNO&apos;</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_SXMLP</Exception_Name>
      <Exception_Text>XSLT exception</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
      <Exception_Text>System expected element &apos;CUSTOMERNO&apos;: Main Program:/1BCDWB/WSSB675FB6DBC9770445BC| Program:/1BCDWB/WSSB675FB6DBC9770445BC| Line: 19| Valid:X</Exception_Text>
    </ChainedException>
    #1.5 #00E0ED0BA5EF006E0000015C00001E350004533EB66A09BD#1217428720322#System.err#sap.com/irj#System.err#BHARDWS#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Error##Plain###$$$$$$$$$$$$$exex-SOAP Fault Error (n.a) : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'#
    #1.5 #00E0ED0BA5EF006E0000015D00001E350004533EB66A0B44#1217428720323#System.err#sap.com/irj#System.err#BHARDWS#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Error##Plain###SOAP Fault Exception [Actor null] : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'
    <Host>undefined</Host>
    <Component>APPL</Component>
    <ChainedException>
      <Exception_Name>CX_SOAP_CORE</Exception_Name>
      <Exception_Text>CX_ST_MATCH_ELEMENT:XSLT exception.System expected element &apos;CUSTOMERNO&apos;</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_SXMLP</Exception_Name>
      <Exception_Text>XSLT exception</Exception_Text>
    </ChainedException>
    <ChainedException>
      <Exception_Name>CX_ST_MATCH_ELEMENT</Exception_Name>
      <Exception_Text>System expected element &apos;CUSTOMERNO&apos;: Main Program:/1BCDWB/WSSB675FB6DBC9770445BC| Program:/1BCDWB/WSSB675FB6DBC9770445BC| Line: 19| Valid:X</Exception_Text>
    </ChainedException>
    #1.5 #00E0ED0BA5EF006E0000015E00001E350004533EB66A0B93#1217428720323#System.err#sap.com/irj#System.err#TESTUSER#17255##n/a##2aaa48605e4511ddbbf300e0ed0ba5ef#SAPEngine_Application_Thread[impl:3]_2##0#0#Error##Plain###We are in Exception and got the message778: SOAP Fault Error (n.a) : CX_ST_MATCH_ELEMENT:XSLT exception.System expected element 'CUSTOMERNO'#

  • How to handle trailing Null columns in a Batch file when ESB reads the file

    Dear All,
    How can I handle trailing Null columns in a batch file (csv file) that is been used by an ESB FTP adapter for batch file processing.
    Since ESB is some times taking up the whole next record as the last column data..
    Please update
    many thanks...

    If your file is not designed to be amazingly large, then you don't need to use a temporary file -- you can just read the data into memory and manipulate it there. (Like, into a Document object or something.)
    But if you are dealing with really large files, you might want to consider using a database back end instead of a text file, which is a completely different approach I know but... well, that's why databases were invented.

  • Error creating index (trailing null missing from STR bind value)

    I'm having the following error:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-50857: oracle error in dreii0fsh
    ORA-01480: trailing null missing from STR bind value
    ORA-06512: at "CTXSYS.DRUE", line 157
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 176
    ORA-06512: at line 1
    my script is:
    create index IDX_XML on EN_TESTE_XML(TXT_XML_CURRICULO)
    indextype is ctxsys.context;
    My Oracle is 9.0.1
    TXT_XML_CURRICULO -> XMLTYPE then
    the section group is PATH_SECTION_GROUP by default.
    thanks.
    Marlon

    If you get an OCI error when simply updating a record in PL/SQL Developer, it sounds like a PL/SQL Developer issue, although not one I've come across. You might try Allround Automations tech support. They'll need your exact versions of Oracle server, Oracle client and PL/SQL Developer.
    SQL*Plus is part of the Oracle Client software so you should have it somewhere, or you can download it free.

  • Trailing null missing -- no clue

    Hi all,
    (linux/glibc2.24(?)/gcc2.96/oracle9.2.0.3/pthread)
    Myapp runs as a server(C code, uses oracle call interface internally). It is launched via a shell scripts like below by user -- staffme:
    #start
    WORKING_DIR=/opt/appserver
    cd $WORKING_DIR
    ./myapp
    #EOF
    It always gets an err (ORA-01480: trailing null missing from STR bind value)on a CERTAIN function call(other funcations which have different sql stmt,
    bind params work just fine) under this dir(/opt/appserver/). If I copy everything of this dir into /home/staffme/test/, the only exception is a
    core file(which is big, owned by root, can't read), and change WORKING_DIR to /home/staffme/test, it works just fine with same input.
    All files the app needs are in above dir. The shell script does NOT change any variables' value based on differnt dir.
    Thanks for any help!

    If you get an OCI error when simply updating a record in PL/SQL Developer, it sounds like a PL/SQL Developer issue, although not one I've come across. You might try Allround Automations tech support. They'll need your exact versions of Oracle server, Oracle client and PL/SQL Developer.
    SQL*Plus is part of the Oracle Client software so you should have it somewhere, or you can download it free.

  • SOAP Fault when returning null from a Native Web Service Stored Procedure

    I have a stored procedure which I can successfully invoke via soapUI
    However, if one of the Stored Procedure's OUT arguments is set to null the native web service returns the following fault :
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Client</faultcode>
    <faultstring>Error processing input</faultstring>
    <detail>
    <OracleErrors xmlns="http://xmlns.oracle.com/orawsv/faults">
    <OracleError>
    <ErrorNumber>ORA-19202</ErrorNumber>
    <Message>Error occurred in XML processing</Message>
    </OracleError>
    <OracleError>
    <ErrorNumber>ORA-01405</ErrorNumber>
    <Message>fetched column value is NULL</Message>
    </OracleError>
    </OracleErrors>
    </detail>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>I can see how to control the processing of null values when invoking orawsv (using the null_handling element).
    Is there an equivalent for Stored Procedures ?
    Thanks,
    PD
    versions as follows :
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production

    Without going into any technical discussion about the code, my first question is what JDK version was used to create this which was imported into the form? Understand that Forms 10 runs on JDK 1.4.2, so if you used any newer JDK version, likely there will be problems.

  • Oaam soap call: requestName is null, xmlParamater is null ??

    Hi,
    I have a basically set up OAAM 11.1.5 with the web services turned on.
    I used SOAP UI to point to the VCryptTrackerWS wsdl to generate a project so I could test requests and responses.
    I then created a WAR deployed on tomcat using the soap api client jar to make calls as well.
    After a while I have both SOAP UI and the WAR generating the same message and getting the same response. In the OAAM server logs the web service endpoint thinks that it has not received a real message (or unmarshalled the SOAP message) complaining that the requestName and xmlParameter elements in the execute node are null.
    While I get a response I believe that something is not quite right, but am at a loss as to where to start looking.
    The request and response XMLs are as follows:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:vcr="http://jaxws.oracle.com/oaam_ws/services/VCryptTrackerWS">
    <soapenv:Header/>
    <soapenv:Body>
    <vcr:execute>
    <requestName>trackerInit</requestName>
    <xmlParameter>&lt;String&gt;&lt;value&gt;&lt;&lt;[CDATA[Server Warmup]]&gt;&lt;/value&gt;&lt;/String&gt;</xmlParameter>
    </vcr:execute>
    </soapenv:Body>
    </soapenv:Envelope>
    response:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <ns0:executeResponse xmlns:ns0="http://jaxws.oracle.com/oaam_ws/services/VCryptTrackerWS">
    <return xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    </ns0:executeResponse>
    </env:Body>
    </env:Envelope>
    regards,
    dp

    Hi,
    It's just a limitation of PL/SQL that we have to deal with... from the documentation: "Records cannot be tested for nullity, or compared for equality, or inequality".
    If you really need to do this check you may want to create a function for it:
    function t_flight_rec_is_null (
       p_rec in t_flight%rowtype
    ) return boolean
    is
    begin
       return p_rec.field1 is null and p_rec.field2 is null ... and p_rec.fieldN is null;
    end;cheers,
    Anthony

  • Using excel vi's loses trailing zeroes

    I've been given to write a program that saves columns of numbers to a txt
    file that is in the format of spreadsheet. All the numbers in this file are
    3 places format even if there are trailing zeroes. I am using the excel
    vi's that I downloaded from NI. When I save the file all the numbers lose
    their trailing zeroes. So when the user opens the file using notepad the
    columns tend to not line up anymore. I can format the numbers I am writing
    into strings, but still all the rest of the spreadsheet loses its trailing
    zeroes. I wrote a quick fix that reads all 32 columns and reformats them as
    strings with 3 places, but that is kind of a kludge. Is there a better way?

    "Greg McKaskle" wrote in message
    news:[email protected]..
    > > I've been given to write a program that saves columns of numbers to a
    txt
    > > file that is in the format of spreadsheet. All the numbers in this file
    are
    > > 3 places format even if there are trailing zeroes. I am using the excel
    > > vi's that I downloaded from NI. When I save the file all the numbers
    lose
    > > their trailing zeroes. So when the user opens the file using notepad
    the
    > > columns tend to not line up anymore. I can format the numbers I am
    writing
    > > into strings, but still all the rest of the spreadsheet loses its
    trailing
    > > zeroes. I wrote a quick fix that reads all 32 columns and reformats
    them as
    > > strings with 3 places, but that is
    kind of a kludge. Is there a better
    way?
    >
    > I'm not positive that I understand what is going on, but if you have
    access
    > to the diagrams, you should look for where the numbers are formatted. To
    > format a number as a string and pad with zeroes, you can change the format
    > to %0f, or %08.3f for eight chars with three decimal chars and filled with
    > zeroes.
    In excel ObjectRepository.vi (from excel get data to modify.vi from excel
    save.vi) the diagram can't be viewed without a password. I think that is
    where the data is prepared for saving. I never even knew diagrams could be
    protected like that.

  • Report Builder 2.0 loses parameter Null default value when deployed

    When a parameter is set to a default value of (Null) and the report is saved to the sever, the default is lost when the report is re-opened in RB2.  This problem doesn't seem to occur in BIDS.  I've tried to use an expression to set the value to System.DBNull but this can no longer be done.
    Any ideas for a work-around?
    Is there a bug report open for this?  I couldn't find an open bug on the Connections site and there's an issue on that site right now when submitting feedback.Paul Turley [Hitachi Consulting]
    SQLServerBIBlog.com

    Hi All,
    I just had an almost identical issue using report builder 3.0 so I don't believe it is fixed. I had 4 parameters set to default to (Null) and I added a new one with identical settings but it would continually come up blank and not check the null box automatically
    when going into my sub report.
    To make matters worse I experimented changing one of the old parameters and it then started exhibiting the same behaviour. Using Luke's post above solved the issue (though it was Manage in my version not Administrate).
    Using System.DBNull.Value resulted in it being treated as a literal string "System.DBNull.Value" and putting that in the filter for me.
    Hope it helps.

  • ORA-01480: trailing null missing from STR bind value

    I always end up with this error in a very irregular scenarios.
    When I set the NLS Date format in any of the functions in my program, it goes fine.
    Can anyone suggest me to set the NLS Date format globally.

    Set it in initialisation parameter file or spfile (you can use alter system set). Or set it on the environment variable of OS for all users (or the user).

  • Invalid SOAP request: regReq was null

    I am getting this error on my primary ZLM server since last month.
    Anybody know what could be causing this?

    On Fri, 06 May 2011 00:06:02 +0000, heinkonijn wrote:
    > Hi Rainer,
    >
    > Thanks for the answer.
    > The error just show up in the "System Event Log" in the ZCC for the
    > server.
    >
    > There is nothing the the catalina.out log and nothing in the other log
    > files. Nothing at the time of the event. Stange this is that it seems to
    > happen every 24 hours at 4:35:22...
    >
    > So it is probaly one of the servers connecting to ZLM... but which one?
    >
    > I think I might script a tcpdump to trace all traffic for two minutes
    > and hope it captures it, or do you have another suggestion?
    >
    > Thanks,
    > Hein
    Hein,
    one idea ... check in the reports the "Last Contact" report and see if
    one managed device either hasn't contacted the ZLM server for a long time
    or does it at the specific time.
    Rainer

  • Difference between NULL and ''

    Hi All,
    Is the below right?
    NULL is not stored as a value in a field. Its an internal bit that is set to indicate that the value is unknown.
    Blank is stored as a value in the field. Because of that we can perform all kinds of comparisons with blank value, while we cant do the same with NULLs
    Regards,
    aak

    user605246 wrote:
    Hi All,
    Is the below right?
    NULL is not stored as a value in a field. Its an internal bit that is set to indicate that the value is unknown.
    Blank is stored as a value in the field. Because of that we can perform all kinds of comparisons with blank value, while we cant do the same with NULLs
    Regards,
    aakYou are corerct in that NULL is not stored as a value in a field, but sorta/kinda wrong that it is an internal bit set to indicate that the value is unknown.
    If the NULL column(s) is/are the last column(s) in the table, then null values are not stored at all. The basic structure of a row stored on disk is (highly simplified)
    col1length|col1data|col2length|col2data|col3length|col3dataSo, given a row with col1 = 'ABC', col2 = 'Hello' and col3 null what is stored is:
    3|ABC|5|HelloHowever, if col2 is null and col 3 = 'Hello' then what is stored is:
    3|ABC|0|5|HelloSo the length byte is set to 0 to indicate that the column is null. Although the actual storage mechanisims for other data types differ from varchar2 example above, the 0 valeu i nthe length byte always indocates a null, and trailing null columns take 0 bytes of storage.
    John

  • Order Of Null and Not Null Values while table creation

    We have to create a table with 10 fields .5 of them are Null and Not Null. Now my question what should be the order of fileds??.Means Null Fields will come first or Not Null.

    The only reason I can think of having the NULL columns at the end is storage space.
    To conserve space, a null in a column only stores the column length (zero). Oracle
    does not store data for the null column. Also, for trailing null columns, Oracle does
    not even store the column length.

  • Null Value in PI 7.1

    Hi
    I am working on Proxy to SOAP Scenario, I receive null value at the first instance when I display the Queue, and values after the null,  and the values are coming from the different nodes, and mapping needs to be done at the different level too.
    Example I receive the state vale as
    1. null
    2.CA
    3.NV
    in order to avoid the null value while mapping what is the function to use it, I used Remove context but still I receive the null value at the begining
    Thanks
    PR

    Hi PR,
    In my case, because of this change in 7.1 a mapping which is working in 7.0 was resulting in wrong results in 7.1
    I doubt this change was done by SAP in 7.1 for ease of use in UDF.
    However, in your scenario try placing a remove contexts-split by value immediately after the condition it suppress the null.
    Else provide me your condition in MM I will replicate and help you.
    Also, try changing the context to a higher level
    Venkat.
    Edited by: Venkat Anusuri on Aug 5, 2009 3:43 PM

  • SOAP lookups from withing message mapping

    Hi
       We are doing a call to a webservice from within a udf in a message mapping using the SOAP API described in one of the blogs in SDN. We are using a soap receiver communication channel to make this webservice call -
    We see activity on the communication channel monitoring - indicating that there is a call going out and a response coming back from the webservice. But there are no details shown on the payload in communication channel monitoring. We do not see this webservice lookup as a message on the adapter engine either ?
    Is there any place from within XI runtime environment we can get a hold of the message going out to webservice call and the return from webservice ?  We are facing problems in the webservice not doing the required action desired and hence this question on visibility of the call to the webservice.
    Thanks in advance for your time.

    My udf is basically makes a call to the webserservice lookup method ( line - CallCentralMonitoring.LogToCentralMonitoring( "IN130.10", "COMPLETED"); ) - the definition of CallCentralMonitoring class is given below after the udf
    UDF
    String adapter = "RECEIVE_FusionDBLookUpRequest";
    Channel channel = null;
    boolean retry = false;
    int noOfRetries = 0;
    String sqlQuery = new String("");
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    String parameterValue = new String("");
    MappingTrace trace = container.getTrace();
    // Build the Query String
    //sqlQuery = "select * from CTL_BusinessRules with (nolock) where parameter_key = '" + parameterKey + "'";
    sqlQuery = "exec uspCTL_GetBusinessRule '" + parameterKey + "'";
    do
         try
              //trace.addInfo( "SQL query is: " + sqlQuery);
              // Determine a channel, as created in the Configuration
              channel = LookupService.getChannel(businessService,adapter);
              // Get a system accessor for the channel. As the call is being made to a DB, a DatabaseAccessor is obtained.
              accessor = LookupService.getDataBaseAccessor(channel);
              //trace.addInfo( "Successfully obtained the system accessor..." );
              // Execute Query and get the values in resultset
              resultSet = accessor.execute(sqlQuery);
              Iterator rows = resultSet.getRows();
              //trace.addInfo( "Executed query successfully..." );
              while( rows.hasNext() )
                   Map rowMap = (Map)rows.next();
                   parameterValue =  rowMap.get("CHARACTER_VALUE").toString();
                   //trace.addInfo( "Parameter Value is: " + parameterValue );
              retry = false;
              CallCentralMonitoring.LogToCentralMonitoring( "IN130.10", "COMPLETED");
              return parameterValue;
         catch( Exception ex )
              //trace.addInfo( ex.toString() );
              if ( noOfRetries < 3 )
                   retry = true;
                   noOfRetries++;
              else
                   retry = false;
                   CallCentralMonitoring.LogToCentralMonitoring( "SD152.01", "Error");
                   ExceptionThrower.fire( "Database connectivity error: " + ex.toString() );
         finally
              try
                   if ( accessor != null ) accessor.close();
              catch( Exception e )
                   ExceptionThrower.fire("Error closing accesor: " + e.getMessage() );
                   //return e.getMessage();
    } while( retry );
    return null;
    Class CallCentralMonitoring
    package com.xxxxx.xi.mapping.udf;
    import java.io.ByteArrayInputStream;
    import java.io.InputStream;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.lookup.LookupException;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.Payload;
    import com.sap.aii.mapping.lookup.SystemAccessor;
    import com.sap.aii.mapping.lookup.XmlPayload;
    public class CallCentralMonitoring {
         public static void LogToCentralMonitoring (String MON_EISLDCTLID, String MON_MsgStatus)  {
              String soapXML = new String("");
              /* Pass the Business System and Communication Channel as  input to the getChannel().
              /* BS_SOAPLOOKUP – Business System*CC_Webservice_SOAP_CURRENCY_CONVERTOR – Receiver SOAP Adapter */
              Channel channel = null;
              try {
                   channel = LookupService.getChannel( "EI_CentralMonitoringServives", "Receive_SOAP_TrackingServiceWS" );
              } catch (LookupException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              SystemAccessor accessor = null;
              try {
                   accessor = LookupService.getSystemAccessor(channel);
              } catch (LookupException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              /* Construct the SOAP Request Message using the InputParameters */          
              soapXML = "<LogToCentralMonitoring xmlns=\"http://xxxxx.EI.CentralMonitoring\"> <loggingData> <MON_EISLDCTLID>"
               + MON_EISLDCTLID
               + "</MON_EISLDCTLID><MON_ProgramID>"
               + MON_EISLDCTLID
               + "</MON_ProgramID><MON_ProcessID>"
               + MON_EISLDCTLID
               + "</MON_ProcessID><MON_ClientAlert>"
               + "N"
               + "</MON_ClientAlert><MON_MsgStartTimeStamp>"
               + "03/30/2007 10:00:00"
               + "</MON_MsgStartTimeStamp><MON_MsgEndTimeStamp>"
               + "03/30/2007 10:00:01"
               + "</MON_MsgEndTimeStamp><MON_MsgStatus>"
               + MON_MsgStatus
               + "</MON_MsgStatus><MON_MsgStatusDescription>"
               + MON_MsgStatus
               + "</MON_MsgStatusDescription> </loggingData> </LogToCentralMonitoring>";
              InputStream inputStream = new ByteArrayInputStream(soapXML.getBytes());
              XmlPayload payload = LookupService.getXmlPayload(inputStream);
              Payload soapOutPayload = null;
              /The SOAP call is made here and the response obtained is in the soapOutPayload./
              try {
                   soapOutPayload = accessor.call(payload);
              } catch (LookupException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         }//end LogToCentralMonitoring
    }//end class

Maybe you are looking for

  • Genius MousePen 8x6 does not work properly.

    I just purchased a Genius MousePen 8x6 graphics tablet. I installed the Mac drivers on the cd but the tablet still doesn't work properly. The mouse that came with the tablet works fine but the pen doesn't work at all. I can't calibrate the pen or any

  • CS5.5 Premium Edition - Mavericks or Yosemite?

    Re: Creative Suite CS5.5 Design Premium (Students and Teachers Edition). So after waiting for a while before considering to update to Yosemite and reading many forum posts here and other forums on the web saying how easy it was to update with no prob

  • Delivery split through VLSP along with JIT Calls with AW Partner profiles

    Hi SAP SD/LE Guru's, I have one critical issue to resolve immediately in my implementation of SAP 4.6C system in multinational automotive industry. It's in the area of Delivery split along with AW - Duns number partner profile and JIT calls. Here is

  • Drop down lists are active in PDF when received by email

    Hello, I have a form with drop down lists and the form is set so that when the user submits it, the PDF form is sent, not the XML file. The problem is that when I receive the PDF form, the drop down lists are active and I can change the items in the

  • Navigating values from one iview to another

    HI, We have created an Iview in Visual composer and has provided some "Name" and "EPCM Event". Now when i click on a button i shud pass a values called "Number" from this iview to another iview which is not a Visual composer iview. Can i know how can