I have a payload as below.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<response xmlns="http://edip-api.macausjm-glp.com/apiservice">
<recipientAddress>zoehuang#asqimacau.com,well168168#gmail.com</recipientAddress>
<subject>Test email</subject>
<content>
<html>
<h1>this is the title</h1>
<br />
<p>this is the content................</p>
</html>
</content>
</response>
</soapenv:Body>
</soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
I need to get content value like below, how can I get the property?
<html>
<h1>this is the title</h1>
<br />
<p>this is the content................</p>
</html>
To store an XML tree in a property use type='OM'
So <property name="testAmanda" expression="//html" type="OM" />
Related
i am sending purchase request in xml with createcustomer profile.
customerProfileId is returning good but customerpayment profile id is returning in field customerPaymentProfileIdList > numericString.
here is full response.
<?xml version="1.0" encoding="utf-8"?>
<createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<messages>
<resultCode>Ok</resultCode>
<message>
<code>I00001</code>
<text>Successful.</text>
</message>
</messages>
<transactionResponse>
<responseCode>1</responseCode>
<authCode>R7BVRZ</authCode>
<avsResultCode>Y</avsResultCode>
<cvvResultCode>P</cvvResultCode>
<cavvResultCode>2</cavvResultCode>
<transId>60032752664</transId>
<refTransID />
<transHash>C1F3242645F7F118D709452E5758AF35</transHash>
<testRequest>0</testRequest>
<accountNumber>XXXX0015</accountNumber>
<accountType>MasterCard</accountType>
<messages>
<message>
<code>1</code>
<description>This transaction has been approved.</description>
</message>
</messages>
<transHashSha2 />
</transactionResponse>
<profileResponse>
<messages>
<resultCode>Ok</resultCode>
<message>
<code>I00001</code>
<text>Successful.</text>
</message>
</messages>
<customerProfileId>1813409569</customerProfileId>
<customerPaymentProfileIdList>
<numericString>1808086931</numericString>
</customerPaymentProfileIdList>
<customerShippingAddressIdList />
</profileResponse>
</createTransactionResponse>
Currently I use Doctrine2 with value object, it's working great. The problem when I use value object with only one field, for example:
$this->repository->findBy(array('email' => 'name#domain.com')); //This is not working
$this->repository->findBy(array('email.email' => 'name#domain.com')); //This is work great
The question is, how to make $this->repository->findBy(array('email' => 'name#domain.com')); working?
This is my doctrine mapping
User.orm.xml
<!-- User.orm.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
<entity name="Domain\User\Entity\User" table="users" repository-class="Infrastructure\User\Repository\UserRepository">
<id name="id" type="guid">
<generator strategy="UUID"/>
</id>
<embedded name="email" class="Shared\ValueObject\Email" use-column-prefix="false" />
</entity>
</doctrine-mapping>
Email.orm.xml
<!-- Email.orm.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<embeddable name="Shared\ValueObject\Email">
<field name="email" type="string" length="80" />
</embeddable>
</doctrine-mapping>
Thank you for your help, and sorry for my bad english.
Unfortunately according to code this is not possible. Field name always be
$property . "." . $fieldMapping['fieldName'];
I have such a problem here: service with which I integrating, has a strange format.
takes the value:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
<Operation>
<XmlStream>
<Name>GetPolicys</Name>
<XML><![CDATA[
<Arra>
<Ul>
<LastName>---</LastName>
<FirstName>---</FirstName>
<FatherName>---</FatherName>
<Birthday>---</Birthday>
</Ul>
</Array>]]>
</XML>
</XmlStream>
</Operation>
</soapenv:Body>
</soapenv:Envelope>
and returns
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<OperationResponse>
<OperationResult>
<ResultName>GetPolicys</ResultName>
<XML><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<Array>
<Ul>
<LastName>----</LastName>
<FirstName>----</FirstName>
<FatherName>---</FatherName>
<Birthday>--</Birthday>
<PolicyList>
----
</PolicyList>
</Ul>
</Array>]]>
</XML>
</OperationResult>
</OperationResponse>
</s:Body>
</s:Envelope>
create a nested message I got. As it wrapped in a CDATA? How to get it from CDATA in the preparation?
You can use XSLT to pick out from CDATA..
I'm a long time JSP user but facelets newbie and am stuck on what I thought would be a really simple task.
How can I wrap optional template content in a div tag?
For example given the following simplified template:
<?xml version='1.0' encoding='UTF-8' ?>
<html xml:lang="en" lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<!-- head stuff here -->
</h:head>
<h:body>
<!-- main body stuff here -->
<div class="border-box">
<ui:insert name="optional" />
</div>
</h:body>
</html>
If I use this template without defining the optional content I'll get an unwanted empty box.
I've searched for a solution and found the same question posed a few times but no real answer.
Can anyone help me out? This seems to me to be quite a reasonable thing to want to do with a templating system but it's got me stumped.
Thanks mael, ui:fragment seems to be the way to go when the content will fit in a ui:param value attribute but I'm going with your first suggestion. I will template-ize the wrapper though with a ui:decorate.
Page template:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<!-- head stuff here -->
</h:head>
<h:body>
<!-- main body stuff here -->
<ui:insert name="optional" />
</h:body>
</html>
Wrapper template:
<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
<div class="border-box">
<ui:insert />
</div>
</ui:composition>
Invocation:
<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="page.xhtml">
<!-- other ui:defines -->
<ui:define name="optional">
<ui:decorate template="wrapper.xhtml">
<!-- optional content -->
</ui:decorate>
</ui:define>
</ui:composition>
Just delete the div and make something like this in the page that uses your template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<body>
<ui:composition template="template.xhtml">
<ui:define name="optional">
<div class="border-box">
<!-- Content here -->
</div>
</ui:define>
</ui:composition>
</body>
</html>
I call a web service via Apache Axis Client in Tomcat server. I get ISO-8859-1 encoded response xml instead of UTF-8. When i simply run this client form main method, everything works as excepted. Below is an example request and response xml log. Please help!
In Message:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getContactInformation
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://extranet.turkcell.com.tr/webServices/toskaWebService">
<longVal href="#id0" />
<longVal0 href="#id1" />
<longVal1 href="#id2" />
<longVal2 href="#id3" />
<integer href="#id4" />
<integer0 href="#id5" />
<integer1 href="#id6" />
<integer2 href="#id7" />
</ns1:getContactInformation>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-1</multiRef>
<multiRef id="id6" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">408</multiRef>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-1</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">5322067832</multiRef>
<multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-1</multiRef>
<multiRef id="id5" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">100</multiRef>
<multiRef id="id7" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
<multiRef id="id4" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Out Message:
<?xml version="1.0" encoding="ISO-8859-9" standalone="yes"?>
<env:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header></env:Header>
<env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<m:getContactInformationResponse
xmlns:m="http://extranet.turkcell.com.tr/webServices/toskaWebService">
<result xmlns:n1="java:com.turkcell.toska.model" xsi:type="n1:WSContactList">
<addresslist soapenc:arrayType="n1:WSAddress[1]">
<WSAddress xsi:type="n1:WSAddress">
<address1 xsi:type="xsd:string">7-8 Mah. I 9 C Kap�s�</address1>
<address2 xsi:type="xsd:string">�orak�� Sok. No:111</address2>
<address3 xsi:type="xsd:string">Gazzosmanpa�a</address3>
<addressID xsi:type="xsd:long">0</addressID>
<addressStatus xsi:type="xsd:int">0</addressStatus>
<addresstype xsi:type="xsd:int">0</addresstype>
<addressusage xsi:type="xsd:int">1</addressusage>
<cityCode xsi:type="xsd:int">72</cityCode>
<cityName xsi:nil="true"></cityName>
<countryCode xsi:type="xsd:int">1</countryCode>
<usageStatus xsi:type="xsd:int">0</usageStatus>
<zipCode xsi:type="xsd:string">72439</zipCode>
</WSAddress>
</addresslist>
<emaillist soapenc:arrayType="n1:WSEmailInfo[0]"></emaillist>
<errMessage xsi:type="xsd:string"></errMessage>
<phonelist soapenc:arrayType="n1:WSPhone[1]">
<WSPhone xsi:type="n1:WSPhone">
<addressID xsi:type="xsd:long">0</addressID>
<addressStatus xsi:type="xsd:int">0</addressStatus>
<extension xsi:nil="true"></extension>
<generationDate xsi:nil="true"></generationDate>
<modificationDate xsi:nil="true"></modificationDate>
<phonenumber xsi:type="xsd:string">2125487549</phonenumber>
<phonenumbertype xsi:type="xsd:int">100</phonenumbertype>
<usageStatus xsi:type="xsd:int">0</usageStatus>
</WSPhone>
</phonelist>
<resultcode xsi:type="xsd:int">0</resultcode>
</result>
</m:getContactInformationResponse>
</env:Body>
</env:Envelope>
you can try following codes.
Stub._setProperty(Call.CHARACTER_SET_ENCODING, "ISO-8859-9");