AS3 XML adds custom namespace declarations
What I am doing is uncompressing .xlsx file and reading its contents. Then add some rows to sheets and then compress all the files in .xlsx format.
The problem is with sharedStrings.xml (probably with other files too). Some xml tags look like this:
<t xml:space="preserve">Banner Set 1</t>
But when i convert the xml string to XML object (new XML(xml_string)), it gets ugly:
<t aaa:space="preserve" xmlns:aaa="http://www.w3.org/XML/1998/namespace">Banner Set 1</t>
Well, I understand why this happens. It is because the namespace xml isn't declared on that node, so AS3 takes it's default namespace and declares it there and renames it.
This is the reason, why Excel refuses to read this file. I don't want XML object to mess with the namespaces and just leave them as they are. Is it possible to do this with the native XML library? Or maybe there are some other libraries that could help me in this case?
be consistent in the definition of the NS.
at the top of the XSL you write: xmlns:web="http://.../web"
then in an element: xmlns:web="urn:jsptld:WEB-INF/tld/web.tld"
if you are consistent, then it will be declared only on top of the resulting XML.
Similar Messages
-
Add dynamic namespace declaration into xml root element
Hello all,
i've have two scenarios (mail to mail and file to file) with the same issue : no namespace in my XML file and i have to create one 'dynamically' from XML values.
Example :
<root>
<name>test</name>
<email>test</email>
<schema>schemaID</schema>
</root>
Now I want to add infos into the root element for namespace declaration and so on, without expansion of the xsd. I've must use the value from the field schemaID.
Example:
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns: namespace="http://test.de/schemaID">
<name>test</name>
<email>test</email>
</root>
I've already done it before through XSLT but it wasn't dynamic !! I don't know how to do it in XSL and i am not a java expert.
Someone got an idea ?
Thanks,
Jean-Philippe.Hi,
If you want to add name space at mapping level two options
1)Using XSLT Mapping ,its very easy,google it to get sample XSLT code ,it will solve your problem.
2)Using java mapping,in java mapping use regular expression code ,using regex(Regulkar expresion)we can add any content in message at any level.
Regards,
Raj -
Avoid repeating namespace declaration in xml output
Hi all,
I'm trying an IDoc -> XML File (specifically UBL-format) scenario, and it is working fine. But the resulting XML contains repeating namespace declarations for each element, instead of a "common" declaration at the root element.
How can I avoid this, so the message contains the namespace declarations in root node, and only uses the namespace prefix for each element?
The target format, external definition, is an XSD with several import statements, and all external references have been set up, meaning all referenced XSD's are imported too, and have the "Source"-field set according to the import statement.
Sample result file (top of file only):
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Invoice xmlns:ns0="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<ns2:UBLVersionID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2.0</ns2:UBLVersionID>
<ns2:CustomizationID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">urn:www.cenbii.eu:transaction:BiiCoreTrdm001:ver1.0:extentionId</ns2:CustomizationID>
<ns2:ProfileID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">urn:www.cenbii.eu:profile:bii05:ver1.0</ns2:ProfileID>
<ns2:ID xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">9010045446</ns2:ID>
<ns2:IssueDate xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">2011-04-19</ns2:IssueDate>
<ns2:InvoiceTypeCode...
PI version 7.11.
Thanks for all help.
Br,
KennethHi Mon,
You can use below xslt 1.0 mappings.
The first one will copy all namespaces (declared) to a newly created root element.
The seconde one will delete the 'old' root element.
=> The result will look like an xml where the namespacesare moved to the root element.
First xslt:
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:ns3="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ns4="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2">
<xsl:copy-of select="." />
</Invoice>
</xsl:template>
</xsl:stylesheet>
Second xslt:
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Invoice" >
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Kind regards,
Lode -
RFC Call: Missing namespace declaration
Dear experts,
I have a file to RFC scenario. I imported the RFC and create files exactly according to the RFC structure, so I don't use a mapping. When I create a file, it provides the following error in the adapter log:
<i>Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get functionname from XML requst: com.sap.aii.af.rfc.RfcAdapterException: failed to read funtionname from XML document: missing namespace declaration(2)</i>
What do I need to do to fix this.
Thanks in advance!This is the whole message:
I created my own interface and mapped it to the RFC:
This is the message. Now it successfully pass XI and the adapter sais it is delivered.
BUT nothing is seen in the target system... how is that possible???
<?xml version="1.0" ?>
<ns:MT_TO_CREATE xmlns:ns="urn://cchbc/w2/xi/mes/warehousetransfer">
<LGNUM></LGNUM>
<TIMEST>20071207094550.0000000</TIMEST>
<WERKS>4510</WERKS>
<ZLAST>0</ZLAST>
<ZSCID>SCANPRD4</ZSCID>
<I_LTAP>
<item>
<EAN11>5449000003096</EAN11>
<LETYP>E2</LETYP>
<VSOLM>48.000</VSOLM>
<LENUM>00345101239500010930</LENUM>
<VFDAT>2008-12-11T00:00:00</VFDAT>
<WDATU>2007-12-07</WDATU>
<ZLINE>830</ZLINE>
<ZTIME>09:43:32</ZTIME>
<BRGEW/>
</item><item>
<EAN11>2229000058744</EAN11>
<LETYP>E2</LETYP>
<VSOLM>48</VSOLM>
<LENUM>00000000003000002961</LENUM>
<VFDAT>2008-12-11T00:00:00</VFDAT>
<WDATU>2007-12-07</WDATU>
<ZLINE>830</ZLINE>
<ZTIME>09:44:01</ZTIME>
<BRGEW/></item><item>
<EAN11>2229000058744</EAN11>
<LETYP>E2</LETYP>
<VSOLM>48.000</VSOLM>
<LENUM>00000000003000002978</LENUM>
<VFDAT>2008-12-11T00:00:00</VFDAT>
<WDATU>2007-12-07</WDATU>
<ZLINE>830</ZLINE>
<ZTIME>09:44:32</ZTIME>
<BRGEW/></item></I_LTAP></ns:MT_TO_CREATE>
And the output is:
<?xml version="1.0" encoding="UTF-8" ?>
- <ns1:ZWM_TO_CREATE xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
<LGNUM />
<TIMEST>20071207094550.0000000</TIMEST>
<WERKS>4510</WERKS>
<ZLAST>0</ZLAST>
<ZSCID>SCANPRD4</ZSCID>
- <I_LTAP>
- <item>
<EAN11>5449000003096</EAN11>
<LETYP>E2</LETYP>
<VSOLM>48.000</VSOLM>
<LENUM>00345101239500010930</LENUM>
<VFDAT>2008-12-11T00:00:00</VFDAT>
<WDATU>2007-12-07</WDATU>
<ZLINE>830</ZLINE>
<ZTIME>09:43:32</ZTIME>
<BRGEW />
</item>
- <item>
<EAN11>2229000058744</EAN11>
<LETYP>E2</LETYP>
<VSOLM>48</VSOLM>
<LENUM>00000000003000002961</LENUM>
<VFDAT>2008-12-11T00:00:00</VFDAT>
<WDATU>2007-12-07</WDATU>
<ZLINE>830</ZLINE>
<ZTIME>09:44:01</ZTIME>
<BRGEW />
</item>
- <item>
<EAN11>2229000058744</EAN11>
<LETYP>E2</LETYP>
<VSOLM>48.000</VSOLM>
<LENUM>00000000003000002978</LENUM>
<VFDAT>2008-12-11T00:00:00</VFDAT>
<WDATU>2007-12-07</WDATU>
<ZLINE>830</ZLINE>
<ZTIME>09:44:32</ZTIME>
<BRGEW />
</item>
</I_LTAP>
</ns1:ZWM_TO_CREATE> -
Autogenerate Manifest.xml file for custom namespace
I am working on a library with custom components and I want the library to have a custom namespace. From my reading, it looks like I need to create a manifest.xml file to associate by components with a specific namespace. (http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=compilers_123_43.html)
Is there anyway I can autogenerate the manifest.xml file? I am using Flex Builder 3 for development.I have a lot of components and I may periodically add and remove components, so I do not want to have to manually modify the manifest.xml file every time I make a change.Did you follow the guidelines in the Connect 6 SDK documentation? This document was applicable from version 6 through 7.5.
http://help.adobe.com/en_US/Connect/6.0/SDK/help.pdf
Your SWF needs to be named index.swf to work, as I recall. -
Add a root node and namespace declaration
According to the requirement,I have a large appended .txt file.
This .txt file is created by appending various xml files (without the namespace and root node).
I need to add a root node and namespace declaration to the large appended .txt file so that it can be read as .xml.
Please provide the pointers for the same.
Thanks & Regards,
RashiMy appended file looks like following.
<input>
<Store>
<StoreHeader>
<StoreNbr>56</StoreNbr>
<StoreType>Retail</StoreType>
<StoreSite>2004</StoreSite>
</StoreHeader>
<Transactions>
<Transaction>
<Item>A</Item>
<ItemPrice>4</ItemPrice>
</Transaction>
<Transaction>
<Item>C</Item>
<ItemPrice>56</ItemPrice>
</Transaction>
</Transactions>
</Store>
</input>
<input>
<Store>
<StoreHeader>
<StoreNbr>123</StoreNbr>
<StoreType>Retail</StoreType>
<StoreSite>2004</StoreSite>
</StoreHeader>
<Transactions>
<Transaction>
<Item>A</Item>
<ItemPrice>4</ItemPrice>
</Transaction>
<Transaction>
<Item>B</Item>
<ItemPrice>8</ItemPrice>
</Transaction>
<Transaction>
<Item>C</Item>
<ItemPrice>56</ItemPrice>
</Transaction>
</Transactions>
</Store>
</input>
Now according to the requirement, I need to add namespace and root node and make it like follows:
<ns0:output xmlns:ns0="http://xxx">
<input>
<Store>
<StoreHeader>
<StoreNbr>56</StoreNbr>
<StoreType>Retail</StoreType>
<StoreSite>2004</StoreSite>
</StoreHeader>
<Transactions>
<Transaction>
<Item>A</Item>
<ItemPrice>4</ItemPrice>
</Transaction>
<Transaction>
<Item>C</Item>
<ItemPrice>56</ItemPrice>
</Transaction>
</Transactions>
</Store>
</input>
<input>
<Store>
<StoreHeader>
<StoreNbr>123</StoreNbr>
<StoreType>Retail</StoreType>
<StoreSite>2004</StoreSite>
</StoreHeader>
<Transactions>
<Transaction>
<Item>A</Item>
<ItemPrice>4</ItemPrice>
</Transaction>
<Transaction>
<Item>B</Item>
<ItemPrice>8</ItemPrice>
</Transaction>
<Transaction>
<Item>C</Item>
<ItemPrice>56</ItemPrice>
</Transaction>
</Transactions>
</Store>
</input>
</ns0:output> -
How to Add custom Attribute in XML
How to add Custom attribute recusrivly. With sequence order.
//Before xml:-
var myxml:XML=
<root>
<leval0 >
<leval1 >
<leval2></leval2>
<leval2></leval2>
</leval1>
<leval1 >
<leval2></leval2>
<leval2></leval2>
</leval1>
</leval0>
</root>
////After xml:
var myxml:XML=
<root>
<leval0 levalid="0" >
<leval1 levalid="0_0" >
<leval2 levalid="0_0_0"></leval2>
<leval2 levalid="0_0_1"></leval2>
</leval1>
<leval1 levalid="0_1" >
<leval2 levalid="0_1_0"></leval2>
<leval2 levalid="0_1_1"></leval2>
</leval1>
</leval0>
</root>//call this method
trace(addAttribute(myxml));
//method
private function addAttribute(node:XML, depth:String = ""):XML
if (node.hasComplexContent())
var count:int = 0;
var prefix:String = 0 < depth.length ? depth + "_" : "";
var currentAtt:String;
for each (var nodeItem:XML in node.children())
currentAtt = prefix + count;
nodeItem.@levalid = currentAtt;
addAttribute(nodeItem,currentAtt);
count++;
return node; -
SOASuite 11g
Oracle Weblogic Server 10.3.3
Oracle Solaris on SPARC (64-bit) 10
Database: Oracle Server - Enterprise Edition 10.2.0.5
When I start the SOA domain server, I find the following in the log file:
<Feb 25, 2011 10:41:23 AM CET> <Error> <org.apache.commons.digester.Digester> <BEA-000000> <Parse Error at line 9 column 79: <Line 9,
Column 79>: XML-20129: (Error) Namespace prefix 'ui' used but not declared.
org.xml.sax.SAXParseException: <Line 9, Column 79>: XML-20129: (Error) Namespace prefix 'ui' used but not declared.
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:422)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:342)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:226)
at org.apache.commons.digester.Digester.parse(Digester.java:1785)
at oracle.fabric.composite.Parser.parseComposite(Parser.java:132)
at oracle.integration.platform.kernel.WLSFabricKernelInitializer.deployComposite(WLSFabricKernelInitializer.java:493)
at oracle.integration.platform.kernel.WLSFabricKernelInitializer.prepareCompositeDeployments(WLSFabricKernelInitializer.java:
239)
at oracle.integration.platform.kernel.WLSFabricKernelInitializer.init(WLSFabricKernelInitializer.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1976)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1950)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1869)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3126)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1512)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:486)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:1267)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
>
My composite.xml is:
<composite name="JIPSYHandleRTOTaskEBF" revision="1.0" mode="active" state="on"
xmlns="http://xmlns.oracle.com/sca/1.0"
xmlns:ui="http://xmlns.oracle.com/soa/designer/"^M
xmlns:xs="http://www.w3.org/2001/XMLSchema">^M
<import location="GetTimeoutPeriod.wsdl" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/GetTimeoutPeriod/"/>
<service ui:wsdlLocation="JIPSYHandleRTOTaskEBF.wsdl" name="client">
</composite>
But when it has been deployed, I see that this has been changed into:
<composite name="JIPSYHandleRTOTaskEBF" revision="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<import location="GetTimeoutPeriod.wsdl" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/GetTimeoutPeriod/"/>
<service ui:wsdlLocation="JIPSYHandleRTOTaskEBF.wsdl" name="client">
</composite>
(I exported this from MDS).
Apparently, some namespaces are stripped.
This appears to happen during the deploy (using ant), because the version in the generated jar file is already missing the namespaces.
The BPEL processes appear to work fine though.
Why is this happening and how can I prevent these errors?I've fiddled around with the file composite.xml and found the following workaround:
If I change the start of the file to:
<?xml version="1.0" encoding="UTF-8"?>
<composite name="JIPSYUpdateWorkflowReqABCSImpl"
xmlns="http://xmlns.oracle.com/sca/1.0"
xmlns:ui="http://xmlns.oracle.com/soa/designer/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
revision="1.0"
mode="active"
state="on">
it remains unchanged and the errors during deployment are gone. -
Inclusion of unused namespace declarations in marshalled XML
Hello.
I have noticed that by default any XML marshaled from an object contains namespace declarations related to every package specified when instantiating the JAXBContext even though they are not used in the instance being marshalled.
Is there any way to avoid this during the marshalling as opposed to via some sort of post processing (e.g. XSLT transform).
Example source below:
package test;
import javax.xml.bind.*;
import java.io.*;
import test.sample1.*;
import test.sample2.*;
public class Converter {
public static void main(String[] args) {
try {
String sample1 = "<Message1 xmlns=\"http://www.example.org/sample1\">" +
"<tns:Field xmlns:tns=\"http://www.someother.org\">value</tns:Field>" +
"</Message1>";
String sample2 = "<Message2 xmlns=\"http://www.example.org/sample2\">" +
"<Field1>value1</Field1>" +
"<Field2>value2</Field2>" +
"</Message2>";
JAXBContext ctx = JAXBContext.newInstance("test.sample1:test.sample2");
Unmarshaller um = ctx.createUnmarshaller();
Marshaller m = ctx.createMarshaller();
StringWriter sw1 = new StringWriter();
Message1 msg = (Message1)um.unmarshal(new StringReader(sample1));
m.marshal(msg, sw1);
System.out.println("Marshalled sample1: \n"+sw1.toString());
StringWriter sw2 = new StringWriter();
Message2 msg2 = (Message2)um.unmarshal(new StringReader(sample2));
m.marshal(msg2, sw2);
System.out.println("Marshalled sample2: \n"+sw2.toString());
} catch (JAXBException e) {
e.printStackTrace();
}Produces output:-
Marshalled sample1:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Message1 xmlns:ns2="http://www.example.org/sample2" xmlns="http://www.example.org/sample1"><tns:Field xmlns:tns="http://www.someother.org">value</tns:Field></Message1>
Marshalled sample2:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:Message2 xmlns:ns2="http://www.example.org/sample2" xmlns="http://www.example.org/sample1"><ns2:Field1>value1</ns2:Field1><ns2:Field2>value2</ns2:Field2></ns2:Message2>Thanks for the quick response. I really appreciate it.
Yes, as you say, there is no real problem as such but part of my app lets the user see the RAW message XMLs and this could confuse them and would be tidier to remove but I can also see why it is easier from the Marshaller perspective not to have to back track to remove unused declarations.
Also, I'm a little concerned about the increased size of the XML produced. One of my webservices does handle quite a few different types and our Oracle namespace URLs are all pretty long!
Like I say, I can see a way to get rid of them after the fact but wondered if there was a more elegant/performant way. -
Unable to add custom SOAP header to consumer webservice in CRM( without using PI)
Hello Experts,
We have a requirement to consume webservice proxy in CRM without involving PI. We have WSDL file which has many services as depicted in the first screenshot.After checking old posts, I could add custom SOAP header by using if_wsprotocol_ws_header and there is no xml parsing error for ws_header.Have used if_ixml_stream_factory to check xml parsing error for header.
'<soapenv:Header>'
'<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'
'<wsse:UsernameToken wsu:Id="UsernameToken-2">'
'<wsse:Username>user id</wsse:Username>'
'<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">paswd</wsse:Password>'
'<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">MT0B9XFzsZJXXKmVKOsj/Q==</wsse:Nonce>'
'<wsu:Created>2015-03-30T06:29:17.407Z</wsu:Created>'
'</wsse:UsernameToken>'
'</wsse:Security>'
'</soapenv:Header>' INTO l_string.
But when my ABAP program as a whole gets executed where consumer proxy is called, then it still throws XML parsing error - undeclared namespace prefix. As mentioned, there is no parsing error for header and WSDL file as a whole in SOAP UI tool works fine,by manually adding SOAP header.
Have configured SOAMANAGER with logical port.Or any wrong setting in SOAMANAGER can cause this issue? When I tested webservice ping, it gave me attached error but I read in a SAP note that such error can be ignored.
I want to know if some more setting/coding is required if we manually add custom header to a payload? Is PI really required to implement this requirement? Payload mapping has to be done to add custom header and if that can be taken care by ABAP coding and how?
Can you please help?
BR,
Nisha VermaHello Experts,
I have not found the solution yet.
Can anyone provide some insight??
BR,
Nisha Verma -
Splitting XML Files without namespaces
Hello,
I have a file that looks similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<File>
<Header>
<Location>Phoenix</Location>
<Date>052214</Date>
</Header>
<Bill></Bill>
<Trailer>
<Total>1076</Total>
</Trailer>
</File>
What I would like to do is split the file (<Bill> is repeating) and I understand I should be able to do this with an envelope schema. I've done some research and every example I'm coming across happens to have a namespace in the sample schema.
How can I accomplish the same thing without the namespace?
Do I need to add the namespace using the ESB Toolkit, and if so, am I supposed to add a namespace to the repeating element? I looked into that solution and couldn't understand how to add a namespace to the Bill element, only the root. Unfortunately I trashed
that approach and went with an orchestration. While that is working, it just doesn't seem right if I can accomplish this task in the receive stage.
Any help/encouragement would be appreciated.The problem is that if you split the message on an element that has no namespace, you will need a Schema without namespace (in your case with a root element of "Bill" and no namespace).
Having Schemas without namespaces in BizTalk is bad practice and should, in general and if possible, be avoided.
So what I would do is create a custom Pipeline Component that (either using XDocument, XMLDocument or Regular Expression) appends a namespace to all "Bill" elements and also a namespace to the Root.
Apply the Component in the Decode Stage on your Receive Pipeline so that it is applied BEFORE the disassemble stage, and then create your "Bill" Schema with the newly appended Namespace, and also Apply the Batch namespace to your Envelope Schema.
An Example:
<?xml version="1.0" encoding="UTF-8"?>
<b:File xmlns:b="http://Batch">
<Header>
<Location>Phoenix</Location>
<Date>052214</Date>
</Header>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<c:Bill xmlns:c="http://namespace"></c:Bill>
<Trailer>
<Total>1076</Total>
</Trailer>
</b:File>
Morten la Cour -
Namespace declaration inconsistencies
It has occurred to me that there is an inconsistency in the BPEL input message depending on where it is called from... If I test the BPEL process from the BPEL console using the test-form, the namespace of the input message is included. However, when the same BPEL process is called through another BPEL process (partner link), the namespace declaration is omitted.
This makes testing harder, since my XPath expressions will then either fail when I test from the BPEL Console, or when the process is invoked from another bpel.
The best way to fix it (I think) is to force the calling bpel process to include the namespace declaration when invoking the partner link. Is there a way to accomplish this?
Cheers,
BastiaanBastian
I have come across the same problem.
The BPEL Console is producing an XML message that is not consistent with the defined schema.
Has anyone else seen any other comments relating to this area - has it been raised as a bug?
I have included my message structures below.
BPEL Console Messsage - the namespaces in bold are the ones that are incorrect
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://itv.com/parispublish">
<ns1:ParisPublishProcessRequest xmlns:ns2="http://itv.com/schemas/message/paris">
<ns2:ProgrammeAdviseRq>
<ns2:HeaderRq xmlns:ns3="http://itv.com/schemas/header/paris">
<ns3:RqUID>ABC</ns3:RqUID>
<ns3:Action>Add</ns3:Action>
</ns2:HeaderRq>
<ns2:Programme xmlns:ns4="http://itv.com/schemas/productcatalogue/paris">
<ns4:ProgrammeId>1234</ns4:ProgrammeId>
</ns2:Programme>
</ns2:ProgrammeAdviseRq>
</ns1:ParisPublishProcessRequest>
</soap:Body>
</soap:Envelope>
Partnerlink message - which is correct.
<inputVariable>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
<soap:Envelope xmlns="http://itv.com/parispublish" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<ProgrammeAdviseRq xsi:schemaLocation="http://itv.com/schemas/message/paris ../Message.xsd" xmlns="http://itv.com/schemas/message/paris" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<HeaderRq xmlns="http://itv.com/schemas/header/paris">
<RqUID>564</RqUID>
<Action>Add</Action>
</HeaderRq>
<Programme xsi:schemaLocation="http://itv.com/schemas/productcatalogue/paris ../productcatalogue.xsd" xmlns="http://itv.com/schemas/productcatalogue/paris">
<ProgrammeId>G/0002</ProgrammeId>
</Programme>
</ProgrammeAdviseRq>
</soap:Body>
</soap:Envelope>
</part>
</inputVariable> -
How to set buildID.xml and custom.properties in SDK
Hello,
I just completed a new build deployment of SAP ME5.2, because after I deployed the new version, I don't think I have set a
correct version number.Can you someone give me a sample how to set the buildID.xml and custom.properties? I am a new on the SAP ME5.2
The Base version is ME_Base_5.2.5.16.5_netweaver-71_Update.zip and
MEClient_Base_5.2.5.16.5_netweaver-71_Update.zip. the HB customzation
version is ME_xxxxxx_2.0.0.0.x_netweaver-71.
Within the sap note 1484551, you mentioned we need change the
SDKInstallDir/build/buildID.xml file, here is the context of the file:
buildID.xml -
<?xml version="1.0" encoding="UTF-8"?>
<buildID xmlns:xs="http://www.w3.org/2001/XMLSchema">
<customer>XXXXXX</customer>
<revision>1.0.0.0</revision>
<build>1</build>
</buildID>
buildID.xml -
1. how can we change the revision and build?
There is another file BuildToolDir/build/script/custom.properties, here
is the file context:
custom.properties----
This file contains build properties used to configure the build
system.
The name of the software vendor implementing the customizations.
vendor.name=xxxxxxxxx
Vendor build identifier. This value is used to uniquely identify
customizations built by a particular vendor for a particular customer
and base
application version.
This is also used in path locations and in naming certain build
artifacts, like the custom EJB module and the utility classes archive.
vendor.id=xxxxxxxxx
The installation of the J2EE engine installed in the development
environment.
ex. C:/usr/sap/CE1\J00
j2ee.instance.dir=J2EEInstanceDir
The web context path used to access the main web application. This
is used by the build to set the
context-root value in application.xml after an update has been
imported.
web.context.path=
The web context path used to access the production XML interface web
application. This is used by the build to set the
context-root value in application.xml after an update has been
imported.
xml.context.path=
The web context path to access resources from the web extension
application, like images and work instruction HTML files.
web-ext.context.path=web-ext
The target database vendor. Valid values are 'oracle' or 'sqlserver'.db.vendor=ORACLE
The JDBC driver configured for the application server.
db.drivername=VMJDBC
JDBC connection propertes for the WIP (Work In Process) database.
This is the primary application database.
db.wip.driverclassname=
db.wip.driver.url=
db.wip.host=
db.wip.port=
db.wip.sid=
db.wip.user=
db.wip.password=
JDBC connection propertes for the ODS (Open Data Store) database.
This is the offline reporting and archiving database.
db.ods.driverclassname=
db.ods.driver.url=
db.ods.host=
db.ods.port=
db.ods.sid=
db.ods.user=
db.ods.password=
Flag indicating whether to add DPMO NC codes to NC idat files when a
new update is imported. This value is initially
set by the installer according the the user selection.
dpmo.nc.codes=
The default locale used by the production system. The default locale
is the locale used to display locale
specific text and messages when the requested locale is not
available. This property does not need to
be set if the default locale is english.
default.locale=en
Used when running the build from Eclipse to locate the java compiler
used by the WebLogic EJB compiler.
jdk.home=C:/Program Files/Java/jdk1.5.0_20
Compiler debug mode. If set to 'true', debug symbols will be
compiled into the byte code.
compile.debug=true
Keystore alias
security.alias=xxxxx
Keystore password
security.storepass=ChangeIt
Key password
security.keypass=ChangeIt
Keystore type (jks=default,jceks,pkcs12)
security.storetype=jks
Optional source control build identifier that is to be displayed with
standard version information.
scs.build.ID=
Optional extended version information to be displayed with standard
version information.
ext.info=
custom.properties----
2. How can we change this here?
Regards,
Leon Lu
Edited by: Leon Lu on Aug 4, 2011 11:14 AM
Edited by: Leon Lu on Aug 4, 2011 11:21 AMHi,
I created one request with logo in the header an page in the footer etc. and called StyleSheet. After you can import this formats by each request.
You can do this in compound layout.
Regards,
Stefan -
How can i add custom attributes to a new Class Object using the API ?
Hello everyone,
Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
// doc is an instance of Document
ClassObject co = doc.getClassObject();
ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
cod.setSuperclass(co);
cod.setSuperclassName(co.getName());
cod.setName("MYDocument");
ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
AttributeDefinition value = new AttributeDefinition(ifsSession);
value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
c.addAttribute(value);
But i got the following error message :
oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
So, what am i doing wrong ?
More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
Any help would be appreciated. Thanks in advance.
Guillaume
PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
nullHi Guillaume,
you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
is used to check for erronous cases only
and it shouldn't be used otherwise.
Creating your own objects could be simply done via
ClassObject ifsClassObject;
DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
// get class object for my very own document
ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
// set the class for the document i'd like to create
ifsDocDef.setClassObject(ifsClassObject);
// set attributes and content for the document...
ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
ifsDocDef.setContent("This is the content of my document");
// create the document...
PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
null -
How to add multiple namespaces in XSD ?
Can anyone tell me how to add multiple namespaces inside an XSD. Or how to import XSD into another XSD ??
Thanks<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://xml.ibridge.nl/nl/rsg/domein/3/company" xmlns:alg="http://mynamespace/generic" targetNamespace="http://xml.ibridge.nl/nl/rsg/domein/3/company" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.1">
<xs:import namespace="http://mynamespace/generic" schemaLocation="algemeen.xsd"/>
you define xmlns:alg with a namespace
and after that use the namespace itself to import a xsd for it
Maybe you are looking for
-
Airport Extreme migration to Time Capsule
I just got my new TC and want to change my current wireless network and Internet access from AP Xtreme to TC. Any important tips or advice I should have before beginning? Do I set up a new Network or just migrate? I currently use Time Machine to back
-
No help from Apple..I have a Windows XP 2002 32bit with service pack 2 and 3..Apple removed my old itunes because i couldn't up date.However they could not down the new verison after trying several times... error mgs reads er
-
My iPad is locked and has this message "this iPad hasn't been backed up. Backups happen when this iPad is plugged in, locked, and connected to wi fi". What should I do to continue using it please?
-
Patch distribustion poinit not working
I have one sccm Primary server ,7secondary server & 3 Distribution point .My All secondary server working fine . 2 distribution point also working fine but distribution point not working that why that particular location my patch distribution t
-
Dear Friends, We have created Maintenance order through which PR is created with Account assignment category as F and Item category as D. In ME52N transaction, i want to set the deletion indicator for the line item. But could not do that since Deleti