我必须调用WADL中声明的rest服务,但是我不知道如何读取描述中的文件。
这是该服务的文件说明:
-<resources base="http://xxxxxxxxxxxx:8000/webservices/rest/User/">
-<resource path="change_user_name/">
-<method name="POST" id="CHANGE_USER_NAME">
-<request>
<representation type="CHANGE_USER_NAME_Input" mediaType="application/xml"/>
<representation type="CHANGE_USER_NAME_Input" mediaType="application/json"/>
</request>
</method>
</resource>
-<resource path="isuseractive__1/">
-<method name="POST" id="ISUSERACTIVE__1">
-<request>
<representation type="ISUSERACTIVE__1_Input" mediaType="application/xml"/>
<representation type="ISUSERACTIVE__1_Input" mediaType="application/json"/>
</request>
-<response>
<representation type="ISUSERACTIVE__1_Output" mediaType="application/xml"/>
<representation type="ISUSERACTIVE__1_Output" mediaType="application/json"/>
</response>
</method>
</resource>
这是该方法的详细说明
<import schemaLocation="http://xxxxxxxxxxxxxxx:8000/webservices/rest/User/?XSD=RESTHeader.xsd" namespace="http://xmlns.oracle.com/apps/fnd/rest/header"/>
-<element name="InputParameters">
-<complexType>
-<sequence>
<element db:type="VARCHAR2" type="string" name="P_USERNAME" nillable="true" minOccurs="0" db:index="1"/>
</sequence>
</complexType>
</element>
我尝试使用POSTMAN调用服务:
http://xxxxxxxxxxxx:8000/webservices/rest/User/Isuseractive__1/ISUSERACTIVE__1
授权:
user:xxxx
password:xxx
正文:
{
"root":{
"P_USERNAME":"Perico"
}
}
它工作正常。
但是,当我尝试通过浏览器调用它时,出现400错误页面。
我尝试过
http://xxxxxxxxxxxx:8000/webservices/rest/User/Isuseractive__1/ISUSERACTIVE__1?P_USERNAME=PERICO
http://xxxxxxxxxxxx:8000/webservices/rest/User/Isuseractive__1/ISUSERACTIVE__1?P_USERNAME="PERICO"
更多组合,但无济于事。