2016-06-10 69 views
0

我试图做一个简单的代理使用存储Apis在Wso2上午,但是当我发送请求这个错误显示。无效的租户域Wso2 ESB-AM

{"error" : true, "message" : "Invalid tenant domain."} 

这是我的代理和我使用邮差来测试它,我送用户,并通过为JSON

<?xml version="1.0" encoding="UTF-8"?> 
<proxy name="Login" startOnLoad="true" trace="disable" 
    transports="https http" xmlns="http://ws.apache.org/ns/synapse"> 
    <target> 
    <inSequence> 
     <property expression="json-eval($.user)" name="user" 
     scope="default" type="STRING"/> 
     <property expression="json-eval($.pass)" name="user" 
     scope="default" type="STRING"/> 
     <log level="full"> 
     <property name="sequence" value="Paso 1 - Login AM"/> 
     </log> 
     <payloadFactory media-type="xml"> 
     <format> 
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
      <soapenv:Body> 
       <root xmlns=""> 
       <action>login</action> 
       <username>$1</username> 
       <password>$2</password> 
       </root> 
      </soapenv:Body> 
      </soapenv:Envelope> 
     </format> 
     <args> 
      <arg evaluator="xml" expression="$ctx:user" xmlns:ns="http://org.apache.synapse/xsd"/> 
      <arg evaluator="xml" expression="$ctx:pass" xmlns:ns="http://org.apache.synapse/xsd"/> 
     </args> 
     </payloadFactory> 
     <header name="Content-Type" scope="transport" value="application/x-www-form-urlencoded"/> 
     <property name="messageType" scope="axis2" type="STRING" value="application/x-www-form-urlencoded"/> 
     <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/> 
     <call> 
      <endpoint name="Login"> 
       <address uri="http://187.217.179.35:9765/store/site/blocks/user/login/ajax/login.jag" 
         trace="disable"/> 
      </endpoint> 
     </call>  <property expression="$trp:Set-Cookie" name="setCookieHeader" 
     scope="default" type="STRING"/> 
     <log level="full"> 
     <property expression="get-property('setCookieHeader')" name="==============Cookie==============="/> 
     </log> 
     <respond/> 
    </inSequence> 
    <outSequence/> 
    <faultSequence/> 
    </target> 
</proxy> 

回答

0

/存储/网站/块/用户/登录/ AJAX /登录.jag不是一个soap web服务。它不适用于肥皂有效载荷。试着做一个POST请求与有效载荷“行动=登录&用户名=管理员&密码=管理员”

+0

使用这些头部和我做了改造,做一个请求,就像你说的,我的意思是“行动=登录与用户名=管理员和密码属性=管理员'这是一个应用程序/ x-www-form-urlencoded –

+0

完成!我已经写了两个同名的属性 –