2010-12-14 4 views
3

에서 복합 형은 내가 아래 WADL 파일을 사용하여 인증 절차를 테스트해야합니다WADL는 : 외부 XSD

<application xmlns="http://research.sun.com/wadl/2006/10" 
     xmlns:sis="http://sis.thecompany.com/" > 
<grammars> 
    <include href="http://localhost/wadl/sis.xsd"/> 
</grammars> 
<resources base="http://192.168.10.139"> 
    <resource path="/user/sign_in"> 
     <method name="POST" id="Authentication"> 
      <request> 
       <param name="user" type="sis:user" required="true"/> 
       <representation mediaType="application/xml" element="sis:user"/> 
      </request> 
      <response status="201"> 
       <representation mediaType="application/xml"/> 
       <fault status="401" /> 
      </response> 
     </method> 
    </resource> 
</resources> 

soapUI 프로에이 파일을 가져 오면 내가 요청을 클릭하여 어떠한 조치도 없어. 그 이유는 soapUI Pro는 xsd에있는 "sis : user"요소를 보지 않고 정의되지 않은 유형의 단일 요소라고 생각하기 때문입니다. wadl 파일에 문제가 있다고 조언 할 수 있습니까?

<?xml version="1.0" encoding="utf-8"?> <xs:schema id="SIS" targetNamespace="http://sis.thecompany.com/" elementFormDefault="qualified" xmlns="http://sis.thecompany.com/" xmlns:mstns="http://sis.thecompany.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> <xs:element name="application"> <xs:complexType> <xs:all> <xs:element name="user" minOccurs="0"> <xs:xs:complexType> <xs:all minOccurs="1"> <xs:element name="login" type="xs:string" /> <xs:element name="password" type="xs:string" /> </xs:all> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> </xs:schema>

그리고 다음 질문 :

아래 사용 sis.xsd 스키마입니다.

<sis:user><sis:login>admin</sis:login><sis:password>admin!</sis:password></sis:user> 

을하지만이 때문에 추가 접두사로 서버에 의해 거부됩니다 'SIS :'다음이 될 것입니다 soapUI 프로에서 POST 데이터 - soapUI 프로는 XSD에서 구문 분석 복합 타입의 요소를 사용자가 수정됩니다. 서버는 다음 형식 만 지원합니다.

<user><login>admin</login><password>admin!</password></user> 

조언을 구하십시오.

답변

0

내가 줄 수있는 최선의 조언은 WADL 사용을 중단하는 것입니다. 괜찮은 HTTP 라이브러리와 XML 구문 분석기를 사용중인 언어로 찾아 XML 파일을 만들고 POST하십시오. 이 작업을 수행하는 데는 몇 줄의 코드 만 있으면됩니다.

여러분이하고있는 방식대로 WADL과 xsd를 사용하면 클라이언트와 서버간에 긴밀한 결합이 이루어집니다. 이것은 REST 시스템이 가져야 할 이익의 대부분을 무효화 할 것입니다. 적어도 SOAP는 성숙한 SOAP을 사용하는 것이 좋습니다.