Apache Ofbiz Web Services调用一则

来源:互联网 发布:戴尔公司待遇 知乎 编辑:程序博客网 时间:2024/06/01 18:21

启用Ofbiz的创建用户Web Services,搜索下我前面的文章吧

http://192.168.1.107:8080/webtools/control/SOAPService/createPersonAndUserLogin?wsdl
使

用eclipse Web Services Explorer,自己构造请求body
http://127.0.0.1:49862/wse/wsexplorer/wsexplorer.jsp

<map-Map>  <ns0:map-Entry>    <ns0:map-Key>      <ns0:std-String value="currentPassword"/>    </ns0:map-Key>    <ns0:map-Value>      <ns0:std-String value="current"/>    </ns0:map-Value>  </ns0:map-Entry>  <ns0:map-Entry>    <ns0:map-Key>      <ns0:std-String value="currentPasswordVerify"/>    </ns0:map-Key>    <ns0:map-Value>      <ns0:std-String value="current"/>    </ns0:map-Value>  </ns0:map-Entry>  <ns0:map-Entry>    <ns0:map-Key>      <ns0:std-String value="userLoginId"/>    </ns0:map-Key>    <ns0:map-Value>      <ns0:std-String value="zzzz"/>    </ns0:map-Value>  </ns0:map-Entry></map-Map>

SOAP请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://ofbiz.apache.org/service/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  <soapenv:Body>    <ns0:createPersonAndUserLogin>      <map-Map>  <ns0:map-Entry>    <ns0:map-Key>      <ns0:std-String value="currentPassword"/>    </ns0:map-Key>    <ns0:map-Value>      <ns0:std-String value="current"/>    </ns0:map-Value>  </ns0:map-Entry>  <ns0:map-Entry>    <ns0:map-Key>      <ns0:std-String value="currentPasswordVerify"/>    </ns0:map-Key>    <ns0:map-Value>      <ns0:std-String value="current"/>    </ns0:map-Value>  </ns0:map-Entry>  <ns0:map-Entry>    <ns0:map-Key>      <ns0:std-String value="userLoginId"/>    </ns0:map-Key>    <ns0:map-Value>      <ns0:std-String value="zzzz"/>    </ns0:map-Value>  </ns0:map-Entry></map-Map>    </ns0:createPersonAndUserLogin>  </soapenv:Body></soapenv:Envelope>

SOAP返回结果:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">  <soapenv:Body>    <createPersonAndUserLoginResponse xmlns="http://ofbiz.apache.org/service/">      <map-Map>        <map-Entry>            <map-Key>                <std-String value="responseMessage"/>            </map-Key>            <map-Value>                <std-String value="success"/>            </map-Value>        </map-Entry>        <map-Entry>            <map-Key>                <std-String value="newUserLogin"/>            </map-Key>            <map-Value>                <eeval-UserLogin createdStamp="2016-10-18 06:56:53.933" createdTxStamp="2016-10-18 06:56:53.465" currentPassword="$SHA$O60VEwXuU0s$VnOxf3S6SU-rlVe20rqYzI4gfDY" lastUpdatedStamp="2016-10-18 06:56:53.933" lastUpdatedTxStamp="2016-10-18 06:56:53.465" partyId="10010" userLoginId="zzzz"/>            </map-Value>        </map-Entry>        <map-Entry>            <map-Key>                <std-String value="partyId"/>            </map-Key>            <map-Value>                <std-String value="10010"/>            </map-Value>        </map-Entry>    </map-Map>    </createPersonAndUserLoginResponse>  </soapenv:Body></soapenv:Envelope>

测试:
用增加的用户名zzzz/current登录Ofbiz电商平台 http://xxxx:8080/ecommerce,happy购物吧

0 0