2013-09-23 2 views
3

내가 (smartbear에서) 비누 UI를 사용하고있는 앰퍼샌드 (&)를 탈출하는 방법 :으로 XML 형식으로 비누 요청을 보낼 비누 UI

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsg="http://wsg.hpos.om.hp.com/"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <wsg:abc> 
     <wsg:contract> 
     &lt;request&gt; 

     &lt;request-attributes&gt; 
      &lt;message&gt;"this &amp; and that"&lt;/message&gt;     
     &lt;/request-attributes&gt;    
     &lt;/request&gt;    
     </wsg:contract> 
     </wsg:abc> 
    </soapenv:Body> 
</soapenv:Envelope> 

하고 응답이 : 잘못된 요청. 너 & 탈출하는 방법에 빛을 던져 주시겠습니까? 감사

+0

은'&'올바르게 이스케이프됩니다. 그런데 왜 '<' and '>'이 탈출 했습니까? – geoffspear

+0

응용 프로그램이 < and > 태그를 계약 본문 아래에서 읽을 수 없으므로 < and >의 다른 표현을 사용해야합니다. 유사한 행에서 &를 시도했을 때 올바른 결과를 얻지 못했습니다. – akc

+3

XML을 이중 인코딩하는 경우 '& amp;'를 시도해 보셨습니까? – geoffspear

답변

6

당신은 <![CDATA[]]> 내부의 페이로드를 포장하고 탈출에 대해 걱정하지 수는 :

<![CDATA[<request> 
    <request-attributes> 
     <message>"this & and that"</message> 
    </request-attributes> 
</request>]]>